Skip to content

Commit

Permalink
cleaned up code, ran all SSME.py altitudes
Browse files Browse the repository at this point in the history
  • Loading branch information
chinahg committed Oct 27, 2022
1 parent 7b5a929 commit 46059bc
Show file tree
Hide file tree
Showing 41 changed files with 147 additions and 199 deletions.
7 changes: 2 additions & 5 deletions SSME.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@

if h >= 25000:
T_atm = (-131.21 + 0.00299*h) + 273.14 #[K]
P_atm = (2.488 * ((T_atm)/ 216.6)**-11.388)*1000 #[Pa]
P_atm = (2.488 * ((T_atm)/ 216.6)**(-11.388))*1000 #[Pa]
ambient_T = T_atm
ambient_P = P_atm

elif 11000 < h < 25000:
T_atm = -56.46 + 273.14 #[K]
P_atm = (22.65*10**(1.73-0.000157*h))*1000
P_atm = (22.65*math.exp(1.73-0.000157*h))*1000
ambient_T = T_atm
ambient_P = P_atm

Expand All @@ -123,7 +123,6 @@
F = 2188080 #[N] thrust at 104.5% RPL
P_e = 13798.5 #[Pa] exit pressure of nozzle
u_e = (F-((P_e-ambient_P)*A_exit))/(mdot_f+mdot_ox)
print(u_e)

#Calculate composition of O2, and N2
X_N2 = 0.78084
Expand Down Expand Up @@ -191,7 +190,6 @@
mdot_Noz = mdot_f+mdot_ox

L_Noz = (math.sqrt(1/3.1415 *math.sqrt(A_throat*Area_ratio)) - (1/3.1415 *math.sqrt(A_throat)))**2 #[m]
print(L_Noz)
#Call nozzle function
Noz_states = nozzle(T_Noz1, P_Noz1, comp_Noz1, A_throat, A_exit, L_Noz, mdot_ox, mdot_f)
n = len(Noz_states.T)-1
Expand Down Expand Up @@ -238,7 +236,6 @@

u = results_u[1] #velocity at exit of nozzle (m/s)
gamma = 1.1
print(u)
P1 = P_e #TODO Noz_states.P[n] PLACEHOLDER, need design exit pressure or design alt
T1 = Noz_states.T[n]
M1 = u/math.sqrt(gamma*P1/Noz_states.density[n])
Expand Down
4 changes: 0 additions & 4 deletions combustion_chamber.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os

sys.path.insert(0,"/home/chinahg/GCresearch/cantera/build/python")
#print(sys.path)

import cantera as ct
ct.add_directory('/user/chinahg')
Expand All @@ -23,7 +22,6 @@ def combustion_chamber(P_CC0, V_CC, mdot_ox, mdot_f):
gasExhaust = ct.Solution('h2o2.yaml')
gasExhaust.TPY = 300, P_CC0, 'O2: 6, H2:1'
gasExhaust.equilibrate('HP')
#print(gasExhaust.report())

gasFuel = ct.Solution('h2o2.yaml') #ct.Hydrogen()
gasFuel.TPX = 20.15, 227527, 'H2:1' #https://science.ksc.nasa.gov/shuttle/technology/sts-newsref/et.html#:~:text=LIQUID%20HYDROGEN%20TANK,-The%20liquid%20hydrogen&text=Its%20operating%20pressure%20range%20is,to%20the%20left%20aft%20umbilical.
Expand Down Expand Up @@ -70,6 +68,4 @@ def combustion_chamber(P_CC0, V_CC, mdot_ox, mdot_f):

A = 0.159 #CC cross sectional area

#print("\nFinal CC Composition: ", gasExhaust.report(),"\n", u)

return(state)
5 changes: 0 additions & 5 deletions nozzle.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ def nozzle(T_Noz1, P_Noz1, comp_Noz1, A_throat, A_exit, L_Noz, mdot_ox, mdot_f):
P_throat = P_t*(2*gamma-1)**(-gamma/(gamma-1))
T_throat = T_t*(1/(2*gamma-1))

print("\nMACH NUMBER AT NOZZLE INLET: ", M_CC)
#print("\nTHROAT TEMPERATURE: ", T_throat)
#print("\nTHROAT PRESSURE: ", P_throat)

#Call diverging section, return final gas state (end of nozzle)
states_final = nozzle_div(T_throat, P_throat, comp_Noz1, A_throat, A_exit, L_Noz, mdot_ox,mdot_f)
return(states_final)
Expand Down Expand Up @@ -155,6 +151,5 @@ def nozzle_div(T_Noz1, P_Noz1, comp_Noz1, A_throat, A_exit, L_Noz, mdot_ox, mdot
states.append(gas.state, x=solver.t)

i = i+1
#print(i, solver.t, gas.report())

return(states)
Binary file modified plot_data.h5
Binary file not shown.
8 changes: 4 additions & 4 deletions rockettests/16000m/16000_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 3741.6934729887184
- 10362.151115706554
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1682.1653588139836
- 1845.3774305531829
- Shocks Exit Pressure [Pa]:
- 3741.6934729887184
- 10362.151115706554
- Shocks Exit Velocity [m/s]:
- 4609.12531520912
- 4625.755965383679
- H2:
- 0.23930995583841458
- H:
Expand Down
8 changes: 4 additions & 4 deletions rockettests/16250m/16250_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 3418.3632146588047
- 9963.315043672133
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1668.4012378582238
- 1838.804521998011
- Shocks Exit Pressure [Pa]:
- 3418.3632146588056
- 9963.315043672132
- Shocks Exit Velocity [m/s]:
- 4608.313106641779
- 4624.754085521447
- H2:
- 0.23930995583841458
- H:
Expand Down
8 changes: 4 additions & 4 deletions rockettests/16500m/16500_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 3122.972833474462
- 9579.830051792753
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1654.7497402094962
- 1832.2550249824837
- Shocks Exit Pressure [Pa]:
- 3122.9728334744623
- 9579.830051792753
- Shocks Exit Velocity [m/s]:
- 4607.571083301473
- 4623.790767713024
- H2:
- 0.23930995583841458
- H:
Expand Down
8 changes: 4 additions & 4 deletions rockettests/16750m/16750_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 2853.1079660570754
- 9211.10528162192
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1641.209944340787
- 1825.7288561188311
- Shocks Exit Pressure [Pa]:
- 2853.107966057075
- 9211.10528162192
- Shocks Exit Velocity [m/s]:
- 4606.893180285303
- 4622.864527716587
- H2:
- 0.23930995583841458
- H:
Expand Down
8 changes: 4 additions & 4 deletions rockettests/17000m/17000_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 2606.5628809591462
- 8856.572616676596
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1627.7809362653682
- 1819.2259323162943
- Shocks Exit Pressure [Pa]:
- 2606.562880959146
- 8856.572616676598
- Shocks Exit Velocity [m/s]:
- 4606.273856775692
- 4621.973938418331
- H2:
- 0.23930995583841458
- H:
Expand Down
8 changes: 4 additions & 4 deletions rockettests/17250m/17250_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 2381.322450192244
- 8515.685807105872
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1614.4618094751027
- 1812.7461707800717
- Shocks Exit Pressure [Pa]:
- 2381.3224501922446
- 8515.685807105872
- Shocks Exit Velocity [m/s]:
- 4605.708050752694
- 4621.117627633633
- H2:
- 0.23930995583841458
- H:
Expand Down
8 changes: 4 additions & 4 deletions rockettests/17500m/17500_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 2175.5456786459445
- 8187.9196280508995
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1601.2516648792484
- 1806.2894890102593
- Shocks Exit Pressure [Pa]:
- 2175.5456786459445
- 8187.9196280508995
- Shocks Exit Velocity [m/s]:
- 4605.191137619748
- 4620.294275992843
- H2:
- 0.23930995583841458
- H:
Expand Down
8 changes: 4 additions & 4 deletions rockettests/17750m/17750_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 1987.5506567760058
- 7872.769070399271
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1588.1496107437683
- 1799.8558048008053
- Shocks Exit Pressure [Pa]:
- 1987.5506567760056
- 7872.769070399273
- Shocks Exit Velocity [m/s]:
- 4604.718892404689
- 4619.502614908449
- H2:
- 0.23930995583841458
- H:
Expand Down
8 changes: 4 additions & 4 deletions rockettests/18000m/18000_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 1815.8008135730927
- 7569.748562687052
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1575.154762631136
- 1793.4450362384607
- Shocks Exit Pressure [Pa]:
- 1815.8008135730931
- 7569.748562687054
- Shocks Exit Velocity [m/s]:
- 4604.287455227081
- 4618.74142462049
- H2:
- 0.23930995583841458
- H:
Expand Down
8 changes: 4 additions & 4 deletions rockettests/18250m/18250_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 1658.8923574511375
- 7278.391222949545
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1562.2662433406292
- 1787.0571017017364
- Shocks Exit Pressure [Pa]:
- 1658.8923574511375
- 7278.391222949545
- Shocks Exit Velocity [m/s]:
- 4603.893299749618
- 4618.009532317199
- H2:
- 0.23930995583841458
- H:
Expand Down
8 changes: 4 additions & 4 deletions rockettests/18500m/18500_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 1515.5428024038706
- 6998.248139368094
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1549.4831828491194
- 1780.6919198598653
- Shocks Exit Pressure [Pa]:
- 1515.5428024038706
- 6998.248139368094
- Shocks Exit Velocity [m/s]:
- 4603.533204355715
- 4617.305810327982
- H2:
- 0.23930995583841458
- H:
Expand Down
8 changes: 4 additions & 4 deletions rockettests/18750m/18750_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 1384.5804856484378
- 6728.88767860459
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1536.8047182523408
- 1774.3494096717657
- Shocks Exit Pressure [Pa]:
- 1384.5804856484378
- 6728.88767860459
- Shocks Exit Velocity [m/s]:
- 4603.204225817742
- 4616.629174385942
- H2:
- 0.23930995583841458
- H:
Expand Down
8 changes: 4 additions & 4 deletions rockettests/19000m/19000_altitude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Oxygen Mole Fraction:
- 0.2095
Pressure [Pa]:
- 1264.9349910789215
- 6469.894820757962
Temperature [K]:
- 216.67999999999998
- Combustion Chamber Mechanism:
Expand Down Expand Up @@ -55,11 +55,11 @@
- Shocks Mechanism:
- NONE
- Shocks Exit Temperature [K]:
- 1524.229993706639
- 1768.0294903850106
- Shocks Exit Pressure [Pa]:
- 1264.9349910789213
- 6469.894820757963
- Shocks Exit Velocity [m/s]:
- 4602.903675240647
- 4615.978581957292
- H2:
- 0.23930995583841458
- H:
Expand Down
Loading

0 comments on commit 46059bc

Please sign in to comment.