gmshairfoil2d 0.2.3__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 CHANGED
@@ -1,3 +1,3 @@
1
1
  """GMSH-Airfoil-2D: 2D airfoil mesh generation with GMSH."""
2
2
 
3
- __version__ = "1.0.0"
3
+ __version__ = "0.2.32"
@@ -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 NACA_4_digit_geom(NACA_name, nb_points=100):
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
- NACA_name : str
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(NACA_name[0]) / 100
212
- p = int(NACA_name[1]) / 10
213
- t = (int(NACA_name[2]) * 10 + int(NACA_name[3])) / 100
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 (NACA_4_digit_geom, get_airfoil_points,
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 = NACA_4_digit_geom(airfoil_name)
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
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>=1.20.3
18
- Requires-Dist: pytest==7.1.3
19
- Requires-Dist: requests==2.26.0
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
+ ![GMSH result with 2D mesh around a custom flapped airfoil](images/example_flapped_airfoil.png)
@@ -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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -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 (NACA_4_digit_geom, get_airfoil_file,
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 test_NACA_4_digit_geom():
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, NACA_4_digit_geom("0012"))]
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, NACA_4_digit_geom("4412"))]
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.3.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.3.dist-info/METADATA,sha256=WP9jWHSg8z1bSsyYFuYMdG36-AqspQWKO6T-vHlQzFc,8152
13
- gmshairfoil2d-0.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- gmshairfoil2d-0.2.3.dist-info/entry_points.txt,sha256=6OBSsEXNhTICrsEGgfg30RGIkKRFXELizYtfZfT1_zk,67
15
- gmshairfoil2d-0.2.3.dist-info/top_level.txt,sha256=OUzQHTQIzJHlW1k6tm_9PLfE4eEWkwH0oOYNUuUXekw,20
16
- gmshairfoil2d-0.2.3.dist-info/RECORD,,