gmshairfoil2d 0.2.31__py3-none-any.whl → 0.2.32__py3-none-any.whl
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/__init__.py +1 -1
- gmshairfoil2d/airfoil_func.py +11 -6
- gmshairfoil2d/gmshairfoil2d.py +3 -2
- {gmshairfoil2d-0.2.31.dist-info → gmshairfoil2d-0.2.32.dist-info}/METADATA +1 -1
- gmshairfoil2d-0.2.32.dist-info/RECORD +16 -0
- tests/test_airfoil_func.py +4 -4
- gmshairfoil2d-0.2.31.dist-info/RECORD +0 -16
- {gmshairfoil2d-0.2.31.dist-info → gmshairfoil2d-0.2.32.dist-info}/WHEEL +0 -0
- {gmshairfoil2d-0.2.31.dist-info → gmshairfoil2d-0.2.32.dist-info}/entry_points.txt +0 -0
- {gmshairfoil2d-0.2.31.dist-info → gmshairfoil2d-0.2.32.dist-info}/licenses/LICENSE +0 -0
- {gmshairfoil2d-0.2.31.dist-info → gmshairfoil2d-0.2.32.dist-info}/top_level.txt +0 -0
gmshairfoil2d/__init__.py
CHANGED
gmshairfoil2d/airfoil_func.py
CHANGED
|
@@ -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 = (
|
gmshairfoil2d/gmshairfoil2d.py
CHANGED
|
@@ -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()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
gmshairfoil2d/__init__.py,sha256=lZL-h4zoINU3m347I2O4lsGbT6ZI5M4-5cftGJtaCIk,85
|
|
2
|
+
gmshairfoil2d/__main__.py,sha256=SdT5IPOCPld7yGCoC3cb6v55E9Ys3KeM1vrVocBqtG4,134
|
|
3
|
+
gmshairfoil2d/airfoil_func.py,sha256=9h_kQ0l-tJmtrmuCJmP-Psa_qIOewzhjVREHGZuk6Ro,7749
|
|
4
|
+
gmshairfoil2d/config_handler.py,sha256=WM10C_yxlAl6A0sAsgW9KbfIHnrWOhvwMbs7F_AQePI,5490
|
|
5
|
+
gmshairfoil2d/geometry_def.py,sha256=D3FuRfaZ_YgHTvDW3KWB6Cya_2tJEktFvZkTA13h7pQ,48800
|
|
6
|
+
gmshairfoil2d/gmshairfoil2d.py,sha256=2j3JqSsPyTzeV2nvaoBjqb18v-oD3tLM3dz8dabkAfI,18670
|
|
7
|
+
gmshairfoil2d-0.2.32.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
8
|
+
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
tests/test_airfoil_func.py,sha256=Q7I9_9v97V52M-qzhV42IJnCDntA5TV3z_gif2a7ua8,4182
|
|
10
|
+
tests/test_config_handler.py,sha256=TI0OvZRbsho8mjzf1kUXLQ-rm_6dGY4b6w9RxYDxS5A,6449
|
|
11
|
+
tests/test_geometry_def.py,sha256=Ox_ePu1sZs5dOZTsPj87b3b_gHwrC3UzyoJsuL-VeUk,1325
|
|
12
|
+
gmshairfoil2d-0.2.32.dist-info/METADATA,sha256=Gcwxq0DE-QUCTD4uSGzqd2R1trgGD-0Pw-KrJ-9rReo,8248
|
|
13
|
+
gmshairfoil2d-0.2.32.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
14
|
+
gmshairfoil2d-0.2.32.dist-info/entry_points.txt,sha256=6OBSsEXNhTICrsEGgfg30RGIkKRFXELizYtfZfT1_zk,67
|
|
15
|
+
gmshairfoil2d-0.2.32.dist-info/top_level.txt,sha256=OUzQHTQIzJHlW1k6tm_9PLfE4eEWkwH0oOYNUuUXekw,20
|
|
16
|
+
gmshairfoil2d-0.2.32.dist-info/RECORD,,
|
tests/test_airfoil_func.py
CHANGED
|
@@ -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):
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
gmshairfoil2d/__init__.py,sha256=VEFFbq6EClONvPaNYBMGUnR64J06nJaO_ErPZi6WyRE,84
|
|
2
|
-
gmshairfoil2d/__main__.py,sha256=SdT5IPOCPld7yGCoC3cb6v55E9Ys3KeM1vrVocBqtG4,134
|
|
3
|
-
gmshairfoil2d/airfoil_func.py,sha256=UGugj2Djp-7JTv_AzEwmQcMQNMtqHSVzAdIIxZNwDyQ,7545
|
|
4
|
-
gmshairfoil2d/config_handler.py,sha256=WM10C_yxlAl6A0sAsgW9KbfIHnrWOhvwMbs7F_AQePI,5490
|
|
5
|
-
gmshairfoil2d/geometry_def.py,sha256=D3FuRfaZ_YgHTvDW3KWB6Cya_2tJEktFvZkTA13h7pQ,48800
|
|
6
|
-
gmshairfoil2d/gmshairfoil2d.py,sha256=acEOhx8IlhRkXfFP-C-3rtqlslXgbIW276Xcz3k5Tq8,18657
|
|
7
|
-
gmshairfoil2d-0.2.31.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
8
|
-
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
tests/test_airfoil_func.py,sha256=uCzaCbr4BHfKCHF_9gEQ7hzgwQSt7rEZRrRCbEOtOlw,4158
|
|
10
|
-
tests/test_config_handler.py,sha256=TI0OvZRbsho8mjzf1kUXLQ-rm_6dGY4b6w9RxYDxS5A,6449
|
|
11
|
-
tests/test_geometry_def.py,sha256=Ox_ePu1sZs5dOZTsPj87b3b_gHwrC3UzyoJsuL-VeUk,1325
|
|
12
|
-
gmshairfoil2d-0.2.31.dist-info/METADATA,sha256=lwQWTpntG0cPpQJdyMWms0OnQBeG6Oyd-li_fZ4fB44,8248
|
|
13
|
-
gmshairfoil2d-0.2.31.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
14
|
-
gmshairfoil2d-0.2.31.dist-info/entry_points.txt,sha256=6OBSsEXNhTICrsEGgfg30RGIkKRFXELizYtfZfT1_zk,67
|
|
15
|
-
gmshairfoil2d-0.2.31.dist-info/top_level.txt,sha256=OUzQHTQIzJHlW1k6tm_9PLfE4eEWkwH0oOYNUuUXekw,20
|
|
16
|
-
gmshairfoil2d-0.2.31.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|