cape.atm: Atmosphere Models

This is a module that provides interfaces for atmosphere models, which can be useful for estimating freestream conditions at a given altitude. Conversely, it can be used to find a representative altitude for a given set of freestream conditions.

At present it only contains the 1976 U.S. Standard Atmosphere:

For detailed trajectory modeling, a more general atmosphere model is suggested. Furthermore, this model is only considered to be valid up to 85 km of altitude even though cape.atm.atm76() will return an atmospheric state for higher altitudes.

class cape.atm.State(p=None, rho=None, T=None, **kw)

Atmospheric state

Call:
>>> S = atm.State(p=None, rho=None, T=None, V=0, gamma=1.4)
Inputs:
p: float

Static pressure [Pa] (required)

rho: float

Static density [kg/m^3] (required)

T: float

Static temperature [K] (required)

V: float

Velocity [m/s]

gamma: float

Ratio of specific heats

Outputs:
S: atm.State

Atmospheric state

S.p: float

Static pressure [Pa]

S.rho: float

Static density [kg/m^3]

S.T: float

Static temperature [K]

S.R: float

Normalized gas constant [J/kg-K]

S.V: float

Velocity [m/s]

S.M: float

Mach number

gamma: float

Ratio of specific heats

a: float

Sound speed [m/s]

Versions:
  • 2015-07-05 @ddalle: Version 1.0

ConvertToFPS()

Convert state quantities to foot-pound-second units

Call:
>>> S.ConvertToFPS()
Outputs:
S.p: float

Static pressure [lbf/ft^2]

S.rho: float

Static density [slug/ft^3]

S.T: float

Static temperature [R]

S.M: float

Mach number

S.a: float

Sound speed [ft/s]

Versions:
  • 2016-04-22 @ddalle: First version

cape.atm.SutherlandMKS(T, mu0=None, T0=None, C=None)

Calculate viscosity using Sutherland’s law using SI units

This returns

\[\mu = \mu_0\frac{T_0+C}{T+C}\left(\frac{T}{T_0}\right)^{3/2}\]
Call:
>>> mu = SutherlandMKS(T)
>>> mu = SutherlandMKS(T, mu0=None, T0=None, C=None)
Inputs:
T: float

Static temperature in degrees Kelvins

mu0: {1.716e-5} | float

Reference viscosity [kg/m*s]

T0: {273.15} | float

Reference temperature [K]

C: {110.33333} | float

Reference temperature [K]

Outputs:
mu: float

Dynamic viscosity [kg/m*s]

Versions:
  • 2016-03-23 @ddalle: Version 1.0

cape.atm.atm76(h)

Return 1976 standard atmosphere parameters

Call:
>>> S = atm76(h)
Inputs:
h: float

Geometric altitude [km]

Outputs:
S: cape.atm.State

Atmospheric state

S.T: float

Temperature [K]

S.rho: float

Static density [kg/m^3]

S.p: float

Static pressure [N/m^2]

S.M: float

Mach number

Versions:
  • 2015-07-04 @ddalle: Version 1.0

cape.atm.get_T(h)

Get temperature from specific enthalpy

Call:
>>> T = get_T(h)
Inputs:
h: float

Specific enthalpy [J/kg*K]

Outputs:
T: float

Temperature [K]

Versions:
  • 2016-03-03 @ddalle: Version 1.0

cape.atm.get_h(T)

Get air specific enthalpy using a lookup table

Call:
>>> h = get_h(T)
Inputs:
T: float

Temperature [K]

Outputs:
h: float

Specific enthalpy [J/kg*K]

Versions:
  • 2016-03-03 @ddalle: Version 1.0