turbo-design 1.0.9__py3-none-any.whl → 1.0.10__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.
Potentially problematic release.
This version of turbo-design might be problematic. Click here for more details.
- {turbo_design-1.0.9.dist-info → turbo_design-1.0.10.dist-info}/METADATA +1 -1
- {turbo_design-1.0.9.dist-info → turbo_design-1.0.10.dist-info}/RECORD +8 -8
- turbodesign/passage.py +1 -1
- turbodesign/solve_radeq.py +2 -1
- turbodesign/spool.py +19 -1
- turbodesign/td_math.py +3 -1
- turbodesign/turbinespool.py +22 -7
- {turbo_design-1.0.9.dist-info → turbo_design-1.0.10.dist-info}/WHEEL +0 -0
|
@@ -20,14 +20,14 @@ turbodesign/loss/turbine/kackerokapuu.py,sha256=hUmZdyA1hAhN3_xbwBhka2dyk0Aq9rqq
|
|
|
20
20
|
turbodesign/loss/turbine/traupel.py,sha256=aZxFE9JDcCfi1gy-fqS1SxjjlhuDG-H-g3LPurty1M0,4164
|
|
21
21
|
turbodesign/lossinterp.py,sha256=B2KEobp-nD9jwD6UINgBmTlH9kKyWg3UNvXxqfUsr-k,6198
|
|
22
22
|
turbodesign/outlet.py,sha256=SwTwoL6XnWlsrE5A6wLxu3qXkydDDUsdKKeBbJm4mrQ,2069
|
|
23
|
-
turbodesign/passage.py,sha256=
|
|
23
|
+
turbodesign/passage.py,sha256=9cRSCZIS4LqlIcO8mOeePN42hmcc4g8tFDZ3F86WM7E,7594
|
|
24
24
|
turbodesign/radeq.py,sha256=4unpFad6hvgaYwYLBNI8o9bszyvoNiizYjMqRX0Mjcc,10012
|
|
25
25
|
turbodesign/rotor.py,sha256=tHl9o5H4aQ6Etd4gqa8Ime1UK7k0de4GLt5Yb1sJdGs,1376
|
|
26
|
-
turbodesign/solve_radeq.py,sha256=
|
|
27
|
-
turbodesign/spool.py,sha256
|
|
26
|
+
turbodesign/solve_radeq.py,sha256=2VGzFSVkyN0rTPFHaCQiD3v166cdEs39x7x7RuzLgmw,1886
|
|
27
|
+
turbodesign/spool.py,sha256=FImXUwB4bJSAFroae-Y0fL5T7hBCiHg17Uo2zRvcFnA,13864
|
|
28
28
|
turbodesign/stage.py,sha256=UP45sDKDLsAkO_WfDWJ6kqXU7cYKh_4QO01QZnSN1oQ,166
|
|
29
|
-
turbodesign/td_math.py,sha256=
|
|
30
|
-
turbodesign/turbinespool.py,sha256=
|
|
31
|
-
turbo_design-1.0.
|
|
32
|
-
turbo_design-1.0.
|
|
33
|
-
turbo_design-1.0.
|
|
29
|
+
turbodesign/td_math.py,sha256=28cGzmTMs2evC0vMEp0oN6UmSJDHsKfXw51XJSMxmo8,17370
|
|
30
|
+
turbodesign/turbinespool.py,sha256=s9cZpK9245pjUYI5hOo81SsO8UqG-TVUJlSN7SQu7yw,25877
|
|
31
|
+
turbo_design-1.0.10.dist-info/METADATA,sha256=jQ5YdRxxq3NcYV-B7beGfmgTGTsGhMzE8PC8Y3W23QU,684
|
|
32
|
+
turbo_design-1.0.10.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
33
|
+
turbo_design-1.0.10.dist-info/RECORD,,
|
turbodesign/passage.py
CHANGED
turbodesign/solve_radeq.py
CHANGED
|
@@ -34,4 +34,5 @@ def adjust_streamlines(blade_rows:List[BladeRow],passage:Passage):
|
|
|
34
34
|
phi, rm, r = passage.streamline_curvature(x_streamline,r_streamline)
|
|
35
35
|
row.phi[i] = float(interp1d(t_streamline,phi)(row.axial_location))
|
|
36
36
|
row.rm[i] = float(interp1d(t_streamline,rm)(row.axial_location))
|
|
37
|
-
row.r[i] = float(interp1d(t_streamline,r)(row.axial_location))
|
|
37
|
+
row.r[i] = float(interp1d(t_streamline,r)(row.axial_location))
|
|
38
|
+
row.x[i] = float(interp1d(t_streamline,x_streamline)(row.axial_location))
|
turbodesign/spool.py
CHANGED
|
@@ -28,6 +28,7 @@ class Spool:
|
|
|
28
28
|
_fluid: Solution = Solution("air.yaml")
|
|
29
29
|
|
|
30
30
|
massflow_constraint: MassflowConstraint
|
|
31
|
+
_adjust_streamlines:bool = True
|
|
31
32
|
|
|
32
33
|
# Inlet Conditions
|
|
33
34
|
def __init__(self,passage:Passage,
|
|
@@ -87,6 +88,23 @@ class Spool:
|
|
|
87
88
|
"""
|
|
88
89
|
self._fluid = newFluid
|
|
89
90
|
|
|
91
|
+
@property
|
|
92
|
+
def adjust_streamlines(self) -> bool:
|
|
93
|
+
"""Variable that determines whether or not to try and adjust the streamlines to balance massflow
|
|
94
|
+
This can be a source of failure. Setting it to false may help with debugging.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
bool: True = streamlines are adjusted after calculation; False = No changes in streamlines
|
|
98
|
+
"""
|
|
99
|
+
return self._adjust_streamlines
|
|
100
|
+
|
|
101
|
+
@adjust_streamlines.setter
|
|
102
|
+
def adjust_streamlines(self,val:bool):
|
|
103
|
+
"""Variable that determines whether or not to try and adjust the streamlines to balance massflow
|
|
104
|
+
This can be a source of failure. Setting it to false may help with debugging.
|
|
105
|
+
"""
|
|
106
|
+
self._adjust_streamlines = val
|
|
107
|
+
|
|
90
108
|
|
|
91
109
|
def set_blade_row_rpm(self,index:int,rpm:float):
|
|
92
110
|
"""sets the rpm of a particular blade row"""
|
|
@@ -229,7 +247,7 @@ class Spool:
|
|
|
229
247
|
x_start = 0
|
|
230
248
|
y_max = 0; y_min = 0
|
|
231
249
|
plt.figure(num=1,clear=True)
|
|
232
|
-
for i in range(1,len(self.blade_rows)):
|
|
250
|
+
for i in range(1,len(self.blade_rows)-1): # Don't plot inlet or outlet
|
|
233
251
|
row = self.blade_rows[i]
|
|
234
252
|
x_end = x_start + row.Vx.mean()
|
|
235
253
|
dx = x_end - x_start
|
turbodesign/td_math.py
CHANGED
|
@@ -360,8 +360,10 @@ def inlet_calc(row:BladeRow):
|
|
|
360
360
|
row (BladeRow): _description_
|
|
361
361
|
"""
|
|
362
362
|
area = row.Vm.copy()*0
|
|
363
|
+
# Estimate the density
|
|
363
364
|
row.T = row.T0
|
|
364
365
|
row.P = row.P0
|
|
366
|
+
row.rho = row.P/(row.T*row.R)
|
|
365
367
|
total_area = 0
|
|
366
368
|
for _ in range(5): # Lets converge the Mach and Total and Static pressures
|
|
367
369
|
for j in range(1,len(row.percent_hub_shroud)):
|
|
@@ -381,7 +383,7 @@ def inlet_calc(row:BladeRow):
|
|
|
381
383
|
row.Vr = row.Vm*np.sin(row.phi)
|
|
382
384
|
row.Vt = row.Vm*np.cos(row.phi)*np.tan(row.alpha2)
|
|
383
385
|
row.V = np.sqrt(row.Vt**2+row.Vm**2)
|
|
384
|
-
|
|
386
|
+
# Fine tune the Temperature and Pressure and density
|
|
385
387
|
row.M = row.V/np.sqrt(row.gamma*row.R*row.T)
|
|
386
388
|
row.T = row.T0 * 1/(1+(row.gamma-1)/2*row.M**2)
|
|
387
389
|
row.P = row.P0 * (row.T/row.T0)**(row.gamma/(row.gamma-1))
|
turbodesign/turbinespool.py
CHANGED
|
@@ -239,7 +239,7 @@ class TurbineSpool(Spool):
|
|
|
239
239
|
else:
|
|
240
240
|
for i in range(1,len(blade_rows)-1):
|
|
241
241
|
for j in range(self.num_streamlines):
|
|
242
|
-
blade_rows[i].P[j] = P[
|
|
242
|
+
blade_rows[i].P[j] = P[j]*x0[(i-1)*self.num_streamlines+j] # x0 size = num_streamlines -1
|
|
243
243
|
|
|
244
244
|
calculate_massflows(blade_rows,True)
|
|
245
245
|
print(x0)
|
|
@@ -247,7 +247,7 @@ class TurbineSpool(Spool):
|
|
|
247
247
|
except:
|
|
248
248
|
for i in range(1,len(blade_rows)-1):
|
|
249
249
|
for j in range(self.num_streamlines):
|
|
250
|
-
blade_rows[i].P[j] = P[
|
|
250
|
+
blade_rows[i].P[j] = P[j]
|
|
251
251
|
calculate_massflows(blade_rows,True)
|
|
252
252
|
return 10
|
|
253
253
|
# Break apart the rows to stages
|
|
@@ -271,11 +271,15 @@ class TurbineSpool(Spool):
|
|
|
271
271
|
self.blade_rows[0].massflow = np.linspace(0,1,self.num_streamlines)*self.blade_rows[1].total_massflow_no_coolant
|
|
272
272
|
inlet_calc(self.blade_rows[0]) # adjust the inlet to match massflow
|
|
273
273
|
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
if self.adjust_streamlines:
|
|
275
|
+
for _ in range(2):
|
|
276
|
+
adjust_streamlines(self.blade_rows[:-1],self.passage)
|
|
277
|
+
self.blade_rows[-1].transfer_quantities(self.blade_rows[-2])
|
|
278
|
+
self.blade_rows[-1].P = self.blade_rows[-1].get_static_pressure(self.blade_rows[-1].percent_hub_shroud)
|
|
279
|
+
balance_massflows(x,self.blade_rows[:-1],self.blade_rows[0].P0,self.blade_rows[-1].P)
|
|
280
|
+
else:
|
|
276
281
|
self.blade_rows[-1].transfer_quantities(self.blade_rows[-2])
|
|
277
282
|
self.blade_rows[-1].P = self.blade_rows[-1].get_static_pressure(self.blade_rows[-1].percent_hub_shroud)
|
|
278
|
-
balance_massflows(x,self.blade_rows[:-1],self.blade_rows[0].P0,self.blade_rows[-1].P)
|
|
279
283
|
err = calculate_error(self.blade_rows[:-1])
|
|
280
284
|
print(f"Massflow convergenced error:{err}")
|
|
281
285
|
|
|
@@ -340,7 +344,13 @@ class TurbineSpool(Spool):
|
|
|
340
344
|
t,x,r = self.passage.get_streamline(p)
|
|
341
345
|
x_streamline[j,indx] = float(interp1d(t,x)(row.axial_location))
|
|
342
346
|
r_streamline[j,indx] = float(interp1d(t,r)(row.axial_location))
|
|
343
|
-
|
|
347
|
+
|
|
348
|
+
Pratio_Total_Total = np.mean(self.blade_rows[0].P0 / self.blade_rows[-2].P0)
|
|
349
|
+
Pratio_Total_Static = np.mean(self.blade_rows[0].P0 / self.blade_rows[-2].P)
|
|
350
|
+
FlowFunction = np.mean(massflow)*np.sqrt(self.blade_rows[0].T0)*self.blade_rows[0].P0/1000 # kg sqrt(K)/(sec kPa)
|
|
351
|
+
CorrectedSpeed = self.rpm * np.pi/30 / np.sqrt(self.blade_rows[0].T0.mean()) # rad/s * 1/sqrt(K)
|
|
352
|
+
EnergyFunction = (self.blade_rows[0].T0 - self.blade_rows[-2].T0) * 0.5* (self.blade_rows[0].Cp + self.blade_rows[-2].Cp) / self.blade_rows[0].T0 # J/(KgK)
|
|
353
|
+
EnergyFunction = np.mean(EnergyFunction)
|
|
344
354
|
data = {
|
|
345
355
|
"blade_rows": blade_rows,
|
|
346
356
|
"massflow":np.mean(massflow),
|
|
@@ -355,7 +365,12 @@ class TurbineSpool(Spool):
|
|
|
355
365
|
"total-total_efficiency":total_total_efficiency,
|
|
356
366
|
"total-static_efficiency":total_static_efficiency,
|
|
357
367
|
"stage_loading":stage_loading,
|
|
358
|
-
"degree_of_reaction":degree_of_reaction
|
|
368
|
+
"degree_of_reaction":degree_of_reaction,
|
|
369
|
+
"Pratio_Total_Total":Pratio_Total_Total,
|
|
370
|
+
"Pratio_Total_Static":Pratio_Total_Static,
|
|
371
|
+
"FlowFunction":FlowFunction,
|
|
372
|
+
"CorrectedSpeed":CorrectedSpeed,
|
|
373
|
+
"EnergyFunction":EnergyFunction
|
|
359
374
|
}
|
|
360
375
|
# Dump all the Python objects into a single JSON file.
|
|
361
376
|
class NumpyEncoder(json.JSONEncoder):
|
|
File without changes
|