Skip to main content

FvModel

Enum FvModel 

Source
pub enum FvModel {
    SemiImplicit(SemiImplicitSource),
    SolidificationMelting(SolidificationMelting),
    SolidificationPorosity(SolidificationPorosity),
    VofSolidificationMelting(VofSolidificationMelting),
}
Expand description

One optional source term.

Enum dispatch rather than trait objects, per the workspace rule: the set of source models is closed and known at compile time, adding one forces every match to be revisited, and rust-analyzer can navigate to each variant — none of which is true of upstream’s runtime-selection table.

§Which equations a model contributes to

Not every model contributes to every equation. contributes_to reports what a model acts on, mirroring upstream’s addSupFields, so applying a whole collection to an equation only invokes the models that have something to say about it.

Variants§

§

SemiImplicit(SemiImplicitSource)

A general explicit/implicit source, upstream semiImplicitSource.

§

SolidificationMelting(SolidificationMelting)

Solidification and melting by the enthalpy-porosity method, upstream solidificationMelting. The physically complete phase-change model: tracks a liquid fraction, absorbs latent heat, carries its own Boussinesq buoyancy.

§

SolidificationPorosity(SolidificationPorosity)

Solidification as a bare porous blockage, upstream porosityModels::solidification. No latent heat and no buoyancy — it only freezes the momentum out of cold cells.

Strictly, upstream files this under porosityModel rather than fvModel; it is folded into this enum because from a solver’s point of view it is the same thing — a term added to the momentum equation over a cell zone — and keeping it in a parallel mechanism would double the wiring for no gain.

§

VofSolidificationMelting(VofSolidificationMelting)

Solidification and melting of a VoF phase, upstream VoFSolidificationMelting. Needs a VoF phase fraction supplied from outside; see FvModels::correct.

Implementations§

Source§

impl FvModel

Source

pub fn name(&self) -> &str

The model’s name, for diagnostics.

Source

pub fn contributes_to(&self, field: &str) -> bool

Whether this model contributes to the equation for field.

Upstream’s addsSupToField. A model asked for a field it does not act on contributes nothing, rather than erroring — that is how a single collection can be handed to every equation a solver assembles.

Trait Implementations§

Source§

impl Clone for FvModel

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 Debug for FvModel

Source§

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

Formats the value using the given formatter. Read more

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.