Skip to main content

QttImmersed2d

Struct QttImmersed2d 

Source
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>,

Source

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 (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.

Source

pub fn mask(&self) -> &CausalTensorTrain<R>

The body mask (a [0, 1] volume fraction), exposed for the surface-force observables.

Source

pub fn eta(&self) -> R

The penalization parameter η.

Source

pub fn body_velocity(&self) -> (R, R)

The body velocity (ubx, uby).

Source

pub fn modes(&self) -> (usize, usize)

The grid mode counts (Lx, Ly).

Source

pub fn projector(&self) -> &QttProjector2d<R>

The Leray projector (delegated to the base solver) — for the divergence observable.

Source

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.

Source

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>,

Source§

type State = (CausalTensorTrain<R>, CausalTensorTrain<R>)

The marching state advanced by one step.
Source§

type Ambient = ()

The ambient read for this step.
Source§

type Output = (CausalTensorTrain<R>, CausalTensorTrain<R>)

The per-step output (the advanced state plus the diagnostics the step already computed).
Source§

fn advance( &self, state: &Self::State, _ambient: &Self::Ambient, ) -> Result<Self::Output, PhysicsError>

Advance the state by one projected step under the given ambient.

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> 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> MaybeParallel for T
where T: Send + Sync + ?Sized,

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, 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.