A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise. More...
Classes | |
class | fvSolver |
Public Types | |
typedef GeometricField< Type, fvPatchField, volMesh > | psiFieldType |
Field type for psi. More... | |
typedef GeometricField< Type, fvsPatchField, surfaceMesh > | faceFluxFieldType |
Field type for face flux (for non-orthogonal correction) More... | |
typedef GeometricField< Type, fvsPatchField, surfaceMesh > * | faceFluxFieldPtrType |
Declare return type of the faceFluxCorrectionPtr() function. More... | |
Public Member Functions | |
ClassName ("fvMatrix") | |
fvMatrix (const GeometricField< Type, fvPatchField, volMesh > &psi, const dimensionSet &ds) | |
Construct given a field to solve for. More... | |
fvMatrix (const fvMatrix< Type > &) | |
Copy construct. More... | |
fvMatrix (const tmp< fvMatrix< Type >> &) | |
Copy/move construct from tmp<fvMatrix<Type>> More... | |
fvMatrix (const GeometricField< Type, fvPatchField, volMesh > &psi, Istream &is) | |
Construct from Istream given field to solve for. More... | |
tmp< fvMatrix< Type > > | clone () const |
Clone. More... | |
virtual | ~fvMatrix () |
Destructor. More... | |
label | nMatrices () const |
const fvMatrix< Type > & | matrix (const label i) const |
fvMatrix< Type > & | matrix (const label i) |
label | globalPatchID (const label fieldi, const label patchi) const |
void | transferFvMatrixCoeffs () |
Transfer lower, upper, diag and source to this fvMatrix. More... | |
void | createOrUpdateLduPrimitiveAssembly () |
Create or update ldu assembly. More... | |
lduPrimitiveMeshAssembly * | lduMeshPtr () |
Access to lduPrimitiveMeshAssembly. More... | |
const lduPrimitiveMeshAssembly * | lduMeshPtr () const |
Const Access to lduPrimitiveMeshAssembly. More... | |
void | manipulateMatrix (direction cmp) |
Manipulate matrix. More... | |
void | setBounAndInterCoeffs () |
Manipulate boundary/internal coeffs for coupling. More... | |
void | setInterfaces (lduInterfaceFieldPtrsList &, PtrDynList< lduInterfaceField > &newInterfaces) |
Set interfaces. More... | |
void | mapContributions (label fieldi, const FieldField< Field, Type > &fluxContrib, FieldField< Field, Type > &contrib, bool internal) const |
Add internal and boundary contribution to local patches. More... | |
const lduPrimitiveMeshAssembly & | lduMeshAssembly () |
Return optional lduAdressing. More... | |
const GeometricField< Type, fvPatchField, volMesh > & | psi (const label i=0) const |
Return psi. More... | |
GeometricField< Type, fvPatchField, volMesh > & | psi (const label i=0) |
void | clear () |
Clear multiple fvMatrices. More... | |
const dimensionSet & | dimensions () const |
Field< Type > & | source () |
const Field< Type > & | source () const |
const FieldField< Field, Type > & | internalCoeffs () const |
FieldField< Field, Type > & | internalCoeffs () |
const FieldField< Field, Type > & | boundaryCoeffs () const |
FieldField< Field, Type > & | boundaryCoeffs () |
faceFluxFieldPtrType & | faceFluxCorrectionPtr () |
Return pointer to face-flux non-orthogonal correction field. More... | |
bool | hasFaceFluxCorrection () const noexcept |
True if face-flux non-orthogonal correction field exists. More... | |
void | setValues (const labelUList &cellLabels, const Type &value) |
void | setValues (const labelUList &cellLabels, const UList< Type > &values) |
void | setValues (const labelUList &cellLabels, const UIndirectList< Type > &values) |
void | setReference (const label celli, const Type &value, const bool forceReference=false) |
Set reference level for solution. More... | |
void | setReferences (const labelUList &cellLabels, const Type &value, const bool forceReference=false) |
Set reference level for solution. More... | |
void | setReferences (const labelUList &cellLabels, const UList< Type > &values, const bool forceReference=false) |
Set reference level for solution. More... | |
void | setComponentReference (const label patchi, const label facei, const direction cmpt, const scalar value) |
void | addFvMatrix (fvMatrix< Type > &matrix) |
Add fvMatrix. More... | |
void | relax (const scalar alpha) |
Relax matrix (for steady-state solution). More... | |
void | relax () |
Relax matrix (for steady-state solution). More... | |
void | boundaryManipulate (typename GeometricField< Type, fvPatchField, volMesh >::Boundary &values) |
Manipulate based on a boundary field. More... | |
autoPtr< fvSolver > | solver (const dictionary &) |
Construct and return the solver. More... | |
autoPtr< fvSolver > | solver () |
Construct and return the solver. More... | |
SolverPerformance< Type > | solveSegregatedOrCoupled (const dictionary &) |
Solve segregated or coupled returning the solution statistics. More... | |
SolverPerformance< Type > | solveSegregated (const dictionary &) |
Solve segregated returning the solution statistics. More... | |
SolverPerformance< Type > | solveCoupled (const dictionary &) |
Solve coupled returning the solution statistics. More... | |
SolverPerformance< Type > | solve (const dictionary &) |
Solve returning the solution statistics. More... | |
SolverPerformance< Type > | solve () |
Solve returning the solution statistics. More... | |
tmp< Field< Type > > | residual () const |
Return the matrix residual. More... | |
tmp< scalarField > | D () const |
Return the matrix scalar diagonal. More... | |
tmp< Field< Type > > | DD () const |
Return the matrix Type diagonal. More... | |
tmp< volScalarField > | A () const |
Return the central coefficient. More... | |
tmp< GeometricField< Type, fvPatchField, volMesh > > | H () const |
Return the H operation source. More... | |
tmp< volScalarField > | H1 () const |
Return H(1) More... | |
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > | flux () const |
Return the face-flux field from the matrix. More... | |
const dictionary & | solverDict () const |
Return the solver dictionary taking into account finalIteration. More... | |
void | operator= (const fvMatrix< Type > &) |
void | operator= (const tmp< fvMatrix< Type >> &) |
void | negate () |
void | operator+= (const fvMatrix< Type > &) |
void | operator+= (const tmp< fvMatrix< Type >> &) |
void | operator-= (const fvMatrix< Type > &) |
void | operator-= (const tmp< fvMatrix< Type >> &) |
void | operator+= (const DimensionedField< Type, volMesh > &) |
void | operator+= (const tmp< DimensionedField< Type, volMesh >> &) |
void | operator+= (const tmp< GeometricField< Type, fvPatchField, volMesh >> &) |
void | operator-= (const DimensionedField< Type, volMesh > &) |
void | operator-= (const tmp< DimensionedField< Type, volMesh >> &) |
void | operator-= (const tmp< GeometricField< Type, fvPatchField, volMesh >> &) |
void | operator+= (const dimensioned< Type > &) |
void | operator-= (const dimensioned< Type > &) |
void | operator+= (const zero &) |
void | operator-= (const zero &) |
void | operator*= (const volScalarField::Internal &) |
void | operator*= (const tmp< volScalarField::Internal > &) |
void | operator*= (const tmp< volScalarField > &) |
void | operator*= (const dimensioned< scalar > &) |
template<> | |
void | setComponentReference (const label patchi, const label facei, const direction, const scalar value) |
template<> | |
Foam::autoPtr< Foam::fvMatrix< Foam::scalar >::fvSolver > | solver (const dictionary &solverControls) |
template<> | |
Foam::solverPerformance | solveSegregated (const dictionary &solverControls) |
template<> | |
Foam::tmp< Foam::scalarField > | residual () const |
template<> | |
Foam::tmp< Foam::volScalarField > | H () const |
template<> | |
Foam::tmp< Foam::volScalarField > | H1 () const |
template<> | |
void | setComponentReference (const label patchi, const label facei, const direction, const scalar value) |
template<> | |
autoPtr< fvMatrix< scalar >::fvSolver > | solver (const dictionary &) |
template<> | |
solverPerformance | solveSegregated (const dictionary &) |
template<> | |
tmp< scalarField > | residual () const |
template<> | |
tmp< volScalarField > | H () const |
template<> | |
tmp< volScalarField > | H1 () const |
Protected Member Functions | |
template<class Type2 > | |
void | addToInternalField (const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const |
Add patch contribution to internal field. More... | |
template<class Type2 > | |
void | addToInternalField (const labelUList &addr, const tmp< Field< Type2 >> &tpf, Field< Type2 > &intf) const |
template<class Type2 > | |
void | subtractFromInternalField (const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const |
Subtract patch contribution from internal field. More... | |
template<class Type2 > | |
void | subtractFromInternalField (const labelUList &addr, const tmp< Field< Type2 >> &tpf, Field< Type2 > &intf) const |
label | checkImplicit (const label fieldI=0) |
Name the implicit assembly addressing. More... | |
void | addBoundaryDiag (scalarField &diag, const direction cmpt) const |
void | addCmptAvBoundaryDiag (scalarField &diag) const |
void | addBoundarySource (Field< Type > &source, const bool couples=true) const |
template<template< class > class ListType> | |
void | setValuesFromList (const labelUList &cellLabels, const ListType< Type > &values) |
Set solution in given cells to the specified values. More... | |
Friends | |
class | fvSolver |
Declare friendship with the fvSolver class. More... | |
tmp< GeometricField< Type, fvPatchField, volMesh > > | operator& (const fvMatrix< Type > &, const DimensionedField< Type, volMesh > &) |
tmp< GeometricField< Type, fvPatchField, volMesh > > | operator& (const fvMatrix< Type > &, const tmp< GeometricField< Type, fvPatchField, volMesh >> &) |
tmp< GeometricField< Type, fvPatchField, volMesh > > | operator& (const tmp< fvMatrix< Type >> &, const DimensionedField< Type, volMesh > &) |
tmp< GeometricField< Type, fvPatchField, volMesh > > | operator& (const tmp< fvMatrix< Type >> &, const tmp< GeometricField< Type, fvPatchField, volMesh >> &) |
Ostream & | operator (Ostream &, const fvMatrix< Type > &) |
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition at line 68 of file fvPatchField.H.
typedef GeometricField<Type, fvPatchField, volMesh> psiFieldType |
Field type for psi.
Definition at line 130 of file fvMatrix.H.
typedef GeometricField<Type, fvsPatchField, surfaceMesh> faceFluxFieldType |
Field type for face flux (for non-orthogonal correction)
Definition at line 135 of file fvMatrix.H.
typedef GeometricField<Type, fvsPatchField, surfaceMesh>* faceFluxFieldPtrType |
Declare return type of the faceFluxCorrectionPtr() function.
Definition at line 485 of file fvMatrix.H.
fvMatrix | ( | const GeometricField< Type, fvPatchField, volMesh > & | psi, |
const dimensionSet & | ds | ||
) |
Construct given a field to solve for.
Definition at line 344 of file fvMatrix.C.
References DebugInFunction, Foam::endl(), forAll, psi, and Foam::Zero.
Copy construct.
Definition at line 396 of file fvMatrix.C.
References DebugInFunction, and Foam::endl().
Copy/move construct from tmp<fvMatrix<Type>>
Definition at line 425 of file fvMatrix.C.
References DebugInFunction, and Foam::endl().
fvMatrix | ( | const GeometricField< Type, fvPatchField, volMesh > & | psi, |
Istream & | is | ||
) |
Construct from Istream given field to solve for.
Definition at line 480 of file fvMatrix.C.
References DebugInFunction, Foam::endl(), forAll, psi, and Foam::Zero.
|
virtual |
Destructor.
Definition at line 538 of file fvMatrix.C.
References DebugInFunction, Foam::deleteDemandDrivenData(), and Foam::endl().
|
protected |
Add patch contribution to internal field.
Definition at line 49 of file fvMatrix.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, and UList< T >::size().
|
protected |
Definition at line 73 of file fvMatrix.C.
|
protected |
Subtract patch contribution from internal field.
Definition at line 87 of file fvMatrix.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, and UList< T >::size().
|
protected |
Definition at line 111 of file fvMatrix.C.
|
protected |
Name the implicit assembly addressing.
Definition at line 307 of file fvMatrix.C.
References Foam::expressions::patchExpr::debug, Foam::endl(), forAll, Foam::name(), Foam::Pout, and psi.
|
protected |
Definition at line 124 of file fvMatrix.C.
References Foam::component(), Foam::diag(), forAll, and psi.
Referenced by fvMatrix< Type >::residual().
|
protected |
Definition at line 152 of file fvMatrix.C.
References Foam::cmptAv(), Foam::diag(), forAll, and psi.
Definition at line 177 of file fvMatrix.C.
References Foam::cmptMultiply(), fvPatchField< Type >::coupled(), forAll, fvPatchField< Type >::patchNeighbourField(), and psi.
Referenced by fvMatrix< Type >::residual().
|
protected |
Set solution in given cells to the specified values.
Definition at line 227 of file fvMatrix.C.
References cells, Foam::diag(), forAll, Foam::stringOps::lower(), mesh, primitiveFieldRef(), psi, Foam::stringOps::upper(), Foam::HashTableOps::values(), and Foam::Zero.
ClassName | ( | "fvMatrix< Type >" | ) |
Foam::tmp< Foam::fvMatrix< Type > > clone | ( | ) | const |
Clone.
Definition at line 529 of file fvMatrix.C.
References Foam::New().
Referenced by fvMatrix< Type >::addFvMatrix().
|
inline |
Definition at line 326 of file fvMatrix.H.
|
inline |
Definition at line 331 of file fvMatrix.H.
Referenced by fvMatrix< Type >::psi().
|
inline |
Definition at line 336 of file fvMatrix.H.
|
inline |
Definition at line 342 of file fvMatrix.H.
References fvMatrix< Type >::lduMeshPtr(), and lduPrimitiveMeshAssembly::patchMap().
void transferFvMatrixCoeffs | ( | ) |
Transfer lower, upper, diag and source to this fvMatrix.
Definition at line 903 of file fvMatrix.C.
References Foam::diag(), Foam::faceMap(), forAll, Foam::stringOps::lower(), Foam::stringOps::upper(), and Foam::Zero.
void createOrUpdateLduPrimitiveAssembly | ( | ) |
Create or update ldu assembly.
Definition at line 996 of file fvMatrix.C.
References lduAddressing::clearOut(), Foam::endl(), Foam::Info, lduPrimitiveMesh::lduAddr(), IOobject::NO_READ, IOobject::NO_WRITE, psi, UPtrList< T >::set(), regIOobject::store(), and lduPrimitiveMeshAssembly::update().
Foam::lduPrimitiveMeshAssembly * lduMeshPtr | ( | ) |
Access to lduPrimitiveMeshAssembly.
Definition at line 970 of file fvMatrix.C.
References lduPrimitiveMesh::mesh(), and lduMesh::thisDb().
Referenced by fvMatrix< Type >::globalPatchID(), and fvMatrix< Type >::lduMeshAssembly().
const Foam::lduPrimitiveMeshAssembly * lduMeshPtr | ( | ) | const |
Const Access to lduPrimitiveMeshAssembly.
Definition at line 983 of file fvMatrix.C.
void manipulateMatrix | ( | direction | cmp | ) |
Manipulate matrix.
Definition at line 880 of file fvMatrix.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), forAll, and psi.
void setBounAndInterCoeffs | ( | ) |
Manipulate boundary/internal coeffs for coupling.
Definition at line 742 of file fvMatrix.C.
References boundary, GeometricField< Type, PatchField, GeoMesh >::boundaryField(), forAll, psi, Foam::BitOps::set(), List< T >::set(), and Foam::Zero.
void setInterfaces | ( | lduInterfaceFieldPtrsList & | interfaces, |
PtrDynList< lduInterfaceField > & | newInterfaces | ||
) |
Set interfaces.
Definition at line 552 of file fvMatrix.C.
References PtrDynList< T, SizeMin >::append(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), forAll, psi, UPtrList< T >::set(), and UPtrList< T >::setSize().
void mapContributions | ( | label | fieldi, |
const FieldField< Field, Type > & | fluxContrib, | ||
FieldField< Field, Type > & | contrib, | ||
bool | internal | ||
) | const |
Add internal and boundary contribution to local patches.
Definition at line 630 of file fvMatrix.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), lduPrimitiveMeshAssembly::cellBoundMap(), cellId, Foam::cmptMultiply(), faceId(), lduPrimitiveMeshAssembly::facePatchFaceMap(), forAll, polyPatch::masterImplicit(), polyPatch::neighbPolyPatchID(), lduPrimitiveMeshAssembly::patchLocalToGlobalMap(), lduPrimitiveMeshAssembly::patchMap(), and psi.
|
inline |
Return optional lduAdressing.
Definition at line 392 of file fvMatrix.H.
References fvMatrix< Type >::lduMeshPtr().
Referenced by mixedEnergyFvPatchScalarField::manipulateMatrix(), cyclicFvPatchField< vector >::manipulateMatrix(), cyclicAMIFvPatchField< scalar >::manipulateMatrix(), and cyclicACMIFvPatchField< Type >::manipulateMatrix().
|
inline |
Return psi.
Definition at line 399 of file fvMatrix.H.
References fvMatrix< Type >::matrix().
Referenced by MRFZone::addCoriolis(), velocityDampingConstraint::addDamping(), dynamicOversetFvMesh::addInterpolation(), solver::addOptimisationTypeSource(), multiphaseMangrovesSource::addSup(), radiation::addSup(), multiphaseMangrovesTurbulenceModel::addSup(), atmPlantCanopyUSource::addSup(), PhaseLimitStabilization< Type >::addSup(), radialActuationDiskSource::addSup(), explicitPorositySource::addSup(), interRegionExplicitPorositySource::addSup(), atmCoriolisUSource::addSup(), multiphaseStabilizedTurbulence::addSup(), acousticDampingSource::addSup(), SemiImplicitSource< Type >::addSup(), interRegionHeatTransferModel::addSup(), jouleHeatingSource::addSup(), solidificationMeltingSource::addSup(), rotorDiskSource::addSup(), Foam::checkMethod(), optionList::constrain(), cyclicFvPatchField< vector >::manipulateMatrix(), cyclicAMIFvPatchField< scalar >::manipulateMatrix(), cyclicACMIFvPatchField< Type >::manipulateMatrix(), MomentumTransferPhaseSystem< BasePhaseSystem >::momentumTransfer(), dynamicOversetFvMesh::normalisation(), fvMatrix< Type >::psi(), dynamicOversetFvMesh::solve(), and dynamicOversetFvMesh::write().
|
inline |
Definition at line 411 of file fvMatrix.H.
References fvMatrix< Type >::matrix(), and fvMatrix< Type >::psi().
|
inline |
Clear multiple fvMatrices.
Definition at line 433 of file fvMatrix.H.
References PtrList< T >::clear().
|
inline |
Definition at line 440 of file fvMatrix.H.
Referenced by fvMatrix< Type >::addFvMatrix(), explicitPorositySource::addSup(), interRegionExplicitPorositySource::addSup(), meanVelocityForce::addSup(), SemiImplicitSource< Type >::addSup(), directionalPressureGradientExplicitSource::addSup(), rotorDiskSource::addSup(), Foam::checkMethod(), and fvMatrix< Type >::operator*=().
|
inline |
Definition at line 445 of file fvMatrix.H.
Referenced by MRFZone::addCoriolis(), dynamicOversetFvMesh::addInterpolation(), radialActuationDiskSource::addSup(), interRegionExplicitPorositySource::addSup(), solidificationMeltingSource::addSup(), effectivenessHeatExchangerSource::addSup(), EulerD2dt2Scheme< Type >::fvmD2dt2(), EulerDdtScheme< Type >::fvmDdt(), CoEulerDdtScheme< Type >::fvmDdt(), SLTSDdtScheme< Type >::fvmDdt(), backwardDdtScheme< Type >::fvmDdt(), localEulerDdtScheme< Type >::fvmDdt(), CrankNicolsonDdtScheme< Type >::fvmDdt(), gaussLaplacianScheme< Type, GType >::fvmLaplacian(), relaxedNonOrthoGaussLaplacianScheme< Type, GType >::fvmLaplacian(), adjointOutletVelocityFluxFvPatchVectorField::manipulateMatrix(), mixedEnergyFvPatchScalarField::manipulateMatrix(), adjointWallVelocityFvPatchVectorField::manipulateMatrix(), ThermoCloud< Foam::DSMCCloud >::Sh(), ReactingCloud< Foam::DSMCCloud >::Srho(), KinematicCloud< Cloud< basicKinematicCollidingParcel > >::SU(), ReactingCloud< Foam::DSMCCloud >::SYi(), and dynamicOversetFvMesh::write().
|
inline |
Definition at line 450 of file fvMatrix.H.
|
inline |
fvBoundary scalar field containing pseudo-matrix coeffs for internal cells
Definition at line 457 of file fvMatrix.H.
Referenced by dynamicOversetFvMesh::addInterpolation(), gaussConvectionScheme< Type >::fvmDiv(), gaussLaplacianScheme< Type, GType >::fvmLaplacianUncorrected(), relaxedNonOrthoGaussLaplacianScheme< Type, GType >::fvmLaplacianUncorrected(), mixedEnergyFvPatchScalarField::manipulateMatrix(), cyclicFvPatchField< vector >::manipulateMatrix(), cyclicAMIFvPatchField< scalar >::manipulateMatrix(), cyclicACMIFvPatchField< Type >::manipulateMatrix(), dynamicOversetFvMesh::normalisation(), dynamicOversetFvMesh::solve(), and dynamicOversetFvMesh::write().
|
inline |
fvBoundary scalar field containing pseudo-matrix coeffs for internal cells
Definition at line 464 of file fvMatrix.H.
|
inline |
fvBoundary scalar field containing pseudo-matrix coeffs for boundary cells
Definition at line 471 of file fvMatrix.H.
Referenced by dynamicOversetFvMesh::addInterpolation(), gaussConvectionScheme< Type >::fvmDiv(), gaussLaplacianScheme< Type, GType >::fvmLaplacianUncorrected(), relaxedNonOrthoGaussLaplacianScheme< Type, GType >::fvmLaplacianUncorrected(), cyclicFvPatchField< vector >::manipulateMatrix(), cyclicAMIFvPatchField< scalar >::manipulateMatrix(), cyclicACMIFvPatchField< Type >::manipulateMatrix(), dynamicOversetFvMesh::solve(), and dynamicOversetFvMesh::write().
|
inline |
fvBoundary scalar field containing pseudo-matrix coeffs for boundary cells
Definition at line 478 of file fvMatrix.H.
|
inline |
Return pointer to face-flux non-orthogonal correction field.
Definition at line 488 of file fvMatrix.H.
Referenced by gaussLaplacianScheme< Type, GType >::fvmLaplacian(), and relaxedNonOrthoGaussLaplacianScheme< Type, GType >::fvmLaplacian().
|
inlinenoexcept |
True if face-flux non-orthogonal correction field exists.
Definition at line 494 of file fvMatrix.H.
References bool.
void setValues | ( | const labelUList & | cellLabels, |
const Type & | value | ||
) |
Set solution in given cells to the specified value and eliminate the corresponding equations from the matrix.
Definition at line 1059 of file fvMatrix.C.
Referenced by FixedValueConstraint< Type >::constrain(), fixedTemperatureConstraint::constrain(), fixedInternalValueFvPatchField< Type >::manipulateMatrix(), epsilonWallFunctionFvPatchScalarField::manipulateMatrix(), and omegaWallFunctionFvPatchScalarField::manipulateMatrix().
void setValues | ( | const labelUList & | cellLabels, |
const UList< Type > & | values | ||
) |
Set solution in given cells to the specified values and eliminate the corresponding equations from the matrix.
Definition at line 1070 of file fvMatrix.C.
References Foam::HashTableOps::values().
void setValues | ( | const labelUList & | cellLabels, |
const UIndirectList< Type > & | values | ||
) |
Set solution in given cells to the specified values and eliminate the corresponding equations from the matrix.
Definition at line 1081 of file fvMatrix.C.
References Foam::HashTableOps::values().
void setReference | ( | const label | celli, |
const Type & | value, | ||
const bool | forceReference = false |
||
) |
Set reference level for solution.
Definition at line 1092 of file fvMatrix.C.
References Foam::diag().
Referenced by Foam::CorrectPhi(), simple::mainIter(), and adjointSimple::mainIter().
void setReferences | ( | const labelUList & | cellLabels, |
const Type & | value, | ||
const bool | forceReference = false |
||
) |
Set reference level for solution.
Definition at line 1108 of file fvMatrix.C.
References cellId, Foam::diag(), and forAll.
void setReferences | ( | const labelUList & | cellLabels, |
const UList< Type > & | values, | ||
const bool | forceReference = false |
||
) |
Set reference level for solution.
Definition at line 1131 of file fvMatrix.C.
References cellId, Foam::diag(), forAll, and Foam::HashTableOps::values().
void setComponentReference | ( | const label | patchi, |
const label | facei, | ||
const direction | cmpt, | ||
const scalar | value | ||
) |
Set reference level for a component of the solution on a given patch face
Definition at line 38 of file fvMatrixSolve.C.
References Foam::diag().
void addFvMatrix | ( | fvMatrix< Type > & | matrix | ) |
Add fvMatrix.
Definition at line 1153 of file fvMatrix.C.
References Foam::abort(), fvMatrix< Type >::clone(), fvMatrix< Type >::dimensions(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.
void relax | ( | const scalar | alpha | ) |
Relax matrix (for steady-state solution).
alpha = 1 : diagonally equal alpha < 1 : diagonally dominant alpha = 0 : do nothing Note: Requires positive diagonal.
Definition at line 1183 of file fvMatrix.C.
References Foam::constant::atomic::alpha, Foam::cmptMag(), Foam::cmptMax(), Foam::cmptMin(), Foam::component(), fvPatchField< Type >::coupled(), D, Foam::expressions::patchExpr::debug, DebugInFunction, Foam::diag(), Foam::endl(), forAll, InfoInFunction, Foam::mag(), Foam::max(), UPstream::msgType(), Foam::nl, Foam::reduce(), Foam::returnReduce(), and Foam::Zero.
Referenced by jouleHeatingSource::addSup(), hydrostaticPressure::calculateAndWrite(), IATE::correct(), dynamicLagrangian< BasicTurbulenceModel >::correct(), thixotropicViscosity::correct(), kineticTheoryModel::correct(), kOmegaSSTBase< eddyViscosity< RASModel< BasicTurbulenceModel > > >::correct(), incompressiblePrimalSolver::correctBoundaryConditions(), waxSolventEvaporation::correctModel(), age::execute(), scalarTransport::execute(), electricPotential::execute(), energyTransport::execute(), simple::mainIter(), twoPhaseSystem::solve(), adjointEikonalSolver::solve(), populationBalanceModel::solve(), thermalBaffle::solveEnergy(), and thermalShell::solveEnergy().
void relax | ( | ) |
Relax matrix (for steady-state solution).
alpha is read from controlDict
Definition at line 1331 of file fvMatrix.C.
References Foam::name(), and relax().
void boundaryManipulate | ( | typename GeometricField< Type, fvPatchField, volMesh >::Boundary & | values | ) |
Manipulate based on a boundary field.
Definition at line 1348 of file fvMatrix.C.
References forAll.
Referenced by kOmegaSSTBase< eddyViscosity< RASModel< BasicTurbulenceModel > > >::correct(), adjointSimple::mainIter(), and adjointMeshMovementSolver::solve().
autoPtr<fvSolver> solver | ( | const dictionary & | ) |
Construct and return the solver.
Use the given solver controls
Foam::autoPtr< typename Foam::fvMatrix< Type >::fvSolver > solver | ( | ) |
Construct and return the solver.
Solver controls read from fvSolution
Definition at line 329 of file fvMatrixSolve.C.
Foam::SolverPerformance< Type > solveSegregatedOrCoupled | ( | const dictionary & | solverControls | ) |
Solve segregated or coupled returning the solution statistics.
Use the given solver controls
Definition at line 62 of file fvMatrixSolve.C.
References addProfiling, Foam::expressions::patchExpr::debug, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::getOrDefault(), Foam::Info, messageStream::masterStream(), mesh, regionName, and solve().
Referenced by velocityComponentLaplacianFvMotionSolver::solve(), velocityLaplacianFvMotionSolver::solve(), displacementComponentLaplacianFvMotionSolver::solve(), displacementSBRStressFvMotionSolver::solve(), solidBodyDisplacementLaplacianFvMotionSolver::solve(), displacementLaplacianFvMotionSolver::solve(), and fvMesh::solve().
Foam::SolverPerformance< Type > solveSegregated | ( | const dictionary & | solverControls | ) |
Solve segregated returning the solution statistics.
Use the given solver controls
Definition at line 112 of file fvMatrixSolve.C.
References Field< Type >::component(), Foam::expressions::patchExpr::debug, Foam::diag(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, dictionary::getOrDefault(), Foam::Info, messageStream::masterStream(), mesh, Foam::New(), SolverPerformance< Type >::print(), psi, refPtr< Container< Type > >::ref(), solve(), and SolverPerformance< Type >::solverName().
Foam::SolverPerformance< Type > solveCoupled | ( | const dictionary & | solverControls | ) |
Solve coupled returning the solution statistics.
Use the given solver controls
Definition at line 252 of file fvMatrixSolve.C.
References Foam::expressions::patchExpr::debug, Foam::diag(), LduMatrix< Type, DType, LUType >::diag(), Foam::endl(), dictionary::getOrDefault(), Foam::Info, Foam::stringOps::lower(), messageStream::masterStream(), mesh, SolverPerformance< Type >::print(), psi, and Foam::stringOps::upper().
Foam::SolverPerformance< Type > solve | ( | const dictionary & | solverControls | ) |
Solve returning the solution statistics.
Use the given solver controls
Definition at line 319 of file fvMatrixSolve.C.
Referenced by jouleHeatingSource::addSup(), Implicit< CloudType >::cacheFields(), hydrostaticPressure::calculateAndWrite(), dynamicLagrangian< BasicTurbulenceModel >::correct(), kineticTheoryModel::correct(), Foam::CorrectPhi(), age::execute(), scalarTransport::execute(), electricPotential::execute(), energyTransport::execute(), simple::mainIter(), adjointSimple::mainIter(), adjointMeshMovementSolver::solve(), laplacianMotionSolver::solve(), twoPhaseSystem::solve(), elasticityMotionSolver::solve(), adjointEikonalSolver::solve(), reactingOneDim::solveContinuity(), thermalBaffle::solveEnergy(), thermalShell::solveEnergy(), sensitivityBezierFI::solveMeshMovementEqn(), kinematicSingleLayer::solveThickness(), MultiComponentPhaseModel< BasePhaseModel, phaseThermo >::solveYi(), and Foam::fvc::spreadSource().
Foam::SolverPerformance< Type > solve | ( | ) |
Solve returning the solution statistics.
Solver controls read from fvSolution
Definition at line 343 of file fvMatrixSolve.C.
References fvMatrix< Type >::solverDict().
Foam::tmp< Foam::Field< Type > > residual | ( | ) | const |
Return the matrix residual.
Definition at line 350 of file fvMatrixSolve.C.
References fvMatrix< Type >::addBoundaryDiag(), fvMatrix< Type >::addBoundarySource(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), Field< Type >::component(), GeometricField< Type, PatchField, GeoMesh >::primitiveField(), tmp< T >::ref(), Field< Type >::replace(), lduMatrix::residual(), and Foam::Zero.
Foam::tmp< Foam::scalarField > D | ( | ) | const |
Return the matrix scalar diagonal.
Definition at line 1361 of file fvMatrix.C.
References Foam::diag(), and tmp< T >::ref().
Foam::tmp< Foam::Field< Type > > DD | ( | ) | const |
Return the matrix Type diagonal.
Definition at line 1370 of file fvMatrix.C.
References fvPatchField< Type >::coupled(), Foam::diag(), forAll, and tmp< T >::ref().
Foam::tmp< Foam::volScalarField > A | ( | ) | const |
Return the central coefficient.
Definition at line 1394 of file fvMatrix.C.
References GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), D, Foam::dimVol, IOobject::NO_READ, IOobject::NO_WRITE, GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), and tmp< T >::ref().
Referenced by meanVelocityForce::constrain(), directionalPressureGradientExplicitSource::constrain(), incompressiblePrimalSolver::correctBoundaryConditions(), and simple::mainIter().
Foam::tmp< Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > > H | ( | ) | const |
Return the H operation source.
Definition at line 1423 of file fvMatrix.C.
References GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), Foam::dimVol, lduMatrix::H(), IOobject::NO_READ, IOobject::NO_WRITE, GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), tmp< T >::ref(), Field< Type >::replace(), GeometricField< Type, PatchField, GeoMesh >::replace(), and Foam::Zero.
Referenced by incompressiblePrimalSolver::correctBoundaryConditions(), and simple::mainIter().
Foam::tmp< Foam::volScalarField > H1 | ( | ) | const |
Return H(1)
Definition at line 1485 of file fvMatrix.C.
References Foam::component(), fvPatchField< Type >::coupled(), Foam::dimVol, forAll, lduMatrix::H1(), IOobject::NO_READ, IOobject::NO_WRITE, and GeometricField< Type, PatchField, GeoMesh >::ref().
Referenced by simple::mainIter().
Foam::tmp< Foam::GeometricField< Type, Foam::fvsPatchField, Foam::surfaceMesh > > flux | ( | ) | const |
Return the face-flux field from the matrix.
Definition at line 1534 of file fvMatrix.C.
References Foam::abort(), GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), Foam::cmptMultiply(), lduMatrix::faceH(), Foam::FatalError, FatalErrorInFunction, forAll, IOobject::NO_READ, IOobject::NO_WRITE, GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), and tmp< T >::ref().
Referenced by Implicit< CloudType >::cacheFields(), incompressiblePrimalSolver::correctBoundaryConditions(), Foam::CorrectPhi(), scalarTransport::execute(), simple::mainIter(), adjointSimple::mainIter(), twoPhaseSystem::solve(), kinematicSingleLayer::solveThickness(), and MultiComponentPhaseModel< BasePhaseModel, phaseThermo >::solveYi().
const Foam::dictionary & solverDict | ( | ) | const |
Return the solver dictionary taking into account finalIteration.
Definition at line 1649 of file fvMatrix.C.
Referenced by velocityComponentLaplacianFvMotionSolver::solve(), velocityLaplacianFvMotionSolver::solve(), displacementComponentLaplacianFvMotionSolver::solve(), displacementSBRStressFvMotionSolver::solve(), solidBodyDisplacementLaplacianFvMotionSolver::solve(), displacementLaplacianFvMotionSolver::solve(), and fvMatrix< Type >::solve().
Definition at line 1665 of file fvMatrix.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and lduMatrix::operator=().
Definition at line 1702 of file fvMatrix.C.
void negate | ( | ) |
Definition at line 1710 of file fvMatrix.C.
References lduMatrix::negate().
Definition at line 1725 of file fvMatrix.C.
References Foam::checkMethod(), and lduMatrix::operator+=().
Definition at line 1755 of file fvMatrix.C.
Definition at line 1763 of file fvMatrix.C.
References Foam::checkMethod(), and lduMatrix::operator-=().
Definition at line 1791 of file fvMatrix.C.
void operator+= | ( | const DimensionedField< Type, volMesh > & | su | ) |
Definition at line 1800 of file fvMatrix.C.
References Foam::checkMethod().
void operator+= | ( | const tmp< DimensionedField< Type, volMesh >> & | tsu | ) |
Definition at line 1811 of file fvMatrix.C.
void operator+= | ( | const tmp< GeometricField< Type, fvPatchField, volMesh >> & | tsu | ) |
Definition at line 1822 of file fvMatrix.C.
void operator-= | ( | const DimensionedField< Type, volMesh > & | su | ) |
Definition at line 1833 of file fvMatrix.C.
References Foam::checkMethod().
void operator-= | ( | const tmp< DimensionedField< Type, volMesh >> & | tsu | ) |
Definition at line 1844 of file fvMatrix.C.
void operator-= | ( | const tmp< GeometricField< Type, fvPatchField, volMesh >> & | tsu | ) |
Definition at line 1855 of file fvMatrix.C.
void operator+= | ( | const dimensioned< Type > & | su | ) |
Definition at line 1866 of file fvMatrix.C.
References psi.
void operator-= | ( | const dimensioned< Type > & | su | ) |
Definition at line 1876 of file fvMatrix.C.
References psi.
Definition at line 1886 of file fvMatrix.C.
Definition at line 1894 of file fvMatrix.C.
void operator*= | ( | const volScalarField::Internal & | dsf | ) |
Definition at line 1902 of file fvMatrix.C.
References Foam::abort(), fvMatrix< Type >::dimensions(), Foam::FatalError, FatalErrorInFunction, forAll, and lduMatrix::operator*=().
void operator*= | ( | const tmp< volScalarField::Internal > & | tdsf | ) |
Definition at line 1932 of file fvMatrix.C.
void operator*= | ( | const tmp< volScalarField > & | tvsf | ) |
Definition at line 1943 of file fvMatrix.C.
void operator*= | ( | const dimensioned< scalar > & | ds | ) |
Definition at line 1954 of file fvMatrix.C.
References lduMatrix::operator*=().
void setComponentReference | ( | const label | patchi, |
const label | facei, | ||
const | direction, | ||
const scalar | value | ||
) |
Definition at line 41 of file fvScalarMatrix.C.
References Foam::diag().
Foam::autoPtr< Foam::fvMatrix< Foam::scalar >::fvSolver > solver | ( | const dictionary & | solverControls | ) |
Definition at line 66 of file fvScalarMatrix.C.
References addProfiling, Foam::expressions::patchExpr::debug, Foam::diag(), Foam::endl(), Foam::Info, messageStream::masterStream(), mesh, Foam::New(), regionName, and solve().
Foam::solverPerformance solveSegregated | ( | const dictionary & | solverControls | ) |
Definition at line 166 of file fvScalarMatrix.C.
References GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), Foam::expressions::patchExpr::debug, Foam::diag(), Foam::endl(), forAll, dictionary::getOrDefault(), Foam::Info, Foam::stringOps::lower(), messageStream::masterStream(), mesh, Foam::name(), Foam::New(), primitiveFieldRef(), SolverPerformance< Type >::print(), psi, tmp< T >::ref(), Foam::stringOps::upper(), and Foam::Zero.
Foam::tmp< Foam::scalarField > residual | ( | ) | const |
Definition at line 328 of file fvScalarMatrix.C.
References psi, refPtr< Container< Type > >::ref(), and Foam::Zero.
Foam::tmp< Foam::volScalarField > H | ( | ) | const |
Definition at line 357 of file fvScalarMatrix.C.
References GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), Foam::dimVol, H(), GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), and tmp< T >::ref().
Foam::tmp< Foam::volScalarField > H1 | ( | ) | const |
Definition at line 389 of file fvScalarMatrix.C.
References Foam::dimVol, and GeometricField< Type, PatchField, GeoMesh >::ref().
void setComponentReference | ( | const label | patchi, |
const label | facei, | ||
const | direction, | ||
const scalar | value | ||
) |
autoPtr< fvMatrix< scalar >::fvSolver > solver | ( | const dictionary & | ) |
solverPerformance solveSegregated | ( | const dictionary & | ) |
tmp< scalarField > residual | ( | ) | const |
tmp< volScalarField > H | ( | ) | const |
tmp< volScalarField > H1 | ( | ) | const |
|
friend |
Declare friendship with the fvSolver class.
Definition at line 178 of file fvMatrix.H.
|
friend |
|
friend |
|
friend |
|
friend |