pyatmos.utils.atmosphere package¶
pyatmos.utils.atmosphere module¶
Contains the following atmospheric functions:
- density = atm_density(alt, mach)
- mach = atm_mach(alt, velocity)
- velocity = atm_velocity(alt, mach)
- pressure = atm_pressure(alt)
- temperature = atm_temperature(alt)
- sos = atm_speed_of_sound(alt)
- mu = atm_dynamic_viscosity_mu(alt)
- nu = atm_kinematic_viscosity_nu(alt)
- eas = atm_equivalent_airspeed(alt, mach)
All the default units are in English units because the source equations are in English units.
-
pyatmos.utils.atmosphere.
atm_density
(alt, R=1716.0, alt_units='ft', density_units='slug/ft^3')[source]¶ Freestream Density f$ rho_{infty} f$
Parameters: - alt : float
altitude in feet or meters
- R : float; default=1716.
gas constant for air in english units (???)
- alt_units : str; default=’ft’
the altitude units; ft, kft, m
- density_units : str; default=’slug/ft^3’
the density units; slug/ft^3, slinch/in^3, kg/m^3
Returns: - rho : float
density f$ rho f$ in density_units
- Based on the formula P=pRT
- f[ large rho=frac{p}{R T} f]
-
pyatmos.utils.atmosphere.
atm_dynamic_pressure
(alt, mach, alt_units='ft', pressure_units='psf')[source]¶ Freestream Dynamic Pressure f$ q_{infty} f$
Parameters: - alt : float
Altitude in alt_units
- mach : float
Mach Number f$ M f$
- alt_units : str; default=’ft’
the altitude units; ft, kft, m
- pressure_units : str; default=’psf’
the pressure units; psf, psi, Pa, kPa, MPa
Returns: - dynamic_pressure : float
Returns dynamic pressure in pressure_units
- The common method that requires many calculations…
- f[ large q = frac{1}{2} rho V^2 f]
- f[ large p = rho R T f]
- f[ large M = frac{V}{a} f]
- f[ large a = sqrt{gamma R T} f]
- so…
- f[ large q = frac{gamma}{2} p M^2 f]
-
pyatmos.utils.atmosphere.
atm_dynamic_viscosity_mu
(alt, alt_units='ft', visc_units='(lbf*s)/ft^2')[source]¶ Freestream Dynamic Viscosity f$ mu_{infty} f$
Parameters: - alt : float
Altitude in alt_units
- alt_units : str; default=’ft’
the altitude units; ft, kft, m
- visc_units : str; default=’(lbf*s)/ft^2’
the viscosity units; (lbf*s)/ft^2, (N*s)/m^2, Pa*s
Returns: - mu : float
dynamic viscosity f$ mu_{infty} f$ in (lbf*s)/ft^2 or (N*s)/m^2 (SI)
See also
sutherland_viscoscity ..
-
pyatmos.utils.atmosphere.
atm_equivalent_airspeed
(alt, mach, alt_units='ft', eas_units='ft/s')[source]¶ - Freestream equivalent airspeed
Parameters: - alt : float
altitude in alt_units
- Mach : float
Mach Number
- $ M
- $
- alt_units : str; default=’ft’
the altitude units; ft, kft, m
- eas_units : str; default=’ft/s’
the equivalent airspeed units; ft/s, m/s, in/s, knots
Returns: - eas : float
equivalent airspeed in eas_units
EAS = TAS * sqrt(rho/rho0) p = rho * R * T rho = p/(RT) rho/rho0 = p/T * T0/p0 TAS = a * M EAS = a * M * sqrt(p/T * T0/p0) EAS = a * M * sqrt(p*T0 / (T*p0))
-
pyatmos.utils.atmosphere.
atm_kinematic_viscosity_nu
(alt, alt_units='ft', visc_units='ft^2/s')[source]¶ Freestream Kinematic Viscosity f$ nu_{infty} f$
Parameters: - alt : float
Altitude in alt_units
- alt_units : str; default=’ft’
the altitude units; ft, kft, m
- visc_units : str; default=’slug/ft^3’
the kinematic viscosity units; ft^2/s, m^2/s
Returns: - nu : float
kinematic viscosity f$ nu_{infty} f$ in visc_units
- f[ large nu = frac{mu}{rho} f]
See also
sutherland_viscoscity ..
-
pyatmos.utils.atmosphere.
atm_mach
(alt, V, alt_units='ft', velocity_units='ft/s')[source]¶ Freestream Mach Number
Parameters: - alt : float
altitude in alt_units
- V : float
Velocity in velocity_units
- alt_units : str; default=’ft’
the altitude units; ft, kft, m
- velocity_units : str; default=’ft/s’
the velocity units; ft/s, m/s, in/s, knots
Returns: - mach : float
Mach Number f$ M f$
- f[ large M = frac{V}{a} f]
-
pyatmos.utils.atmosphere.
atm_pressure
(alt, alt_units='ft', pressure_units='psf')[source]¶ Freestream Pressure f$ p_{infty} f$
Parameters: - alt : float
Altitude in alt_units
- alt_units : str; default=’ft’
the altitude units; ft, kft, m
- pressure_units : str; default=’psf’
the pressure units; psf, psi, Pa, kPa, MPa
Returns: - pressure : float
Returns pressure in pressure_units
Note
from BAC-7006-3352-001-V1.pdfn A Manual for Determining Aerodynamic Heating of High Speed Aircraftn page ~236 - Table C.1n These equations were used b/c they are valid to 300k ft.n Extrapolation is performed above that.n
-
pyatmos.utils.atmosphere.
atm_speed_of_sound
(alt, alt_units='ft', velocity_units='ft/s', gamma=1.4)[source]¶ Freestream Speed of Sound f$ a_{infty} f$
Parameters: - alt : float
Altitude in alt_units
- alt_units : str; default=’ft’
the altitude units; ft, kft, m
- velocity_units : str; default=’ft/s’
the velocity units; ft/s, m/s, in/s, knots
Returns: - speed_of_sound, a : float
Returns speed of sound in velocity_units
- f[ large a = sqrt{gamma R T} f]
-
pyatmos.utils.atmosphere.
atm_temperature
(alt, alt_units='ft', temperature_units='R')[source]¶ Freestream Temperature f$ T_{infty} f$
Parameters: - alt : float
Altitude in alt_units
- alt_units : str; default=’ft’
the altitude units; ft, kft, m
- temperature_units : str; default=’R’
the altitude units; R, K
Returns: - T : float
temperature in degrees Rankine or Kelvin (SI)
Note
from BAC-7006-3352-001-V1.pdfn A Manual for Determining Aerodynamic Heating of High Speed Aircraftn page ~236 - Table C.1n These equations were used because they are valid to 300k ft.n Extrapolation is performed above that.
-
pyatmos.utils.atmosphere.
atm_unit_reynolds_number
(alt, mach, alt_units='ft', reynolds_units='1/ft')[source]¶ Returns the Reynolds Number per unit length.
Parameters: - alt : float
Altitude in alt_units
- mach : float
Mach Number f$ M f$
- alt_units : str; default=’ft’
the altitude units; ft, kft, m
- reynolds_units : str; default=‘1/ft’
the altitude units; 1/ft, 1/m, 1/in
Returns: - ReynoldsNumber/L : float
Reynolds number per unit length in reynolds_units
- f[ large Re = frac{ rho V L}{mu} f]
- f[ large Re_L = frac{ rho V }{mu} f]
-
pyatmos.utils.atmosphere.
atm_unit_reynolds_number2
(alt, mach, alt_units='ft', reynolds_units='1/ft')[source]¶ Returns the Reynolds Number per unit length.
Parameters: - alt : float
Altitude in alt_units
- mach : float
Mach Number f$ M f$
- alt_units : str; default=’ft’
the altitude units; ft, kft, m
- reynolds_units : str; default=‘1/ft’
the altitude units; 1/ft, 1/m, 1/in
Returns: - ReynoldsNumber/L : float
the Reynolds Number per unit length
- f[ large Re_L = frac{ rho V}{mu} = frac{p M a}{mu R T} f]
Note
this version of Reynolds number directly caculates the base quantities, so multiple calls to atm_press and atm_temp are not made
-
pyatmos.utils.atmosphere.
atm_velocity
(alt, mach, alt_units='ft', velocity_units='ft/s')[source]¶ Freestream Velocity f$ V_{infty} f$
Parameters: - alt : float
altitude in alt_units
- Mach : float
Mach Number f$ M f$
- alt_units : str; default=’ft’
the altitude units; ft, kft, m
- velocity_units : str; default=’ft/s’
the velocity units; ft/s, m/s, in/s, knots
Returns: - velocity : float
Returns velocity in velocity_units
- f[ large V = M a f]
-
pyatmos.utils.atmosphere.
sutherland_viscoscity
(T)[source]¶ Helper function that calculates the dynamic viscosity f$ mu f$ of air at a given temperature.
Parameters: - T : float
Temperature T is in Rankine
Returns: - mu : float
dynamic viscosity f$ mu f$ of air in (lbf*s)/ft^2
Note
prints a warning if T>5400 deg R
- Sutherland’s Equationn
- From Aerodynamics for Engineers 4th Editionn
- John J. Bertin 2002n
- page 6 eq 1.5bn