gmshairfoil2d 0.2.31__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,228 @@
1
+ Metadata-Version: 2.4
2
+ Name: gmshairfoil2d
3
+ Version: 0.2.31
4
+ Summary: Python tool to generate 2D mesh around an airfoil
5
+ Home-page: https://github.com/cfsengineering/GMSH-Airfoil-2D
6
+ Author: Giacomo Benedetti
7
+ Author-email: giacomo.benedetti@cfse.ch
8
+ Keywords: airfoil,2D,mesh,cfd,gmsh
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Intended Audience :: Developers
13
+ Requires-Python: >=3.11.0
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: gmsh>=4.14
17
+ Requires-Dist: numpy>=2.2.4
18
+ Requires-Dist: pytest>=8.3.4
19
+ Requires-Dist: requests>=2.26.0
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: home-page
26
+ Dynamic: keywords
27
+ Dynamic: license-file
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
31
+
32
+ [![Pytest](https://github.com/cfsengineering/GMSH-Airfoil-2D/actions/workflows/pytest.yml/badge.svg?branch=main)](https://github.com/cfsengineering/GMSH-Airfoil-2D/actions/workflows/pytest.yml)
33
+ [![PyPi version](https://img.shields.io/pypi/v/gmshairfoil2d.svg)](https://pypi.python.org/pypi/gmshairfoil2d)
34
+ [![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://github.com/cfsengineering/GMSH-Airfoil-2D/blob/main/LICENSE)
35
+ [![Black code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
36
+
37
+ # GMSH-Airfoil-2D
38
+
39
+ Python tool to genreate 2D unstructured, hybrid and structured mesh around an airfoil with [GMSH](https://gmsh.info/) in one command line.
40
+
41
+ ## Installation
42
+
43
+ You can install this package from PyPi:
44
+
45
+ ```bash
46
+ pip install gmshairfoil2d
47
+ ```
48
+
49
+ Or you can clone and install this repository with the following commands:
50
+
51
+ ```bash
52
+ git clone https://github.com/cfsengineering/GMSH-Airfoil-2D.git
53
+ cd GMSH-Airfoil-2D
54
+ pip install -e .
55
+ ```
56
+
57
+ ## Usage
58
+
59
+ ```text
60
+ gmshairfoil2d -h
61
+
62
+ optional arguments:
63
+ -h, --help Show this help message and exit
64
+ --config [PATH] Path to configuration file (key=value format)
65
+ --save_config [PATH] Save current configuration to file
66
+ --example_config Create an example configuration file
67
+ --list Display all airfoil available in the database :
68
+ https://m-selig.ae.illinois.edu/ads/coord_database.html
69
+ --naca [4DIGITS] NACA airfoil 4 digit
70
+ --airfoil [NAME] Name of an airfoil profile in the database (database available with
71
+ the --list argument)
72
+ --airfoil_path [PATH] Path to custom airfoil .dat file
73
+ --flap_path [PATH] Path to custom flap .dat file
74
+ --aoa [AOA] Angle of attack [deg] (default: 0 [deg])
75
+ --deflection [DEFLECTION] Flap deflection angle [deg] (default: 0 [deg])
76
+ --farfield [RADIUS] Create a circular farfield mesh of given radius [m] (default 10m)
77
+ --farfield_ctype Generate a C-type structured farfield for hybrid meshes
78
+ --box [LENGTHxWIDTH] Create a box mesh of dimensions [length]x[height] [m]
79
+ --airfoil_mesh_size [SIZE] Mesh size of the airfoil contour [m] (default 0.01m)
80
+ --ext_mesh_size [SIZE] Mesh size of the external domain [m] (default 0.2m)
81
+ --no_bl Do the unstructured meshing (with triangles), without a boundary
82
+ layer
83
+ --first_layer [HEIGHT] Height of the first layer [m] (default 3e-5m) (for bl and structured)
84
+ --ratio [RATIO] Growth ratio of layers (default 1.2) (for bl and structured)
85
+ --nb_layers [INT] Total number of layers in the boundary layer (default 35)
86
+ --format [FORMAT] Format of the mesh file, e.g: msh, vtk, wrl, stl, mesh, cgns, su2,
87
+ dat (default su2)
88
+ --structured Generate a structured mesh
89
+ --arg_struc [LxL] Parameters for the structured mesh [wake length (axis x)]x[total
90
+ height (axis y)] [m] (default 10x10)
91
+ --output [PATH] Output path for the mesh file (default : current dir)
92
+ --ui Open GMSH user interface to see the mesh
93
+
94
+ ```
95
+
96
+ ## Configuration Files
97
+
98
+ Instead of using command-line arguments, you can use configuration files for batch processing. Configuration files use a simple `key=value` format with support for comments.
99
+
100
+ **Create an example configuration file:**
101
+
102
+ ```bash
103
+ gmshairfoil2d --example_config
104
+ ```
105
+
106
+ **Use a configuration file:**
107
+
108
+ ```bash
109
+ gmshairfoil2d --config my_config.cfg
110
+ ```
111
+
112
+ **Override config values with CLI arguments:**
113
+
114
+ ```bash
115
+ gmshairfoil2d --config my_config.cfg --aoa 5.0
116
+ ```
117
+
118
+ **Save current configuration to file:**
119
+
120
+ ```bash
121
+ gmshairfoil2d --naca 0012 --aoa 5.0 --save_config my_config.cfg
122
+ ```
123
+
124
+ For more details, see [example/CONFIG_README.md](example/CONFIG_README.md) and ready-to-use examples in [example/EXAMPLES_README.md](example/EXAMPLES_README.md).
125
+
126
+ ## Examples of use
127
+
128
+ To check all airfoil available in the [database](https://m-selig.ae.illinois.edu/ads/coord_database.html):
129
+
130
+ ```bash
131
+ gmshairfoil2d --list
132
+ ```
133
+
134
+ For all the following examples, the default chord length is 1 meter.
135
+
136
+ ### Example 1: NACA0012 with circular farfield
137
+
138
+ To create a circular farfield mesh around a NACA0012 of 10m of radius and see the result with GMSH user interface:
139
+
140
+ ```bash
141
+ gmshairfoil2d --naca 0012 --farfield 10 --ui --no_bl
142
+ ```
143
+
144
+ Or using config file:
145
+
146
+ ```bash
147
+ gmshairfoil2d --config example/example1_naca0012.cfg
148
+ ```
149
+
150
+ ![GMSH user interface with the 2D mesh](images/example_mesh.png)
151
+
152
+ ### Example 2: DAE11 with boundary layer
153
+
154
+ To create a circular farfield mesh with boundary layer around a Drela DAE11 airfoil (the name in the database is "dae11") of 4m of radius with a mesh size of 0.005m on the airfoil:
155
+
156
+ ```bash
157
+ gmshairfoil2d --airfoil dae11 --farfield 4 --airfoil_mesh_size 0.005
158
+ ```
159
+
160
+ Or using config file:
161
+
162
+ ```bash
163
+ gmshairfoil2d --config example/example2_dae11.cfg
164
+ ```
165
+
166
+ ### Example 3: E211 in box with angle of attack
167
+
168
+ To create mesh around an Eppler E211 airfoil (the name in the database is "e211") with an angle of attack of 8 degree in a box of 12x4m (length x height) and save it as a VTK mesh:
169
+
170
+ ```bash
171
+ gmshairfoil2d --airfoil e211 --aoa 8 --box 12x4 --format vtk --ui --no_bl
172
+ ```
173
+
174
+ Or using config file:
175
+
176
+ ```bash
177
+ gmshairfoil2d --config example/example3_e211_box.cfg
178
+ ```
179
+
180
+ ![GMSH user interface with the 2D mesh, rectangular box](images/example_mesh_box.png)
181
+
182
+ ### Example 4: CH10SM with box and boundary layer
183
+
184
+ To create a boxed mesh around a Chuck Hollinger CH10SM airfoil (the name in the database is "ch10sm"), using the boundary layer with default parameters (first layer of height 3e-5, 35 layers and growth ratio of 1.2):
185
+
186
+ ```bash
187
+ gmshairfoil2d --airfoil ch10sm --ui --box 2x1.4
188
+ ```
189
+
190
+ Or using config file:
191
+
192
+ ```bash
193
+ gmshairfoil2d --config example/example4_ch10sm_bl.cfg
194
+ ```
195
+
196
+ ![GMSH result with 2D mesh with boundary layer, rectangular box](images/example_ch10sm_bl.png)
197
+
198
+ ### Example 5: NACA4220 structured mesh
199
+
200
+ To create a structured mesh around a NACA4220 airfoil with first layer height of 0.01, mesh size of 0.08, wake length of 6, height of 7, and angle of attack of 6 degrees:
201
+
202
+ ```bash
203
+ gmshairfoil2d --naca 4220 --airfoil_mesh_size 0.08 --ui --structured --first_layer 0.01 --arg_struc 6x7 --aoa 6
204
+ ```
205
+
206
+ Or using config file:
207
+
208
+ ```bash
209
+ gmshairfoil2d --config example/example5_naca4220_structured.cfg
210
+ ```
211
+
212
+ ![GMSH result with 2D structured mesh](images/example_structured_naca4220.png)
213
+ ### Example 6: Custom airfoil from file
214
+
215
+ To create a mesh around a custom airfoil profile with a deflected flap:
216
+
217
+ ```bash
218
+ gmshairfoil2d --airfoil_path tests/test_data/NLR_7301.dat --flap_path tests/test_data/Flap_NLR_7301.dat --deflection 10 --box 4x3 --ui --no_bl
219
+ ```
220
+
221
+ Or using config file:
222
+
223
+ ```bash
224
+ gmshairfoil2d --config example/example6_custom_airfoil_flap.cfg
225
+ ```
226
+
227
+ This example shows how to load custom airfoil and flap profiles from external .dat files and generate a mesh with flap deflection, useful for using proprietary or custom-designed airfoil geometries.
228
+ ![GMSH result with 2D mesh around a custom flapped airfoil](images/example_flapped_airfoil.png)
@@ -0,0 +1,197 @@
1
+ [![Pytest](https://github.com/cfsengineering/GMSH-Airfoil-2D/actions/workflows/pytest.yml/badge.svg?branch=main)](https://github.com/cfsengineering/GMSH-Airfoil-2D/actions/workflows/pytest.yml)
2
+ [![PyPi version](https://img.shields.io/pypi/v/gmshairfoil2d.svg)](https://pypi.python.org/pypi/gmshairfoil2d)
3
+ [![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://github.com/cfsengineering/GMSH-Airfoil-2D/blob/main/LICENSE)
4
+ [![Black code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
5
+
6
+ # GMSH-Airfoil-2D
7
+
8
+ Python tool to genreate 2D unstructured, hybrid and structured mesh around an airfoil with [GMSH](https://gmsh.info/) in one command line.
9
+
10
+ ## Installation
11
+
12
+ You can install this package from PyPi:
13
+
14
+ ```bash
15
+ pip install gmshairfoil2d
16
+ ```
17
+
18
+ Or you can clone and install this repository with the following commands:
19
+
20
+ ```bash
21
+ git clone https://github.com/cfsengineering/GMSH-Airfoil-2D.git
22
+ cd GMSH-Airfoil-2D
23
+ pip install -e .
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ ```text
29
+ gmshairfoil2d -h
30
+
31
+ optional arguments:
32
+ -h, --help Show this help message and exit
33
+ --config [PATH] Path to configuration file (key=value format)
34
+ --save_config [PATH] Save current configuration to file
35
+ --example_config Create an example configuration file
36
+ --list Display all airfoil available in the database :
37
+ https://m-selig.ae.illinois.edu/ads/coord_database.html
38
+ --naca [4DIGITS] NACA airfoil 4 digit
39
+ --airfoil [NAME] Name of an airfoil profile in the database (database available with
40
+ the --list argument)
41
+ --airfoil_path [PATH] Path to custom airfoil .dat file
42
+ --flap_path [PATH] Path to custom flap .dat file
43
+ --aoa [AOA] Angle of attack [deg] (default: 0 [deg])
44
+ --deflection [DEFLECTION] Flap deflection angle [deg] (default: 0 [deg])
45
+ --farfield [RADIUS] Create a circular farfield mesh of given radius [m] (default 10m)
46
+ --farfield_ctype Generate a C-type structured farfield for hybrid meshes
47
+ --box [LENGTHxWIDTH] Create a box mesh of dimensions [length]x[height] [m]
48
+ --airfoil_mesh_size [SIZE] Mesh size of the airfoil contour [m] (default 0.01m)
49
+ --ext_mesh_size [SIZE] Mesh size of the external domain [m] (default 0.2m)
50
+ --no_bl Do the unstructured meshing (with triangles), without a boundary
51
+ layer
52
+ --first_layer [HEIGHT] Height of the first layer [m] (default 3e-5m) (for bl and structured)
53
+ --ratio [RATIO] Growth ratio of layers (default 1.2) (for bl and structured)
54
+ --nb_layers [INT] Total number of layers in the boundary layer (default 35)
55
+ --format [FORMAT] Format of the mesh file, e.g: msh, vtk, wrl, stl, mesh, cgns, su2,
56
+ dat (default su2)
57
+ --structured Generate a structured mesh
58
+ --arg_struc [LxL] Parameters for the structured mesh [wake length (axis x)]x[total
59
+ height (axis y)] [m] (default 10x10)
60
+ --output [PATH] Output path for the mesh file (default : current dir)
61
+ --ui Open GMSH user interface to see the mesh
62
+
63
+ ```
64
+
65
+ ## Configuration Files
66
+
67
+ Instead of using command-line arguments, you can use configuration files for batch processing. Configuration files use a simple `key=value` format with support for comments.
68
+
69
+ **Create an example configuration file:**
70
+
71
+ ```bash
72
+ gmshairfoil2d --example_config
73
+ ```
74
+
75
+ **Use a configuration file:**
76
+
77
+ ```bash
78
+ gmshairfoil2d --config my_config.cfg
79
+ ```
80
+
81
+ **Override config values with CLI arguments:**
82
+
83
+ ```bash
84
+ gmshairfoil2d --config my_config.cfg --aoa 5.0
85
+ ```
86
+
87
+ **Save current configuration to file:**
88
+
89
+ ```bash
90
+ gmshairfoil2d --naca 0012 --aoa 5.0 --save_config my_config.cfg
91
+ ```
92
+
93
+ For more details, see [example/CONFIG_README.md](example/CONFIG_README.md) and ready-to-use examples in [example/EXAMPLES_README.md](example/EXAMPLES_README.md).
94
+
95
+ ## Examples of use
96
+
97
+ To check all airfoil available in the [database](https://m-selig.ae.illinois.edu/ads/coord_database.html):
98
+
99
+ ```bash
100
+ gmshairfoil2d --list
101
+ ```
102
+
103
+ For all the following examples, the default chord length is 1 meter.
104
+
105
+ ### Example 1: NACA0012 with circular farfield
106
+
107
+ To create a circular farfield mesh around a NACA0012 of 10m of radius and see the result with GMSH user interface:
108
+
109
+ ```bash
110
+ gmshairfoil2d --naca 0012 --farfield 10 --ui --no_bl
111
+ ```
112
+
113
+ Or using config file:
114
+
115
+ ```bash
116
+ gmshairfoil2d --config example/example1_naca0012.cfg
117
+ ```
118
+
119
+ ![GMSH user interface with the 2D mesh](images/example_mesh.png)
120
+
121
+ ### Example 2: DAE11 with boundary layer
122
+
123
+ To create a circular farfield mesh with boundary layer around a Drela DAE11 airfoil (the name in the database is "dae11") of 4m of radius with a mesh size of 0.005m on the airfoil:
124
+
125
+ ```bash
126
+ gmshairfoil2d --airfoil dae11 --farfield 4 --airfoil_mesh_size 0.005
127
+ ```
128
+
129
+ Or using config file:
130
+
131
+ ```bash
132
+ gmshairfoil2d --config example/example2_dae11.cfg
133
+ ```
134
+
135
+ ### Example 3: E211 in box with angle of attack
136
+
137
+ To create mesh around an Eppler E211 airfoil (the name in the database is "e211") with an angle of attack of 8 degree in a box of 12x4m (length x height) and save it as a VTK mesh:
138
+
139
+ ```bash
140
+ gmshairfoil2d --airfoil e211 --aoa 8 --box 12x4 --format vtk --ui --no_bl
141
+ ```
142
+
143
+ Or using config file:
144
+
145
+ ```bash
146
+ gmshairfoil2d --config example/example3_e211_box.cfg
147
+ ```
148
+
149
+ ![GMSH user interface with the 2D mesh, rectangular box](images/example_mesh_box.png)
150
+
151
+ ### Example 4: CH10SM with box and boundary layer
152
+
153
+ To create a boxed mesh around a Chuck Hollinger CH10SM airfoil (the name in the database is "ch10sm"), using the boundary layer with default parameters (first layer of height 3e-5, 35 layers and growth ratio of 1.2):
154
+
155
+ ```bash
156
+ gmshairfoil2d --airfoil ch10sm --ui --box 2x1.4
157
+ ```
158
+
159
+ Or using config file:
160
+
161
+ ```bash
162
+ gmshairfoil2d --config example/example4_ch10sm_bl.cfg
163
+ ```
164
+
165
+ ![GMSH result with 2D mesh with boundary layer, rectangular box](images/example_ch10sm_bl.png)
166
+
167
+ ### Example 5: NACA4220 structured mesh
168
+
169
+ To create a structured mesh around a NACA4220 airfoil with first layer height of 0.01, mesh size of 0.08, wake length of 6, height of 7, and angle of attack of 6 degrees:
170
+
171
+ ```bash
172
+ gmshairfoil2d --naca 4220 --airfoil_mesh_size 0.08 --ui --structured --first_layer 0.01 --arg_struc 6x7 --aoa 6
173
+ ```
174
+
175
+ Or using config file:
176
+
177
+ ```bash
178
+ gmshairfoil2d --config example/example5_naca4220_structured.cfg
179
+ ```
180
+
181
+ ![GMSH result with 2D structured mesh](images/example_structured_naca4220.png)
182
+ ### Example 6: Custom airfoil from file
183
+
184
+ To create a mesh around a custom airfoil profile with a deflected flap:
185
+
186
+ ```bash
187
+ gmshairfoil2d --airfoil_path tests/test_data/NLR_7301.dat --flap_path tests/test_data/Flap_NLR_7301.dat --deflection 10 --box 4x3 --ui --no_bl
188
+ ```
189
+
190
+ Or using config file:
191
+
192
+ ```bash
193
+ gmshairfoil2d --config example/example6_custom_airfoil_flap.cfg
194
+ ```
195
+
196
+ This example shows how to load custom airfoil and flap profiles from external .dat files and generate a mesh with flap deflection, useful for using proprietary or custom-designed airfoil geometries.
197
+ ![GMSH result with 2D mesh around a custom flapped airfoil](images/example_flapped_airfoil.png)
@@ -0,0 +1,3 @@
1
+ """GMSH-Airfoil-2D: 2D airfoil mesh generation with GMSH."""
2
+
3
+ __version__ = "1.0.0"
@@ -0,0 +1,6 @@
1
+ """Entry point for the gmshairfoil2d package."""
2
+
3
+ from gmshairfoil2d.gmshairfoil2d import main
4
+
5
+ if __name__ == "__main__":
6
+ main()