Skip to main content

DeltaCoeff

Enum DeltaCoeff 

Source
pub enum DeltaCoeff {
    Orthogonal,
    NonOrthogonal,
}
Expand description

Which face-to-face distance the Laplacian divides by — OpenFOAM’s choice of deltaCoeffs versus nonOrthDeltaCoeffs.

This selects the implicit coefficient only. It says nothing about the explicit deferred correction, which lives in laplacian_corrected and is orthogonal to this choice. Together the two reproduce OpenFOAM’s three snGradSchemes entries:

OpenFOAM snGradSchemesDeltaCoeffexplicit correction
orthogonalOrthogonalnone
uncorrectedNonOrthogonalnone
correctedNonOrthogonalfull (laplacian_corrected)

§Why the distinction matters

uncorrected is not “the orthogonal scheme”. It still projects the cell-to-cell vector onto the face normal; it merely drops the explicit term. Treating the two as the same under-estimates every face conductance by 1/cos(theta), theta being the face’s non-orthogonality angle — silently, and with no residual to reveal it. Measured on the GeN-Foam 2D_MSFR neutronics mesh (whose fvSchemes asks for uncorrected), that is 1.7 % on the interior faces and up to 12 % on the boundary patches, worth +580 pcm in k_eff.

Variants§

§

Orthogonal

1/|d| — OpenFOAM’s deltaCoeffs, exact only on an orthogonal mesh.

The default, so that every existing caller keeps its behaviour bit-for-bit.

§

NonOrthogonal

1/max(n . d, 0.05 |d|) — OpenFOAM’s nonOrthDeltaCoeffs, the projection of the cell-to-cell vector onto the face normal.

On a boundary face OpenFOAM first replaces d = Cf - C_P by its patch-normal component n (n . d) (fvPatch::delta()), which makes the coefficient 1/(n . d) there.

Implementations§

Source§

impl DeltaCoeff

Source

pub fn interior_delta(self, mesh: &FvMesh, face: usize) -> f64

The distance [m] this scheme divides by on internal face face.

The reciprocal is OpenFOAM’s deltaCoeffs/nonOrthDeltaCoeffs entry for that face. Exposed so a caller that builds its own boundary or face coefficient can divide by exactly the same length the Laplacian does — a Robin condition whose weight uses a different one is silently wrong by 1/cos(theta).

Source

pub fn boundary_delta(self, mesh: &FvMesh, face: usize) -> f64

The distance [m] this scheme divides by on boundary face face (a global face index, patch.start + i).

See Self::interior_delta for why a caller would want this.

Trait Implementations§

Source§

impl Clone for DeltaCoeff

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 Copy for DeltaCoeff

Source§

impl Debug for DeltaCoeff

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for DeltaCoeff

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for DeltaCoeff

Source§

impl PartialEq for DeltaCoeff

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DeltaCoeff

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.