-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
@whoburg and @pgkirsch, we were getting some funny density readings (0.3 kg/m^3 @ 15000 ft) from this model. I think it was because T_atm can be lower than than its supposed to be and rho wanted to be lower to lower the weight.
#----------------------------------------------------
# Atmosphere model
gamma = Variable(r'\gamma', 1.4, '-', 'Heat capacity ratio of air')
p_sl = Variable('p_{sl}', 101325, 'Pa', 'Pressure at sea level')
T_sl = Variable('T_{sl}', 288.15, 'K', 'Temperature at sea level')
L_atm = Variable('L_{atm}', 0.0065, 'K/m', 'Temperature lapse rate')
T_atm = VectorVariable(NSeg, 'T_{atm}', 'K', 'Air temperature')
a_atm = VectorVariable(NSeg, 'a_{atm}', 'm/s', 'Speed of sound at altitude')
R_spec = Variable('R_{spec}', 287.058, 'J/kg/K', 'Specific gas constant of air')
TH = (g/R_spec/L_atm).value.magnitude # dimensionless
constraints.extend([T_sl >= T_atm + L_atm*h, # Temp decreases w/ altitude
rho == p_sl*T_atm**(TH-1)/R_spec/(T_sl**TH)])
# http://en.wikipedia.org/wiki/Density_of_air#Altitude
Output
\rho : [ 0.326 0.361 0.334 0.435 ... ] [kg/m**3] air density
h : [ 5e+03 6.94e+03 5e+03 1.5e+04 ... ] [ft] Altitude
T_{atm} : [ 211 216 212 226 ... ] [K] Air temperature
Metadata
Metadata
Assignees
Labels
No labels