Skip to main content

Ussa76

Struct Ussa76 

Source
pub struct Ussa76 { /* private fields */ }
Expand description

The U.S. Standard Atmosphere, 1976, optionally offset in temperature and sea-level pressure.

It serializes as its two parameters, temperature_offset_k and sea_level_pressure_pa, and re-checks them when deserialized.

Implementations§

Source§

impl Ussa76

Source

pub fn standard() -> Self

The standard itself: no offset and P₀ = 101325 Pa.

Source

pub fn with_offset( temperature_offset_k: f64, sea_level_pressure_pa: f64, ) -> Result<Self, AtmosError>

The standard with its molecular-scale temperature offset by temperature_offset_k at every geopotential height, and hydrostatic pressure from sea_level_pressure_pa at H = 0.

§Errors

AtmosError::Domain if the offset is not finite or would make the temperature anywhere in the model zero or negative (it must exceed −186.9 K), or if the sea-level pressure is not finite and positive.

Source

pub fn anchored( height_msl_m: f64, temperature_k: f64, pressure_pa: f64, ) -> Result<Self, AtmosError>

The offset standard that passes through a measured kinetic temperature_k and pressure_pa at geometric height_msl_m: ΔT makes the temperature match there, and P₀ scales the pressure profile to match. Launch-site conditions are the usual use.

The offset holds all the way up, which a real hot or cold day does not: anchoring +20 K at a 1400 m field (at the standard’s field pressure) makes the air 5.7% thinner at 3 km but 14% denser at 20 km and 30% denser at 30 km than the standard (validation/oracles/atmosphere/conventions.py). For flights far above the field, prefer a sounding.

§Errors

AtmosError::Domain if the height is not finite or not above −r₀, the temperature or pressure is not finite and positive, or the implied offset or sea-level pressure is out of range (see Ussa76::with_offset).

Source

pub fn temperature_offset_k(&self) -> f64

The temperature offset ΔT, K.

Source

pub fn sea_level_pressure_pa(&self) -> f64

The pressure at H = 0, Pa.

Source

pub fn sample(&self, height_msl_m: f64) -> Result<AirSample, AtmosError>

The air at geometric height height_msl_m (see Atmosphere::air).

§Errors

AtmosError::Domain if the height is not finite or not above −r₀.

Source

pub fn pressure_altitude_m(&self, pressure_pa: f64) -> Result<f64, AtmosError>

The geopotential altitude H (m′) at which this atmosphere’s pressure is pressure_pa: its pressure altitude. Of the standard itself, this is what a barometric altimeter reads.

It inverts eqs. 33a and 33b in the layer whose base pressures bracket P:

H = H_b + (T_M,b / L_M,b) [(P / P_b)^(−R* L_M,b / (g₀′ M₀)) − 1]      L_M,b ≠ 0
H = H_b − (R* T_M,b / (g₀′ M₀)) ln(P / P_b)                         L_M,b = 0

Above sea-level pressure it extends the lowest layer, and below the 86 km top’s it continues isothermally, as Ussa76::sample does. In the troposphere of the standard it is the altimeter formula H = 44330.8 m [1 − (P / 101325 Pa)^0.190263].

§Errors

AtmosError::Domain if the pressure is not finite and positive.

Trait Implementations§

Source§

impl Atmosphere for Ussa76

Source§

fn air(&self, height_msl_m: f64) -> Result<AirSample, AtmosError>

The air at geometric height height_msl_m above mean sea level. Read more
Source§

impl Clone for Ussa76

Source§

fn clone(&self) -> Ussa76

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Ussa76

Source§

impl Debug for Ussa76

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Ussa76

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Ussa76

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Ussa76

Source§

fn eq(&self, other: &Ussa76) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Ussa76

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Ussa76

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.