Skip to content

Commit eae5cdc

Browse files
committed
Updated naming to use Airfoil2D and Airfoil3D
Code should work better now
1 parent 27eb927 commit eae5cdc

File tree

7 files changed

+39
-38
lines changed

7 files changed

+39
-38
lines changed

2D_design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import numpy as np
1010
from pyturbo.aero import *
1111
from pyturbo.helper import *
1212
13-
stator_hub = airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58) # This creates the camberline
13+
stator_hub = Airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58) # This creates the camberline
1414
stator_hub.le_thickness_add(0.04)
1515
ps_height = [0.0500,0.0200,-0.0100]
1616
ps_height_loc = exp_ratio(1.2,len(ps_height)+2,0.95)

3D_design.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The code below shows an example of how to build a 3D Blade from 2D designs locat
1515

1616
```
1717
# Hub Geometry
18-
stator_hub = airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
18+
stator_hub = Airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
1919
stator_hub.le_thickness_add(0.04)
2020
ps_height = [0.0500,0.0200,-0.0100]
2121
ps_height = [0.0500,0.0200,-0.0100]
@@ -29,7 +29,7 @@ stator_hub.le_thickness_match()
2929
stator_hub.flow_guidance2(10)
3030
3131
# Tip Geometry
32-
stator_tip = airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
32+
stator_tip = Airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
3333
stator_tip.le_thickness_add(0.04)
3434
ps_height = [0.0500,0.0200,-0.0100]
3535
ps_height_loc = exp_ratio(1.2,len(ps_height)+2,0.95)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pyturbo-aero"
3-
version = "1.0.14"
3+
version = "1.0.16"
44
description = "PyTurbo_Aero is a Turbomachinery blade design library that lets you create a full 3D blades and passages."
55
authors = ["Paht Juangphanich <[email protected]>"]
66
packages = [

pyturbo/aero/airfoil3D.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
class stack_type(enum.Enum):
21-
"""class defining the type of stacking for airfoil2D profiles
21+
"""class defining the type of stacking for Airfoil2D profiles
2222
2323
Args:
2424
enum (enum.Emum): inherits enum
@@ -33,7 +33,7 @@ class Airfoil3D():
3333
'''
3434
Properties
3535
'''
36-
profileArray: List[airfoil2D]
36+
profileArray: List[Airfoil2D]
3737
profileSpan: List[float]
3838
span:float
3939
IsSplineFitted: bool
@@ -121,12 +121,12 @@ class Airfoil3D():
121121

122122
"""Defines a 3D Airfoil to be used in a channel
123123
"""
124-
def __init__(self, profileArray: List[airfoil2D], profile_loc: List[float], height: float):
124+
def __init__(self, profileArray: List[Airfoil2D], profile_loc: List[float], height: float):
125125
"""Constructs a 3D Airfoil
126126
127127
Args:
128-
profileArray (List[airfoil2D]): array of airfoil2D profiles
129-
profile_loc (List[float]): location of the airfoil2D profiles
128+
profileArray (List[Airfoil2D]): array of Airfoil2D profiles
129+
profile_loc (List[float]): location of the Airfoil2D profiles
130130
height (float): height of the 3D blade
131131
"""
132132
self.profileArray = profileArray

pyturbo/aero/airfoil_wavy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
from ..helper import derivative_1, bezier,cosd,sind
66
import math
77

8-
class airfoil_wavy(airfoil3D):
8+
class airfoil_wavy(Airfoil3D):
99
"""Makes the surface of the airfoil: LE, TE, SS, PS wavy
1010
"""
1111
def __init__(self,profileArray,profile_loc,height):
12-
"""Initializes a wavy airfoil from an array of profiles, location and height, same as airfoil3D
12+
"""Initializes a wavy airfoil from an array of profiles, location and height, same as Airfoil3D
1313
1414
Args:
15-
profileArray ([airfoil2D]): Array of 2D airfoil profiles
15+
profileArray ([Airfoil2D]): Array of 2D airfoil profiles
1616
profile_loc ([List[float]]): Locations in terms of percent span where these 2D airfoils are located
1717
height ([float]): height of the airfoil
1818
"""

tests/aero_design_test.py

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
import sys, copy
33
sys.path.insert(0, "../../")
44
import numpy as np
5-
from pyturbo.aero import airfoil2D,airfoil3D,airfoil_wavy,stack_type, passage2D
5+
from pyturbo.aero import Airfoil2D,Airfoil3D,airfoil_wavy,stack_type, passage2D
66
from pyturbo.helper import *
77
import matplotlib.pyplot as plt
88
from math import pi
9+
import math
910

1011
class TestDesign(unittest.TestCase):
1112
def test_2D_stator(self):
12-
# stator_hub = airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
13+
# stator_hub = Airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
1314

1415
# stator_hub.le_thickness_add(0.08)
1516
# ps_height = [0.0500,0.0200,-0.0100]
@@ -32,7 +33,7 @@ def test_2D_stator(self):
3233
pass
3334

3435
def test_2D_rotor(self):
35-
# rotor_hub = airfoil2D(alpha1=40,alpha2=60,axial_chord=5.119,stagger=20)
36+
# rotor_hub = Airfoil2D(alpha1=40,alpha2=60,axial_chord=5.119,stagger=20)
3637

3738
# rotor_hub.le_thickness_add(0.08)
3839
# ps_height = [-0.0500,-0.0200,-0.0100]
@@ -50,7 +51,7 @@ def test_2D_rotor(self):
5051

5152
def test_3D_Stator(self):
5253
# Hub Geometry
53-
# stator_hub = airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
54+
# stator_hub = Airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
5455
# stator_hub.le_thickness_add(0.04)
5556
# ps_height = [0.0500,0.0200,-0.0100]
5657
# ps_height = [0.0500,0.0200,-0.0100]
@@ -64,7 +65,7 @@ def test_3D_Stator(self):
6465
# stator_hub.flow_guidance2(10)
6566

6667
# # Tip Geometry
67-
# stator_tip = airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
68+
# stator_tip = Airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
6869
# stator_tip.le_thickness_add(0.04)
6970
# ps_height = [0.0500,0.0200,-0.0100]
7071
# ps_height_loc = exp_ratio(1.2,len(ps_height)+2,0.95)
@@ -80,7 +81,7 @@ def test_3D_Stator(self):
8081
# plt.clf()
8182
# plt.close('all')
8283
# # Begin 3D design
83-
# stator3D = airfoil3D([stator_hub,stator_tip],[0,1],0.05)
84+
# stator3D = Airfoil3D([stator_hub,stator_tip],[0,1],0.05)
8485
# stator3D.stack(stack_type.centroid)
8586
# # stator3D.lean_add([0, 0.05, 1], [0,0.5,1])
8687
# stator3D.create_blade(100,80,20)
@@ -93,7 +94,7 @@ def test_stator3D_wavy_const_te(self):
9394
Wavy with constant trailing edge
9495
'''
9596
# # Hub Geometry
96-
# stator_hub = airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
97+
# stator_hub = Airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
9798
# stator_hub.le_thickness_add(0.04)
9899
# ps_height = [0.0500,0.0200,-0.0100]
99100
# stator_hub.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -107,7 +108,7 @@ def test_stator3D_wavy_const_te(self):
107108
# # stator_hub.plot2D()
108109

109110
# # Tip Geometry
110-
# stator_tip = airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
111+
# stator_tip = Airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
111112
# stator_tip.le_thickness_add(0.04)
112113
# ps_height = [0.0500,0.0200,-0.0100]
113114
# stator_tip.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -121,7 +122,7 @@ def test_stator3D_wavy_const_te(self):
121122

122123
# # Begin 3D design
123124
# span = 0.05
124-
# stator3D = airfoil3D([stator_hub,stator_tip],[0,1],0.05)
125+
# stator3D = Airfoil3D([stator_hub,stator_tip],[0,1],0.05)
125126
# stator3D.stack(stack_type.trailing_edge)
126127
# stator3D.lean_add([0, 0.05, 0], [0,0.5,1])
127128
# stator3D.create_blade(100,100,20)
@@ -155,7 +156,7 @@ def test_wavy(self):
155156
Wavy without constant trailing edge
156157
'''
157158
# # Hub Geometry
158-
# stator_hub = airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
159+
# stator_hub = Airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
159160
# stator_hub.le_thickness_add(0.04)
160161
# ps_height = [0.0500,0.0200,-0.0100]
161162
# stator_hub.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -169,7 +170,7 @@ def test_wavy(self):
169170
# # stator_hub.plot2D()
170171

171172
# # Tip Geometry
172-
# stator_tip = airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
173+
# stator_tip = Airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
173174
# stator_tip.le_thickness_add(0.04)
174175
# ps_height = [0.0500,0.0200,-0.0100]
175176
# stator_tip.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -183,7 +184,7 @@ def test_wavy(self):
183184

184185
# # Begin 3D design
185186
# span = 0.05
186-
# stator3D = airfoil3D([stator_hub,stator_tip],[0,1],0.05)
187+
# stator3D = Airfoil3D([stator_hub,stator_tip],[0,1],0.05)
187188
# stator3D.stack(stack_type.trailing_edge)
188189
# stator3D.lean_add([0, 0.05, 0], [0,0.5,1])
189190
# stator3D.create_blade(100,100,20)
@@ -216,7 +217,7 @@ def test_wavy_whisker(self):
216217
Wavy blade that maintains cross sectional area
217218
'''
218219
# Hub Geometry
219-
stator_hub = airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
220+
stator_hub = Airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
220221
stator_hub.le_thickness_add(0.04)
221222
ps_height = [0.0500,0.0200,-0.0100]
222223
stator_hub.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -230,7 +231,7 @@ def test_wavy_whisker(self):
230231
# stator_hub.plot2D()
231232

232233
# Tip Geometry
233-
stator_tip = airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
234+
stator_tip = Airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
234235
stator_tip.le_thickness_add(0.04)
235236
ps_height = [0.0500,0.0200,-0.0100]
236237
stator_tip.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -270,12 +271,12 @@ def test_wavy_whisker(self):
270271
pass
271272

272273
def test_import_geometry(self):
273-
# rotor = airfoil3D.import_geometry(folder='import_7%',axial_chord=124) # Set axial chord to 124 mm
274+
# rotor = Airfoil3D.import_geometry(folder='import_7%',axial_chord=124) # Set axial chord to 124 mm
274275
# rotor.plot3D_ly()
275276
pass
276277

277278
def test_imported_blade_shell(self):
278-
# rotor = airfoil3D.import_geometry(folder='import_7%',axial_chord=124,span=114,ss_ps_split=105)
279+
# rotor = Airfoil3D.import_geometry(folder='import_7%',axial_chord=124,span=114,ss_ps_split=105)
279280
# rotor.rotate(90)
280281
# # [ss_x_new,ss_y_new,ss_z,ps_x_new,ps_y_new,ps_z] = rotor.get_shell_2D(percent_span=0.5,shell_thickness=-4)
281282
# rotor.plot_shell_2D(percent_span=0.0,shell_thickness=-3)
@@ -286,7 +287,7 @@ def test_blade_shell(self):
286287
You can create 2D shell from a 3D Design
287288
'''
288289
# # Hub Geometry
289-
# stator_hub = airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
290+
# stator_hub = Airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58)
290291
# stator_hub.le_thickness_add(0.04)
291292
# ps_height = [0.0500,0.0200,-0.0100]
292293
# stator_hub.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -300,7 +301,7 @@ def test_blade_shell(self):
300301
# # stator_hub.plot2D()
301302

302303
# # Tip Geometry
303-
# stator_tip = airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
304+
# stator_tip = Airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
304305
# stator_tip.le_thickness_add(0.04)
305306
# ps_height = [0.0500,0.0200,-0.0100]
306307
# stator_tip.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -314,7 +315,7 @@ def test_blade_shell(self):
314315

315316
# # Begin 3D design
316317
# span = 0.05
317-
# stator3D = airfoil3D([stator_hub,stator_tip],[0,1],0.05)
318+
# stator3D = Airfoil3D([stator_hub,stator_tip],[0,1],0.05)
318319
# stator3D.stack(stack_type.trailing_edge)
319320
# stator3D.lean_add([0, 0.05, 0], [0,0.5,1])
320321
# stator3D.create_blade(100,100,20)
@@ -329,7 +330,7 @@ def test_channel_2D(self):
329330
'''
330331
# Stator Hub Geometry
331332
cax_stator = 0.038
332-
stator_hub = airfoil2D(alpha1=0,alpha2=72,axial_chord=cax_stator,stagger=58)
333+
stator_hub = Airfoil2D(alpha1=0,alpha2=72,axial_chord=cax_stator,stagger=58)
333334
stator_hub.le_thickness_add(0.04)
334335
ps_height = [0.0500,0.0200,-0.0100]
335336
stator_hub.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -343,7 +344,7 @@ def test_channel_2D(self):
343344
# stator_hub.plot2D()
344345

345346
# Stator Tip Geometry
346-
stator_tip = airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
347+
stator_tip = Airfoil2D(alpha1=5,alpha2=72,axial_chord=0.036,stagger=56)
347348
stator_tip.le_thickness_add(0.04)
348349
ps_height = [0.0500,0.0200,-0.0100]
349350
stator_tip.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -357,15 +358,15 @@ def test_channel_2D(self):
357358

358359
# Begin Stator 3D design
359360
stator_span = cax_stator
360-
stator3D = airfoil3D([stator_hub,stator_tip],[0,1],stator_span)
361+
stator3D = Airfoil3D([stator_hub,stator_tip],[0,1],stator_span)
361362
stator3D.stack(stack_type.trailing_edge)
362363
stator3D.lean_add([0, 0.05, 0], [0,0.5,1])
363364
stator3D.create_blade(100,100,20)
364365
# stator3D.plot3D()
365366

366367
# Rotor Hub Geometry
367368
cax_rotor_hub = stator_span
368-
rotor_hub = airfoil2D(alpha1=30,alpha2=72,axial_chord=cax_rotor_hub,stagger=40)
369+
rotor_hub = Airfoil2D(alpha1=30,alpha2=72,axial_chord=cax_rotor_hub,stagger=40)
369370
rotor_hub.le_thickness_add(0.04)
370371
ps_height = [0.0500,0.01,0.05]
371372
rotor_hub.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -379,7 +380,7 @@ def test_channel_2D(self):
379380
#rotor_hub.plot2D()
380381

381382
# Rotor Tip Geometry
382-
rotor_tip = airfoil2D(alpha1=30,alpha2=72,axial_chord=0.036,stagger=45)
383+
rotor_tip = Airfoil2D(alpha1=30,alpha2=72,axial_chord=0.036,stagger=45)
383384
rotor_tip.le_thickness_add(0.04)
384385
ps_height = [0.0500,0.01,0.05]
385386
rotor_tip.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)

tutorials/stl_tutorial/stl_geometry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
import sys
66
sys.path.insert(0,'../../')
77
import numpy as np
8-
from pyturbo.aero import airfoil2D
8+
from pyturbo.aero import Airfoil2D
99
from pyturbo.helper import exp_ratio
1010
from pyturbo.aero import airfoil3D, stack_type
1111
import matplotlib.pyplot as plt
1212

13-
stator2D = airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58) # This creates the camberline
13+
stator2D = Airfoil2D(alpha1=0,alpha2=72,axial_chord=0.038,stagger=58) # This creates the camberline
1414

1515
# Building Leading Edge
1616
stator2D.le_thickness_add(0.04)

0 commit comments

Comments
 (0)