2
2
import sys , copy
3
3
sys .path .insert (0 , "../../" )
4
4
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
6
6
from pyturbo .helper import *
7
7
import matplotlib .pyplot as plt
8
8
from math import pi
9
+ import math
9
10
10
11
class TestDesign (unittest .TestCase ):
11
12
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)
13
14
14
15
# stator_hub.le_thickness_add(0.08)
15
16
# ps_height = [0.0500,0.0200,-0.0100]
@@ -32,7 +33,7 @@ def test_2D_stator(self):
32
33
pass
33
34
34
35
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)
36
37
37
38
# rotor_hub.le_thickness_add(0.08)
38
39
# ps_height = [-0.0500,-0.0200,-0.0100]
@@ -50,7 +51,7 @@ def test_2D_rotor(self):
50
51
51
52
def test_3D_Stator (self ):
52
53
# 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)
54
55
# stator_hub.le_thickness_add(0.04)
55
56
# ps_height = [0.0500,0.0200,-0.0100]
56
57
# ps_height = [0.0500,0.0200,-0.0100]
@@ -64,7 +65,7 @@ def test_3D_Stator(self):
64
65
# stator_hub.flow_guidance2(10)
65
66
66
67
# # 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)
68
69
# stator_tip.le_thickness_add(0.04)
69
70
# ps_height = [0.0500,0.0200,-0.0100]
70
71
# ps_height_loc = exp_ratio(1.2,len(ps_height)+2,0.95)
@@ -80,7 +81,7 @@ def test_3D_Stator(self):
80
81
# plt.clf()
81
82
# plt.close('all')
82
83
# # 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)
84
85
# stator3D.stack(stack_type.centroid)
85
86
# # stator3D.lean_add([0, 0.05, 1], [0,0.5,1])
86
87
# stator3D.create_blade(100,80,20)
@@ -93,7 +94,7 @@ def test_stator3D_wavy_const_te(self):
93
94
Wavy with constant trailing edge
94
95
'''
95
96
# # 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)
97
98
# stator_hub.le_thickness_add(0.04)
98
99
# ps_height = [0.0500,0.0200,-0.0100]
99
100
# stator_hub.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -107,7 +108,7 @@ def test_stator3D_wavy_const_te(self):
107
108
# # stator_hub.plot2D()
108
109
109
110
# # 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)
111
112
# stator_tip.le_thickness_add(0.04)
112
113
# ps_height = [0.0500,0.0200,-0.0100]
113
114
# stator_tip.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -121,7 +122,7 @@ def test_stator3D_wavy_const_te(self):
121
122
122
123
# # Begin 3D design
123
124
# 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)
125
126
# stator3D.stack(stack_type.trailing_edge)
126
127
# stator3D.lean_add([0, 0.05, 0], [0,0.5,1])
127
128
# stator3D.create_blade(100,100,20)
@@ -155,7 +156,7 @@ def test_wavy(self):
155
156
Wavy without constant trailing edge
156
157
'''
157
158
# # 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)
159
160
# stator_hub.le_thickness_add(0.04)
160
161
# ps_height = [0.0500,0.0200,-0.0100]
161
162
# stator_hub.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -169,7 +170,7 @@ def test_wavy(self):
169
170
# # stator_hub.plot2D()
170
171
171
172
# # 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)
173
174
# stator_tip.le_thickness_add(0.04)
174
175
# ps_height = [0.0500,0.0200,-0.0100]
175
176
# stator_tip.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -183,7 +184,7 @@ def test_wavy(self):
183
184
184
185
# # Begin 3D design
185
186
# 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)
187
188
# stator3D.stack(stack_type.trailing_edge)
188
189
# stator3D.lean_add([0, 0.05, 0], [0,0.5,1])
189
190
# stator3D.create_blade(100,100,20)
@@ -216,7 +217,7 @@ def test_wavy_whisker(self):
216
217
Wavy blade that maintains cross sectional area
217
218
'''
218
219
# 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 )
220
221
stator_hub .le_thickness_add (0.04 )
221
222
ps_height = [0.0500 ,0.0200 ,- 0.0100 ]
222
223
stator_hub .ps_thickness_add (thicknessArray = ps_height ,expansion_ratio = 1.2 )
@@ -230,7 +231,7 @@ def test_wavy_whisker(self):
230
231
# stator_hub.plot2D()
231
232
232
233
# 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 )
234
235
stator_tip .le_thickness_add (0.04 )
235
236
ps_height = [0.0500 ,0.0200 ,- 0.0100 ]
236
237
stator_tip .ps_thickness_add (thicknessArray = ps_height ,expansion_ratio = 1.2 )
@@ -270,12 +271,12 @@ def test_wavy_whisker(self):
270
271
pass
271
272
272
273
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
274
275
# rotor.plot3D_ly()
275
276
pass
276
277
277
278
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)
279
280
# rotor.rotate(90)
280
281
# # [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)
281
282
# rotor.plot_shell_2D(percent_span=0.0,shell_thickness=-3)
@@ -286,7 +287,7 @@ def test_blade_shell(self):
286
287
You can create 2D shell from a 3D Design
287
288
'''
288
289
# # 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)
290
291
# stator_hub.le_thickness_add(0.04)
291
292
# ps_height = [0.0500,0.0200,-0.0100]
292
293
# stator_hub.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -300,7 +301,7 @@ def test_blade_shell(self):
300
301
# # stator_hub.plot2D()
301
302
302
303
# # 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)
304
305
# stator_tip.le_thickness_add(0.04)
305
306
# ps_height = [0.0500,0.0200,-0.0100]
306
307
# stator_tip.ps_thickness_add(thicknessArray=ps_height,expansion_ratio=1.2)
@@ -314,7 +315,7 @@ def test_blade_shell(self):
314
315
315
316
# # Begin 3D design
316
317
# 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)
318
319
# stator3D.stack(stack_type.trailing_edge)
319
320
# stator3D.lean_add([0, 0.05, 0], [0,0.5,1])
320
321
# stator3D.create_blade(100,100,20)
@@ -329,7 +330,7 @@ def test_channel_2D(self):
329
330
'''
330
331
# Stator Hub Geometry
331
332
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 )
333
334
stator_hub .le_thickness_add (0.04 )
334
335
ps_height = [0.0500 ,0.0200 ,- 0.0100 ]
335
336
stator_hub .ps_thickness_add (thicknessArray = ps_height ,expansion_ratio = 1.2 )
@@ -343,7 +344,7 @@ def test_channel_2D(self):
343
344
# stator_hub.plot2D()
344
345
345
346
# 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 )
347
348
stator_tip .le_thickness_add (0.04 )
348
349
ps_height = [0.0500 ,0.0200 ,- 0.0100 ]
349
350
stator_tip .ps_thickness_add (thicknessArray = ps_height ,expansion_ratio = 1.2 )
@@ -357,15 +358,15 @@ def test_channel_2D(self):
357
358
358
359
# Begin Stator 3D design
359
360
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 )
361
362
stator3D .stack (stack_type .trailing_edge )
362
363
stator3D .lean_add ([0 , 0.05 , 0 ], [0 ,0.5 ,1 ])
363
364
stator3D .create_blade (100 ,100 ,20 )
364
365
# stator3D.plot3D()
365
366
366
367
# Rotor Hub Geometry
367
368
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 )
369
370
rotor_hub .le_thickness_add (0.04 )
370
371
ps_height = [0.0500 ,0.01 ,0.05 ]
371
372
rotor_hub .ps_thickness_add (thicknessArray = ps_height ,expansion_ratio = 1.2 )
@@ -379,7 +380,7 @@ def test_channel_2D(self):
379
380
#rotor_hub.plot2D()
380
381
381
382
# 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 )
383
384
rotor_tip .le_thickness_add (0.04 )
384
385
ps_height = [0.0500 ,0.01 ,0.05 ]
385
386
rotor_tip .ps_thickness_add (thicknessArray = ps_height ,expansion_ratio = 1.2 )
0 commit comments