Skip to main content

Phillips1958

Struct Phillips1958 

Source
pub struct Phillips1958 {
    pub alpha: f64,
    pub omega: Array1<f64>,
}
Expand description

The Phillips high-frequency tail

The Phillips spectrum is an early generational wave spectrum that principally captures the energy distribution in the high-frequency spectral tail. Its canonical form1 is:

$$ S(\omega) = \frac{\alpha g^2}{\omega^5} $$

where $\alpha=0.0081$ denotes the Phillips constant and $g$ is the acceleration due to gravity.

§Fields

  • alpha - the Phillips constant (default: 0.0081)
  • omega - frequency range [rad/s]

§Methods

  • energy - calculate the energy density spectrum
  • f_hz - return the frequency space in [Hz]
  • to_spec1d - convert to a Spectrum1 type
  • to_spec2d - convert to a Spectrum2 type for a given Spreading type

§References


  1. O. M. Phillips, The equilibrium range in the spectrum of wind-generated waves, Journal of Fluid Mechanics, vol. 4, no. 4, pp. 426 434, 1958, doi: 10.1017/S0022112058000550. 

Fields§

§alpha: f64§omega: Array1<f64>

Implementations§

Source§

impl Phillips1958

Source

pub fn new() -> Self

create a new Phillips spectrum

Trait Implementations§

Source§

impl Default for Phillips1958

Source§

fn default() -> Self

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

impl SpectralCommon for Phillips1958

Source§

fn hs(&self) -> Result<f64, String>

significant wave height in [m]
Source§

fn tp(&self) -> Result<f64, String>

peak spectral wave period in [s]
Source§

fn omega(&self) -> &Array1<f64>

frequency space in [rad/s]
Source§

fn energy(&self) -> Array1<f64>

calculate the energy density spectrum
Source§

fn f_hz(&self) -> Array1<f64>

return the frequency space in [Hz]
Source§

fn wp(&self) -> Result<f64, String>

return the peak spectral frequency in [rad/s]
Source§

fn fp(&self) -> Result<f64, String>

return the peak spectral frequency in [Hz]
Source§

fn abs_error(&self) -> Result<f64, String>

calculate the absolute error between the significant wave height and the integrated energy
Source§

fn to_spec1d(&self) -> Spectrum1D

convert the spectrum to a 1D spectrum Type
Source§

fn to_spec2d(&self, spreading: &Spreading) -> Spectrum2D

convert the spectrum to a 2D spectrum Type for a given spreading Type

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V