pub struct VorticityConfinement {
pub strength: f64,
}Expand description
Vorticity confinement adds back dissipated rotation energy.
A positive strength amplifies existing vorticity, keeping swirling
structures alive longer.
Fields§
§strength: f64Confinement coefficient (dimensionless, typically 0.01 – 0.5).
Implementations§
Source§impl VorticityConfinement
impl VorticityConfinement
Sourcepub fn compute_vorticity(&self, grid: &MacGrid) -> Vec<f64>
pub fn compute_vorticity(&self, grid: &MacGrid) -> Vec<f64>
Compute the scalar vorticity (∂u_y/∂x − ∂u_x/∂y) at every cell centre.
Returns a flat Vecf64of lengthnx * ny`.
Sourcepub fn apply_confinement_force(&self, grid: &mut MacGrid, dt: f64)
pub fn apply_confinement_force(&self, grid: &mut MacGrid, dt: f64)
Apply the vorticity confinement force to grid.
Computes f = strength * dx * η × (∇|ω| / |∇|ω||) and adds it to the
face velocities.
Auto Trait Implementations§
impl Freeze for VorticityConfinement
impl RefUnwindSafe for VorticityConfinement
impl Send for VorticityConfinement
impl Sync for VorticityConfinement
impl Unpin for VorticityConfinement
impl UnsafeUnpin for VorticityConfinement
impl UnwindSafe for VorticityConfinement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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