gmshairfoil2d 0.2.3__tar.gz → 0.2.32__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.
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/PKG-INFO +5 -4
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/README.md +1 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/gmshairfoil2d/__init__.py +1 -1
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/gmshairfoil2d/airfoil_func.py +11 -6
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/gmshairfoil2d/gmshairfoil2d.py +3 -2
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/gmshairfoil2d.egg-info/PKG-INFO +5 -4
- gmshairfoil2d-0.2.32/gmshairfoil2d.egg-info/requires.txt +4 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/setup.py +6 -4
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/tests/test_airfoil_func.py +4 -4
- gmshairfoil2d-0.2.3/gmshairfoil2d.egg-info/requires.txt +0 -4
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/LICENSE +0 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/gmshairfoil2d/__main__.py +0 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/gmshairfoil2d/config_handler.py +0 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/gmshairfoil2d/geometry_def.py +0 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/gmshairfoil2d.egg-info/SOURCES.txt +0 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/gmshairfoil2d.egg-info/dependency_links.txt +0 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/gmshairfoil2d.egg-info/entry_points.txt +0 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/gmshairfoil2d.egg-info/top_level.txt +0 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/setup.cfg +0 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/tests/__init__.py +0 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/tests/test_config_handler.py +0 -0
- {gmshairfoil2d-0.2.3 → gmshairfoil2d-0.2.32}/tests/test_geometry_def.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gmshairfoil2d
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.32
|
|
4
4
|
Summary: Python tool to generate 2D mesh around an airfoil
|
|
5
5
|
Home-page: https://github.com/cfsengineering/GMSH-Airfoil-2D
|
|
6
6
|
Author: Giacomo Benedetti
|
|
@@ -14,9 +14,9 @@ Requires-Python: >=3.11.0
|
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
Requires-Dist: gmsh>=4.14
|
|
17
|
-
Requires-Dist: numpy>=
|
|
18
|
-
Requires-Dist: pytest
|
|
19
|
-
Requires-Dist: requests
|
|
17
|
+
Requires-Dist: numpy>=2.2.4
|
|
18
|
+
Requires-Dist: pytest>=8.3.4
|
|
19
|
+
Requires-Dist: requests>=2.26.0
|
|
20
20
|
Dynamic: author
|
|
21
21
|
Dynamic: author-email
|
|
22
22
|
Dynamic: classifier
|
|
@@ -225,3 +225,4 @@ gmshairfoil2d --config example/example6_custom_airfoil_flap.cfg
|
|
|
225
225
|
```
|
|
226
226
|
|
|
227
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
|
+

|
|
@@ -194,3 +194,4 @@ gmshairfoil2d --config example/example6_custom_airfoil_flap.cfg
|
|
|
194
194
|
```
|
|
195
195
|
|
|
196
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
|
+

|
|
@@ -131,7 +131,7 @@ def get_airfoil_file(airfoil_name):
|
|
|
131
131
|
sys.exit(1)
|
|
132
132
|
|
|
133
133
|
|
|
134
|
-
def get_airfoil_points(airfoil_name):
|
|
134
|
+
def get_airfoil_points(airfoil_name: str) -> list[tuple[float, float, float]]:
|
|
135
135
|
"""Load airfoil points from the database.
|
|
136
136
|
|
|
137
137
|
Parameters
|
|
@@ -149,6 +149,11 @@ def get_airfoil_points(airfoil_name):
|
|
|
149
149
|
ValueError
|
|
150
150
|
If no valid points found for the airfoil
|
|
151
151
|
"""
|
|
152
|
+
if len(airfoil_name) == 4 and airfoil_name.isdigit():
|
|
153
|
+
return four_digit_naca_airfoil(
|
|
154
|
+
naca_name=airfoil_name,
|
|
155
|
+
)
|
|
156
|
+
|
|
152
157
|
get_airfoil_file(airfoil_name)
|
|
153
158
|
airfoil_file = Path(database_dir, f"{airfoil_name}.dat")
|
|
154
159
|
|
|
@@ -188,13 +193,13 @@ def get_airfoil_points(airfoil_name):
|
|
|
188
193
|
return sorted(set(cloud_points), key=cloud_points.index)
|
|
189
194
|
|
|
190
195
|
|
|
191
|
-
def
|
|
196
|
+
def four_digit_naca_airfoil(naca_name: str, nb_points: int = 100):
|
|
192
197
|
"""
|
|
193
198
|
Compute the profile of a NACA 4 digits airfoil
|
|
194
199
|
|
|
195
200
|
Parameters
|
|
196
201
|
----------
|
|
197
|
-
|
|
202
|
+
naca_name : str
|
|
198
203
|
4 digit of the NACA airfoil
|
|
199
204
|
nb_points : int, optional
|
|
200
205
|
number of points for the disrcetisation of
|
|
@@ -208,9 +213,9 @@ def NACA_4_digit_geom(NACA_name, nb_points=100):
|
|
|
208
213
|
theta_line = np.linspace(0, np.pi, nb_points)
|
|
209
214
|
x_line = 0.5 * (1 - np.cos(theta_line))
|
|
210
215
|
|
|
211
|
-
m = int(
|
|
212
|
-
p = int(
|
|
213
|
-
t = (int(
|
|
216
|
+
m = int(naca_name[0]) / 100
|
|
217
|
+
p = int(naca_name[1]) / 10
|
|
218
|
+
t = (int(naca_name[2]) * 10 + int(naca_name[3])) / 100
|
|
214
219
|
|
|
215
220
|
# thickness line
|
|
216
221
|
y_t = (
|
|
@@ -6,7 +6,7 @@ import sys
|
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
8
|
import gmsh
|
|
9
|
-
from gmshairfoil2d.airfoil_func import (
|
|
9
|
+
from gmshairfoil2d.airfoil_func import (four_digit_naca_airfoil, get_airfoil_points,
|
|
10
10
|
get_all_available_airfoil_names, read_airfoil_from_file)
|
|
11
11
|
from gmshairfoil2d.geometry_def import (AirfoilSpline, Circle, PlaneSurface,
|
|
12
12
|
Rectangle, outofbounds, CType)
|
|
@@ -349,7 +349,7 @@ def main():
|
|
|
349
349
|
|
|
350
350
|
if args.naca:
|
|
351
351
|
airfoil_name = args.naca
|
|
352
|
-
cloud_points =
|
|
352
|
+
cloud_points = four_digit_naca_airfoil(airfoil_name)
|
|
353
353
|
|
|
354
354
|
if args.airfoil:
|
|
355
355
|
airfoil_name = args.airfoil
|
|
@@ -542,5 +542,6 @@ def main():
|
|
|
542
542
|
from gmshairfoil2d.config_handler import write_config
|
|
543
543
|
write_config(config_dict, args.save_config)
|
|
544
544
|
|
|
545
|
+
|
|
545
546
|
if __name__ == "__main__":
|
|
546
547
|
main()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gmshairfoil2d
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.32
|
|
4
4
|
Summary: Python tool to generate 2D mesh around an airfoil
|
|
5
5
|
Home-page: https://github.com/cfsengineering/GMSH-Airfoil-2D
|
|
6
6
|
Author: Giacomo Benedetti
|
|
@@ -14,9 +14,9 @@ Requires-Python: >=3.11.0
|
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
Requires-Dist: gmsh>=4.14
|
|
17
|
-
Requires-Dist: numpy>=
|
|
18
|
-
Requires-Dist: pytest
|
|
19
|
-
Requires-Dist: requests
|
|
17
|
+
Requires-Dist: numpy>=2.2.4
|
|
18
|
+
Requires-Dist: pytest>=8.3.4
|
|
19
|
+
Requires-Dist: requests>=2.26.0
|
|
20
20
|
Dynamic: author
|
|
21
21
|
Dynamic: author-email
|
|
22
22
|
Dynamic: classifier
|
|
@@ -225,3 +225,4 @@ gmshairfoil2d --config example/example6_custom_airfoil_flap.cfg
|
|
|
225
225
|
```
|
|
226
226
|
|
|
227
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
|
+

|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
+
from gmshairfoil2d import __version__
|
|
3
|
+
|
|
2
4
|
from setuptools import setup, find_packages
|
|
3
5
|
|
|
4
6
|
NAME = "gmshairfoil2d"
|
|
5
|
-
VERSION =
|
|
7
|
+
VERSION = __version__
|
|
6
8
|
AUTHOR = "Giacomo Benedetti"
|
|
7
9
|
EMAIL = "giacomo.benedetti@cfse.ch"
|
|
8
10
|
DESCRIPTION = "Python tool to generate 2D mesh around an airfoil"
|
|
@@ -42,9 +44,9 @@ setup(
|
|
|
42
44
|
|
|
43
45
|
install_requires=[
|
|
44
46
|
"gmsh>=4.14",
|
|
45
|
-
"numpy>=
|
|
46
|
-
"pytest
|
|
47
|
-
"requests
|
|
47
|
+
"numpy>=2.2.4",
|
|
48
|
+
"pytest>=8.3.4",
|
|
49
|
+
"requests>=2.26.0",
|
|
48
50
|
],
|
|
49
51
|
classifiers=[
|
|
50
52
|
"Programming Language :: Python :: 3.11",
|
|
@@ -3,7 +3,7 @@ from pathlib import Path
|
|
|
3
3
|
from unittest.mock import patch, Mock
|
|
4
4
|
|
|
5
5
|
import gmshairfoil2d.__init__
|
|
6
|
-
from gmshairfoil2d.airfoil_func import (
|
|
6
|
+
from gmshairfoil2d.airfoil_func import (four_digit_naca_airfoil, get_airfoil_file,
|
|
7
7
|
get_all_available_airfoil_names, read_airfoil_from_file)
|
|
8
8
|
from pytest import approx
|
|
9
9
|
|
|
@@ -58,7 +58,7 @@ def test_get_airfoil_file(monkeypatch, tmp_path):
|
|
|
58
58
|
assert expected_path.read_text() == fake_text
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
def
|
|
61
|
+
def test_four_digit_naca_airfoil():
|
|
62
62
|
with open(Path(test_data_dir, "naca0012.txt"), "rb") as f:
|
|
63
63
|
naca0012 = pickle.load(f)
|
|
64
64
|
with open(Path(test_data_dir, "naca4412.txt"), "rb") as f:
|
|
@@ -69,11 +69,11 @@ def test_NACA_4_digit_geom():
|
|
|
69
69
|
"""
|
|
70
70
|
|
|
71
71
|
assert all(
|
|
72
|
-
[a == approx(b, 1e-3) for a, b in zip(naca0012,
|
|
72
|
+
[a == approx(b, 1e-3) for a, b in zip(naca0012, four_digit_naca_airfoil("0012"))]
|
|
73
73
|
)
|
|
74
74
|
|
|
75
75
|
assert all(
|
|
76
|
-
[a == approx(b, 1e-3) for a, b in zip(naca4412,
|
|
76
|
+
[a == approx(b, 1e-3) for a, b in zip(naca4412, four_digit_naca_airfoil("4412"))]
|
|
77
77
|
)
|
|
78
78
|
|
|
79
79
|
def test_read_airfoil_from_file(tmp_path):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|