Skip to main content

EkmanProfile

Struct EkmanProfile 

Source
pub struct EkmanProfile {
    pub geostrophic_mps: f64,
    pub latitude_deg: f64,
    pub eddy_viscosity_m2s: f64,
    pub direction_from_deg: f64,
}
Expand description

Ekman spiral: the classic solution for a neutrally stratified boundary layer with constant eddy viscosity K. At the ground the wind is zero; aloft it approaches the geostrophic speed G. See Holton, An Introduction to Dynamic Meteorology.

u = G(1 − e^(−γz)·cos(γz)), v = sign(f)·G·e^(−γz)·sin(γz) with γ = sqrt(|f| / 2K) and Coriolis f = 2Ω·sin(latitude). u runs along the geostrophic flow and v to its LEFT, so in the northern hemisphere the surface wind is backed about 45° from the geostrophic wind (turned toward low pressure) and veers with height; the southern hemisphere mirrors this. The result is rotated so the geostrophic direction matches direction_from_deg aloft.

z is height above the GROUND, the surface where the spiral is calm: the altitude argument of wind_at and position_m[1] in WindField::wind must both be height above ground. In a frame whose y is altitude above sea level, read it at y - ground elevation, in one place only (this crate has no offset wrapper; see Sounding::to_profile_field).

Fields§

§geostrophic_mps: f64

Geostrophic wind speed aloft, m/s.

§latitude_deg: f64

Latitude, degrees (sign sets the turning sense).

§eddy_viscosity_m2s: f64

Constant eddy viscosity K, m²/s.

§direction_from_deg: f64

Meteorological direction the geostrophic wind comes FROM aloft, degrees.

Implementations§

Source§

impl EkmanProfile

Source

pub fn new( geostrophic_mps: f64, latitude_deg: f64, eddy_viscosity_m2s: f64, direction_from_deg: f64, ) -> Result<Self>

Validate the parameters.

Source

pub fn wind_at(&self, altitude_m: f64) -> Wind

Wind at an altitude, rotated so the geostrophic direction aloft matches direction_from_deg.

Trait Implementations§

Source§

impl Clone for EkmanProfile

Source§

fn clone(&self) -> Self

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 EkmanProfile

Source§

impl Debug for EkmanProfile

Source§

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

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

impl WindField for EkmanProfile

Source§

fn wind(&self, _time_s: f64, position_m: [f64; 3]) -> Wind

World-frame air velocity at a time (seconds) and position ([x, y, z] metres, Y up).

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.