ambiance package

Submodules

ambiance.ambiance module

Compute atmospheric properties for heights ranging from -5 km to 80 km.

The implementation is based on the ICAO standard atmosphere from 1993:

[ICAO93](1, 2) International Civil Aviation Organization ; Manual Of The ICAO Standard Atmosphere – 3rd Edition 1993 (Doc 7488) – extended to 80 kilometres (262 500 feet) https://store.icao.int/manual-of-the-icao-standard-atmosphere-extended-to-80-kilometres-262-500-feet-doc-7488-quadrilingual-printed.html

Other references:

[WISA19]Wikipedia ; International Standard Atmosphere ; https://en.wikipedia.org/wiki/International_Standard_Atmosphere Accessed: 2019-07-28
class ambiance.ambiance.Atmosphere(h)

Bases: object

Representation of the ICAO standard atmosphere (1993)

  • All input and output is using the basic SI-units
  • Input for computation of atmospheric properties is generally the GEOMETRIC (actual) height
  • Either a single value or a height range can be given as input

Usage:

Compute a properties such as pressure for a given height:

>>> Atmosphere(0).pressure
array([101325.])

Values out of valid height range will not be computed:

>>> Atmosphere(-6e3)
Traceback (most recent call last):
    ...
ValueError: Value out of bounds. Lower limit: -5004 m. Upper limit: 81020 m.

Create an atmosphere object with given support points (heights in metre):

>>> atmos = Atmosphere([0, 1000, 5000, 17777, 35e3, 80e3])
>>>

Compute basic properties such as density, temperature or pressure:

>>> atmos.density
array([1.22500002e+00, 1.11165967e+00, 7.36428613e-01, 1.25975595e-01,
       8.46333291e-03, 1.84578859e-05])
>>> atmos.temperature
array([288.15      , 281.65102237, 255.67554322, 216.65      ,
       236.51337209, 198.63857625])
>>> atmos.pressure
array([1.01325000e+05, 8.98762776e+04, 5.40482622e+04, 7.83442282e+03,
       5.74591263e+02, 1.05246447e+00])
H

Geopotential heights \(H\)

static T2t(T)

Convert from temperature \(T\) in Kelvin to \(t\) in degree Celsius

\(t = T - T_i\)

collision_frequency

Collision frequency \(\omega\)

\(\omega = 4 \sigma^2 N_A \left( \frac{\pi}{R^{*} M_0} \right)^{1/2} \frac{p}{\sqrt{T}}\)

density

Air density \(\rho\)

\(\rho = \frac{p}{R T}\)

dynamic_viscosity

Dynamic viscosity \(\mu\)

\(\mu = \frac{\beta_s T^{3/2}}{T + S}\)

static geom2geop_height(h)

Convert geometric height \(h\) to geopotential height \(H\)

\(H = \frac{r h}{r + h}\)

static geop2geom_height(H)

Convert geopotential height \(H\) to geometric height \(h\)

\(h = \frac{r H}{r - H}\)

grav_accel

Gravitational acceleration \(g\)

\(g = g_0 \left( \frac{r}{r + h} \right)^2\)

h

Geometric heights \(h\)

kinematic_viscosity

Kinematic viscosity \(\nu\)

\(\nu = \frac{\mu}{\rho}\)

layer_name

Get layer names as strings

layer_nums

Array of same shape as ‘self.H’ with layer numbers (int)

mean_free_path

Mean free path \(l\)

\(l = \frac{1}{\sqrt{2} \pi \sigma^2 n}\)

mean_particle_speed

Mean particle speed \(\bar{\nu}\)

\(\bar{\nu} = \left( \frac{8}{\pi} R T \right)^{1/2}\)

number_density

Number density \(n\)

\(n = \frac{N_A p}{R^{*} T}\)

pressure

Air pressure \(p\)

\(p = p_b \exp \left[ - \frac{g_0}{R T} (H - H_b) \right] \quad \text{for} \quad \beta = 0\)

\(p = p_b \left[ 1 + \frac{\beta}{T_b} (H - H_b) \right]^{-g_0 \beta / R} \quad \text{for} \quad \beta \neq 0\)

pressure_scale_height

Pressure scale height \(H_p\)

\(H_p = \frac{R T}{g}\)

specific_weight

Specific weight \(\gamma\)

\(\gamma = \rho g\)

speed_of_sound

Speed of sound \(a\)

\(a = \sqrt{\kappa R T}\)

static t2T(t)

Convert from temperature \(t\) in degree Celsius to \(T\) in Kelvin

\(T = t + T_i\)

temperature

Air temperature \(T\) in Kelvin

\(T = T_b + \beta (H - H_b)\)

temperature_in_celsius

Air temperature \(t\) in Celsius

\(t = T - T_i\)

thermal_conductivity

Thermal conductivity \(\lambda\)

\(\lambda = \frac{2.648151 \cdot 10^{-3} T^{3/2}}{T + (245.4 \cdot 10^{-12/T})}\)

ambiance.ambiance.CONST

alias of ambiance.ambiance.Const

class ambiance.ambiance.Const

Bases: object

Constants defined in the ICAO standard atmosphere (1993)

Notes:
  • All values are given in SI-units.
Attributes:
g_0:Standard gravitational acceleration [m/s^2]
M_0:Sea level molar mass [kg/mol]
N_A:Avogadro constant [1/mol]
P_0:Sea level atmospheric pressure [Pa]
R_star:Universal gas constant [J/K*mol]
R:Specific gas constant [J/K*kg]
S:Sutherland’s empirical constant in the equation for dynamic viscosity [K]
T_i:Temperature of the ice point at mean sea level [K]
T_0:Sea level temperature [K]
t_i:Celsius temperature of the ice point at mean sea level [degC]
t_0:Celsius sea level temperature [degC]
beta_s:Sutherland’s empirical constant in the equation for dynamic viscosity [kg/(m*s*K**(1/2))]
kappa:Adiabatic index [-]
rho_0:Sea level atmospheric density [kg/m^3]
sigma:Effective collision diameter of an air molecule [m]
r:Nominal Earth’s radius [m]
h_min:Lower boundary of acceptable geometric heights [m]
h_max:Upper boundary of acceptable geometric heights [m]
H_min:Lower boundary of acceptable geopotential heights [m]
H_max:Upper boundary of acceptable geopotential heights [m]
LAYER_SPEC_PROP:
 Table containing layer specific properties
LAYER_DICTS:Dictionary containing layer specific properties
Notes on ‘LAYER_SPEC_PROP’:
  • Table with columns
    1. H_b:geopotential base height [m]
    2. T_b:base temperature [K]
    3. beta:base temperature gradient [kg/(m*s*K^(1/2))]
    4. p:base pressure [Pa]
    5. layer name:string representation of layer name
  • Values for (1,2,3) from table D in [ICAO93]
  • Values for (4) for pressure from [ICAO93]
  • Values for (5) from [WISA19]
H_base = 71000.0
H_max = 80000
H_min = -5000
H_top = 80000.0
LAYER_DICTS = {1: {'H_base': -5000.0, 'H_top': 0.0, 'T': 320.65, 'beta': -0.0065, 'name': 'troposphere', 'p': 177687.0}, 2: {'H_base': 0.0, 'H_top': 11000.0, 'T': 288.15, 'beta': -0.0065, 'name': 'troposphere', 'p': 101325.0}, 3: {'H_base': 11000.0, 'H_top': 20000.0, 'T': 216.65, 'beta': 0.0, 'name': 'tropopause', 'p': 22632.0}, 4: {'H_base': 20000.0, 'H_top': 32000.0, 'T': 216.65, 'beta': 0.001, 'name': 'stratosphere', 'p': 5474.87}, 5: {'H_base': 32000.0, 'H_top': 47000.0, 'T': 228.65, 'beta': 0.0028, 'name': 'stratosphere', 'p': 868.014}, 6: {'H_base': 47000.0, 'H_top': 51000.0, 'T': 270.65, 'beta': 0.0, 'name': 'stratopause', 'p': 110.906}, 7: {'H_base': 51000.0, 'H_top': 71000.0, 'T': 270.65, 'beta': -0.0028, 'name': 'mesosphere', 'p': 66.9384}, 8: {'H_base': 71000.0, 'H_top': 80000.0, 'T': 214.65, 'beta': -0.002, 'name': 'mesosphere', 'p': 3.95639}}
LAYER_NUM_FIRST = 1
LAYER_NUM_LAST = 8
LAYER_SPEC_PROP = [[-5000.0, 320.65, -0.0065, 177687.0, 'troposphere'], [0.0, 288.15, -0.0065, 101325.0, 'troposphere'], [11000.0, 216.65, 0.0, 22632.0, 'tropopause'], [20000.0, 216.65, 0.001, 5474.87, 'stratosphere'], [32000.0, 228.65, 0.0028, 868.014, 'stratosphere'], [47000.0, 270.65, 0.0, 110.906, 'stratopause'], [51000.0, 270.65, -0.0028, 66.9384, 'mesosphere'], [71000.0, 214.65, -0.002, 3.95639, 'mesosphere'], [80000.0, 196.65, -0.002, 0.886272, 'mesosphere']]
MAX_STR_LEN_LAYER_NAME = 12
M_0 = 0.02896442
N_A = 6.02257e+23
P_0 = 101325.0
R = 287.05287
R_star = 8.31432
S = 110.4
T = 214.65
T_0 = 288.15
T_i = 273.15
beta = -0.002
beta_s = 1.458e-06
g_0 = 9.80665
h_max = 81020
h_min = -5004
i = 8
kappa = 1.4
layer_name = 'mesosphere'
layer_pair = ([71000.0, 214.65, -0.002, 3.95639, 'mesosphere'], [80000.0, 196.65, -0.002, 0.886272, 'mesosphere'])
p = 3.95639
r = 6356766
rho_0 = 1.225
sigma = 3.65e-10
t_0 = 15.0
t_i = 0.0
ambiance.ambiance.pairwise(iterable)

Iterate pairwise

s -> (s0,s1), (s1,s2), (s2, s3), …

See: https://docs.python.org/3/library/itertools.html

Module contents