Skip to main content

FluxLimiter

Enum FluxLimiter 

Source
pub enum FluxLimiter {
    Upwind,
    Linear,
    VanLeer,
    VanAlbada,
    Minmod,
    SuperBee,
    Muscl,
    Umist,
    Ospre,
    LimitedLinear(f64),
}
Expand description

A TVD flux limiter psi(r), translated from OpenFOAM’s r-based limitedSchemes. psi = 0 is first-order upwind, psi = 1 is second-order linear; the TVD variants clip extrema (psi(r) = 0 for r <= 0).

Variants§

§

Upwind

First-order upwind: psi = 0.

§

Linear

Unlimited linear (central) differencing: psi = 1 (2nd order, not TVD).

§

VanLeer

vanLeer: upstream (r + mag(r))/(1 + mag(r)). Smooth, symmetric.

§

VanAlbada

vanAlbada: upstream r*(r + 1)/(sqr(r) + 1) with r = max(0, r). Symmetric.

§

Minmod

Minmod: upstream max(min(r, 1), 0). Most diffusive TVD limiter. Symmetric.

§

SuperBee

SuperBee: upstream max(max(min(2r, 1), min(r, 2)), 0). Most compressive. Symmetric.

§

Muscl

MUSCL: upstream max(min(min(2r, 0.5r + 0.5), 2), 0). Symmetric.

§

Umist

UMIST: upstream max(min(min(min(2r, 0.75r + 0.25), 0.25r + 0.75), 2), 0). Third-order biased (not symmetric).

§

Ospre

OSPRE: upstream 1.5 r (r + 1)/(r (r + 1) + 1) with r = max(0, r). Symmetric.

§

LimitedLinear(f64)

limitedLinear(k): upstream max(min((2/k) r, 1), 0), coefficient k in [0, 1] (k -> 0 approaches unlimited linear, k = 1 most limited). A k-blended bounded scheme — not strictly within the classic psi <= 2r Sweby envelope for small k.

Implementations§

Source§

impl FluxLimiter

Source

pub fn psi(&self, r: f64) -> f64

The flux-limiter function psi(r). r may be any f64; a non-finite r returns 0. For the TVD limiters r <= 0 (a local extremum) returns 0. The result is clamped non-negative.

Source

pub fn is_tvd(&self) -> bool

True if this is a second-order TVD limiter (everything except Upwind and Linear).

Source

pub fn is_symmetric(&self) -> bool

True if the limiter is symmetric (psi(r)/r == psi(1/r)), the property of the second-order symmetric TVD limiters. UMIST is third-order-biased (asymmetric); limitedLinear is a k-blend and not in this set.

Trait Implementations§

Source§

impl Clone for FluxLimiter

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 FluxLimiter

Source§

impl Debug for FluxLimiter

Source§

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

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

impl PartialEq for FluxLimiter

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FluxLimiter

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

Source§

type Output = T

Should always be Self
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.