pub struct NavierStokesParams {
pub nu: f64,
pub rho: f64,
pub dt: f64,
pub max_pressure_iter: usize,
pub pressure_tol: f64,
pub semi_lagrangian: bool,
}Expand description
Navier-Stokes solver parameters
Fields§
§nu: f64Kinematic viscosity
rho: f64Density (for incompressible flow, usually 1.0)
dt: f64Time step
max_pressure_iter: usizeMaximum iterations for pressure solver
pressure_tol: f64Tolerance for pressure solver
semi_lagrangian: boolUse semi-Lagrangian advection
Implementations§
Sourcepub fn with_reynolds_number(
reynolds: f64,
characteristic_velocity: f64,
characteristic_length: f64,
) -> Self
pub fn with_reynolds_number( reynolds: f64, characteristic_velocity: f64, characteristic_length: f64, ) -> Self
Create new parameters with specified Reynolds number Reynolds number = U * L / nu, where U is characteristic velocity, L is characteristic length
Sourcepub fn with_viscosity(nu: f64) -> Self
pub fn with_viscosity(nu: f64) -> Self
Create new parameters with specified viscosity
Sourcepub fn with_time_step(dt: f64) -> Self
pub fn with_time_step(dt: f64) -> Self
Create new parameters with specified time step
Sourcepub fn reynolds_number(
&self,
characteristic_velocity: f64,
characteristiclength: f64,
) -> f64
pub fn reynolds_number( &self, characteristic_velocity: f64, characteristiclength: f64, ) -> f64
Calculate the Reynolds number given characteristic velocity and length
Sourcepub fn cfl_number_2d(&self, u_max: f64, vmax: f64, dx: f64, dy: f64) -> f64
pub fn cfl_number_2d(&self, u_max: f64, vmax: f64, dx: f64, dy: f64) -> f64
Calculate CFL number for stability analysis CFL = u * dt / dx + v * dt / dy (+ w * dt / dz for 3D)
Sourcepub fn cfl_number_3d(
&self,
u_max: f64,
v_max: f64,
w_max: f64,
dx: f64,
dy: f64,
dz: f64,
) -> f64
pub fn cfl_number_3d( &self, u_max: f64, v_max: f64, w_max: f64, dx: f64, dy: f64, dz: f64, ) -> f64
Calculate CFL number for 3D case
Sourcepub fn viscous_cfl_2d(&self, dx: f64, dy: f64) -> f64
pub fn viscous_cfl_2d(&self, dx: f64, dy: f64) -> f64
Calculate viscous CFL number Viscous CFL = nu * dt * (1/dx^2 + 1/dy^2 + 1/dz^2)
Trait Implementations§
Source§fn clone(&self) -> NavierStokesParams
fn clone(&self) -> NavierStokesParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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