pub struct FvVectorMatrix {
pub mesh: Arc<FvMesh>,
pub ldu: LduMatrix,
pub source: Field<Vector3>,
}Expand description
Implicit vector equation A·U = b for a VolVectorField.
Mirrors Foam::fvVectorMatrix (fvMatrix<vector>).
The LDU coefficients are scalar — they multiply the entire velocity
vector equally in all three directions. The source vector is a
Field<Vector3>. Solving decomposes into three independent scalar
Gauss-Seidel solves (one per component).
Fields§
§mesh: Arc<FvMesh>Mesh the equation is defined on (shares the face addressing).
ldu: LduMatrixScalar LDU coefficients of the operator A (shared by all 3 components).
source: Field<Vector3>Right-hand-side vector source per cell, length n_cells.
Implementations§
Source§impl FvVectorMatrix
impl FvVectorMatrix
Sourcepub fn new(mesh: Arc<FvMesh>) -> Self
pub fn new(mesh: Arc<FvMesh>) -> Self
Allocate a zero-initialised vector matrix for mesh (zero coefficients,
zero source).
Sourcepub fn add_to_diag(&mut self, coeff: &Field<f64>)
pub fn add_to_diag(&mut self, coeff: &Field<f64>)
Add coeff[c] to the diagonal of cell c (e.g. a time-derivative term).
Sourcepub fn add_to_source(&mut self, term: &Field<Vector3>)
pub fn add_to_source(&mut self, term: &Field<Vector3>)
Add term[c] to the vector source of cell c.
Sourcepub fn set_reference(&mut self, cell: usize, value: Vector3)
pub fn set_reference(&mut self, cell: usize, value: Vector3)
Pin one cell’s velocity to a fixed value (reference cell for closed domains).
Sourcepub fn a_field(&self) -> VolScalarField
pub fn a_field(&self) -> VolScalarField
Diagonal coefficient per cell: A[c] = diag[c].
Used in PISO: rAU = 1 / UEqn.a_field().
Sourcepub fn h_field(&self, u: &VolVectorField) -> VolVectorField
pub fn h_field(&self, u: &VolVectorField) -> VolVectorField
Off-diagonal + source residual: H[c] = source[c] − Σ off-diag · U.
For a zero field x this returns source[c] directly.
Used in PISO: HbyA = rAU * UEqn.h_field(U).
Sourcepub fn solve(
&self,
name: &str,
settings: SolverSettings,
) -> (VolVectorField, SolverPerformance)
pub fn solve( &self, name: &str, settings: SolverSettings, ) -> (VolVectorField, SolverPerformance)
Solve each component (x, y, z) as an independent scalar Gauss-Seidel problem.
Trait Implementations§
Source§impl Add for FvVectorMatrix
impl Add for FvVectorMatrix
Source§impl AddAssign for FvVectorMatrix
impl AddAssign for FvVectorMatrix
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl Clone for FvVectorMatrix
impl Clone for FvVectorMatrix
Source§fn clone(&self) -> FvVectorMatrix
fn clone(&self) -> FvVectorMatrix
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FvVectorMatrix
impl Debug for FvVectorMatrix
Source§impl Neg for FvVectorMatrix
impl Neg for FvVectorMatrix
Source§impl Sub for FvVectorMatrix
impl Sub for FvVectorMatrix
Source§impl SubAssign for FvVectorMatrix
impl SubAssign for FvVectorMatrix
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read more