22import sys , copy
33sys .path .insert (0 , "../../" )
44import 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
66from pyturbo .helper import *
77import matplotlib .pyplot as plt
88from math import pi
9+ import math
910
1011class 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 )
0 commit comments