52 Foam::fv::zeroDimensionalFixedPressureModel::constraint()
const
58 if (isA<zeroDimensionalFixedPressureConstraint>(constraints[i]))
60 return refCast<const zeroDimensionalFixedPressureConstraint>
68 <<
"The " << typeName <<
" fvModel requires a corresponding "
69 << zeroDimensionalFixedPressureConstraint::typeName <<
" fvConstraint"
72 return NullObjectRef<zeroDimensionalFixedPressureConstraint>();
77 void Foam::fv::zeroDimensionalFixedPressureModel::addSupType
79 const VolField<Type>& field,
84 <<
"Cannot add a fixed pressure source for field " << field.name()
85 <<
" to equation for " << eqn.psi().name() <<
" because this field's "
86 <<
"equation was not recognised as being in mass-conservative form"
91 void Foam::fv::zeroDimensionalFixedPressureModel::addSupType
101 eqn += constraint().pEqnSource(
rho, eqn);
105 eqn += constraint().massSource(
rho());
112 addSupType<scalar>(
rho, eqn);
118 void Foam::fv::zeroDimensionalFixedPressureModel::addSupType
121 const VolField<Type>& field,
125 if (&field != &eqn.psi())
128 <<
"Cannot add a fixed pressure source of field " << field.name()
129 <<
" into an equation for field " << eqn.psi().name()
133 eqn -=
fvm::SuSp(-constraint().massSource(
rho()), eqn.psi());
137 void Foam::fv::zeroDimensionalFixedPressureModel::addSupType
141 fvMatrix<scalar>& eqn
148 eqn +=
alpha()*constraint().pEqnSource(
rho, eqn);
152 eqn += constraint().massSource(
alpha(),
rho());
159 addSupType<scalar>(
alpha,
rho, eqn);
165 void Foam::fv::zeroDimensionalFixedPressureModel::addSupType
169 const VolField<Type>& field,
173 if (&field != &eqn.psi())
176 <<
"Cannot add a fixed pressure source of field " << field.name()
177 <<
" into an equation for field " << eqn.psi().name()
190 const word& modelType,
200 <<
"Zero-dimensional fvModel applied to a "
218 const word& fieldName
228 fv::zeroDimensionalFixedPressureModel
235 fv::zeroDimensionalFixedPressureModel
242 fv::zeroDimensionalFixedPressureModel
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
word member() const
Return member (name without the extension)
A list of keyword definitions, which are a keyword followed by any number of values (e....
static autoPtr< dictionary > New(Istream &)
Construct top-level dictionary on freestore from Istream.
Mesh data needed to do the Finite Volume discretisation.
Finite volume model abstract base class.
const fvMesh & mesh() const
Return const access to the mesh database.
Zero-dimensional fixed pressure constraint. Should be used in conjunction with the zeroDimensionalFix...
Zero-dimensional fixed pressure source. Should be used in conjunction with the zeroDimensionalFixedPr...
zeroDimensionalFixedPressureModel(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from dictionary.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool movePoints()
Add a source term to an equation.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual bool addsSupToField(const word &fieldName) const
Return true if the fvModel adds a source term to the given.
virtual ~zeroDimensionalFixedPressureModel()
Destructor.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
label nGeometricD() const
Return the number of valid geometric dimensions in the mesh.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Foam::fvConstraints & fvConstraints(Foam::fvConstraints::New(mesh))
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define IMPLEMENT_FV_MODEL_ADD_FIELD_SUP(Type, modelType)
#define IMPLEMENT_FV_MODEL_ADD_ALPHA_RHO_FIELD_SUP(Type, modelType)
#define IMPLEMENT_FV_MODEL_ADD_RHO_FIELD_SUP(Type, modelType)
Calculate the matrix for implicit and explicit sources.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
tmp< fvMatrix< Type > > SuSp(const volScalarField::Internal &, const VolField< Type > &)
errorManipArg< error, int > exit(error &err, const int errNo=1)
word name(const bool)
Return a word representation of a bool.
VolField< scalar > volScalarField
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)