pub struct QttImmersed2d<R>where
R: CfdScalar + ConjugateScalar<Real = R>,{ /* private fields */ }Expand description
Marches the periodic 2-D incompressible Navier–Stokes equations with an immersed body enforced by
Brinkman volume penalization. Wraps a QttIncompressible2d (convection + diffusion + projection)
and adds the penalization forcing each step. State is the (u, v) velocity train pair.
Implementations§
Source§impl<R> QttImmersed2d<R>where
R: CfdScalar + ConjugateScalar<Real = R>,
impl<R> QttImmersed2d<R>where
R: CfdScalar + ConjugateScalar<Real = R>,
Sourcepub fn new(
lx: usize,
ly: usize,
dx: R,
dy: R,
dt: R,
nu: R,
mask: CausalTensorTrain<R>,
ubx: R,
uby: R,
eta: R,
trunc: Truncation<R>,
) -> Result<Self, PhysicsError>
pub fn new( lx: usize, ly: usize, dx: R, dy: R, dt: R, nu: R, mask: CausalTensorTrain<R>, ubx: R, uby: R, eta: R, trunc: Truncation<R>, ) -> Result<Self, PhysicsError>
Builds the immersed solver for a 2^Lx × 2^Ly periodic grid: the base incompressible solver
(spacings dx/dy, step dt, viscosity nu, round policy trunc) plus the body mask
(a [0, 1] volume fraction, see body_mask_2d), the body velocity
(ubx, uby) (zero for a static wall), and the penalization parameter eta (small → hard wall;
explicit stepping needs Δt ≲ η).
§Errors
PhysicsError::PhysicalInvariantBroken when the configuration is outside the numerical
envelope: a non-positive or non-finite eta, a dt beyond the penalization
explicit-stability limit 2η (forward Euler on du/dt = −u/η), or any base-solver violation
from QttIncompressible2d::new (spacings, dt, nu, the diffusive limit). The diagnostic
names the limit and both the configured and the limiting value, as the DEC family’s
cfl_check does. Propagates operator-assembly errors.
Sourcepub fn mask(&self) -> &CausalTensorTrain<R>
pub fn mask(&self) -> &CausalTensorTrain<R>
The body mask (a [0, 1] volume fraction), exposed for the surface-force observables.
Sourcepub fn body_velocity(&self) -> (R, R)
pub fn body_velocity(&self) -> (R, R)
The body velocity (ubx, uby).
Sourcepub fn projector(&self) -> &QttProjector2d<R>
pub fn projector(&self) -> &QttProjector2d<R>
The Leray projector (delegated to the base solver) — for the divergence observable.
Sourcepub fn advance_scalar(
&self,
temp: &CausalTensorTrain<R>,
u: &CausalTensorTrain<R>,
v: &CausalTensorTrain<R>,
t_wall: R,
kappa: R,
) -> Result<CausalTensorTrain<R>, PhysicsError>
pub fn advance_scalar( &self, temp: &CausalTensorTrain<R>, u: &CausalTensorTrain<R>, v: &CausalTensorTrain<R>, t_wall: R, kappa: R, ) -> Result<CausalTensorTrain<R>, PhysicsError>
Advances a passive scalar temp one step on the same rollout: advection–diffusion by the
velocity (u, v) (diffusivity kappa) plus penalization to the wall temperature t_wall inside
the body (−(1/η)·χ_body ⊙ (T − T_w)). No projection (a scalar has no incompressibility
constraint). This is the neutral thermal seam the Gap-2 reacting energy equation replaces.
§Errors
Propagates operator-apply / round errors.
Sourcepub fn run(
&self,
u0: &CausalTensor<R>,
v0: &CausalTensor<R>,
steps: usize,
) -> Result<(CausalTensor<R>, CausalTensor<R>), PhysicsError>
pub fn run( &self, u0: &CausalTensor<R>, v0: &CausalTensor<R>, steps: usize, ) -> Result<(CausalTensor<R>, CausalTensor<R>), PhysicsError>
Encodes (u0, v0), marches steps penalized steps, and decodes — the end-to-end driver.
§Errors
PhysicsError::DimensionMismatch if a field’s shape is not the grid [2^Lx, 2^Ly];
propagates step errors.
Trait Implementations§
Source§impl<R> Marcher<R> for QttImmersed2d<R>where
R: CfdScalar + ConjugateScalar<Real = R>,
impl<R> Marcher<R> for QttImmersed2d<R>where
R: CfdScalar + ConjugateScalar<Real = R>,
Source§type State = (CausalTensorTrain<R>, CausalTensorTrain<R>)
type State = (CausalTensorTrain<R>, CausalTensorTrain<R>)
Source§type Output = (CausalTensorTrain<R>, CausalTensorTrain<R>)
type Output = (CausalTensorTrain<R>, CausalTensorTrain<R>)
Auto Trait Implementations§
impl<R> Freeze for QttImmersed2d<R>
impl<R> RefUnwindSafe for QttImmersed2d<R>
impl<R> Send for QttImmersed2d<R>
impl<R> Sync for QttImmersed2d<R>
impl<R> Unpin for QttImmersed2d<R>
impl<R> UnsafeUnpin for QttImmersed2d<R>
impl<R> UnwindSafe for QttImmersed2d<R>
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
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> ⓘ
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> ⓘ
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