# All the quantities are expressed in Si units
area_ratio = 10.25; # exit to throat area ratio
p0 = 5; # reservoir pressure in atm
T0 = 333.3; # reservoir temperature
# from appendix A, for an area ratio of 10.25
Me = 3.95; # exit mach number
pe = 0.007*p0; # exit pressure
Te = 0.2427*T0; # exit temperature
print"Me =",Me
print"pe =",pe,"atm"
print"Te =",Te,"K"
# All the quantities are expressed in Si units
area_ratio = 2.; # exit to throat area ratio
p0 = 1.; # reservoir pressure in atm
T0 = 288.; # reservoir temperature
# (a)
# since M = 1 at the throat
Mt = 1.;
pt = 0.528*p0; # pressure at throat
Tt = 0.833*T0; # temperature at throat
# from appendix A for supersonic flow, for an area ratio of 2
Me = 2.2; # exit mach number
pe = 1./10.69*p0; # exit pressure
Te = 1./1.968*T0; # exit temperature
print"At throat: Mt =",Mt
print"\nAt throat: pt =",pt,"atm"
print"\nAt throat: Tt = ",Tt,"K"
print"\nAt throat: For supersonic exit:",Me
print"\nAt throat: pe =",pe,"atm"
print"\nAt throat: Te = ",Te,"K"
# (b)
# from appendix A for subonic flow, for an area ratio of 2
Me = 0.3; # exit mach number
pe = 1/1.064*p0; # exit pressure
Te = 1/1.018*T0; # exit temperature
print"\nFor subrsonic exit:",Me
print"\npe=",pe,"atm"
print"\nTe=",Te,"K"
# All the quantities are expressed in Si units
area_ratio = 2.; # exit to throat area ratio
p0 = 1.; # reservoir pressure in atm
T0 = 288.; # reservoir temperature
pe = 0.973; # exit pressure in atm
p_ratio = p0/pe; # ratio of reservoir to exit pressure
# from appendix A for subsonic flow, for an pressure ratio of 1.028
Me = 0.2; # exit mach number
area_ratio_exit_to_star = 2.964; # A_exit/A_star
# thus
area_ratio_throat_to_star = area_ratio_exit_to_star/area_ratio; # A_exit/A_star
# from appendix A for subsonic flow, for an area ratio of 1.482
Mt = 0.44; # throat mach number
print"Me =",Me
print"Mt =",Mt
# All the quantities are expressed in SI units
import math
p0 = 30.*101000.; # reservoir pressure
T0 = 3500.; # reservoir temperature
R = 520.; # specific gas constant
gam = 1.22; # ratio of specific heats
A_star = 0.4; # rocket nozzle throat area
pe = 5529.; # rocket nozzle exit pressure equal to ambient pressure at 20 km altitude
# (a)
# the density of air in the reservoir can be calculated as
rho0 = p0/R/T0;
# from eq.(8.46)
rho_star = rho0*(2/(gam+1))**(1/(gam-1));
# from eq.(8.44)
T_star = T0*2/(gam+1);
a_star = math.sqrt(gam*R*T_star);
u_star = a_star;
m_dot = rho_star*u_star*A_star;
# rearranging eq.(8.42)
Me = math.sqrt(2/(gam-1)*(((p0/pe)**((gam-1)/gam)) - 1));
Te = T0/(1+(gam-1)/2*Me*Me);
ae = math.sqrt(gam*R*Te);
ue = Me*ae;
# thus the thrust can be calculated as
T = m_dot*ue;
T_lb = T*0.2247;
# (b)
# rearranging eq.(10.32)
Ae = A_star/Me*((2/(gam+1)*(1+(gam-1)/2*Me*Me))**((gam+1)/(gam-1)/2));
print"(a)The thrust of the rocket is:T =" ,T/1e6, "N"
print"\n(b)The nozzle exit area is",T_lb
print"\nAe =",Ae, "m2"
# All the quantities are expressed in SI units
import math
p0 = 30.*101000.; # reservoir pressure
T0 = 3500.; # reservoir temperature
R = 520.; # specific gas constant
gam = 1.22; # ratio of specific heats
A_star = 0.4; # rocket nozzle throat area
# the mass flow rate using the closed form analytical expression
# from problem 10.5 can be given as
m_dot = p0*A_star*math.sqrt(gam/R/T0*((2/(gam+1))**((gam+1)/(gam-1))));
print"The mass flow rate is: m_dot =",m_dot, "kg/s"
# All the quantities are expressed in SI units
M = 2.; # Mach number
# for this value M, for a normal shock, from Appendix B
p0_ratio = 0.7209;
# thus
area_ratio = 1./p0_ratio;
print"The diffuser throat to nozzle throat area ratio is: =",area_ratio