43 void Foam::fv::massSourceBase::readCoeffs(
const dictionary&
dict)
46 dict.lookupOrDefault<word>
55 void Foam::fv::massSourceBase::addSupType
57 const VolField<Type>& field,
62 <<
"field=" << field.name()
63 <<
", eqnField=" << eqn.psi().name() <<
endl;
66 <<
"Cannot add a mass source for field " << field.name()
67 <<
" to equation for " << eqn.psi().name() <<
" because this field's "
68 <<
"equation was not recognised as being in mass-conservative form"
73 void Foam::fv::massSourceBase::addSupType
80 <<
"rhoOrField=" << rhoOrField.name()
81 <<
", eqnField=" << eqn.psi().name() <<
endl;
84 if (phaseName() ==
word::null && rhoOrField.name() == rhoName_)
91 addSupType<scalar>(rhoOrField, eqn);
97 void Foam::fv::massSourceBase::addSupType
100 const VolField<Type>& field,
105 <<
"rho=" <<
rho.name()
106 <<
", field=" << field.name()
107 <<
", eqnField=" << eqn.psi().name() <<
endl;
128 addSupType<Type>(field, eqn);
133 void Foam::fv::massSourceBase::addSupType
137 fvMatrix<scalar>& eqn
141 <<
"alphaOrRho=" << alphaOrRho.name()
142 <<
", rhoOrField=" << rhoOrField.name()
143 <<
", eqnField=" << eqn.psi().name() <<
endl;
146 if (rhoOrField.name() == rhoName_)
153 addSupType<scalar>(alphaOrRho, rhoOrField, eqn);
159 void Foam::fv::massSourceBase::addSupType
163 const VolField<Type>& field,
168 <<
"alpha=" <<
alpha.name()
169 <<
", rho=" <<
rho.name()
170 <<
", field=" << field.name()
171 <<
", eqnField=" << eqn.psi().name() <<
endl;
183 const word& modelType,
200 <<
"eqnField=" << eqn.
psi().name() <<
endl;
203 <<
"Field-less mass sources are not possible"
225 readCoeffs(coeffs(
dict));
Macros for easy insertion into run-time selection tables.
static word groupName(Name name, const word &group)
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
static const dictionary & coeffs(const word &modelType, const dictionary &)
Return the coefficients sub-dictionary for a given model type.
Base class for sources which are specified as a total value (e.g., volume or mass flow rate),...
void addSupType(const VolField< Type > &field, fvMatrix< Type > &eqn) const
Add a source term to an equation.
const word & phaseName() const
Return the phase name.
virtual bool read(const dictionary &dict)
Read source dictionary.
void addSource(fvMatrix< scalar > &eqn) const
Add a source term to a field-less proxy equation.
Base class for mass source models.
virtual bool read(const dictionary &dict)
Read source dictionary.
massSourceBase(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
virtual void addSup(fvMatrix< scalar > &eqn) const
Add a source term to a field-less proxy equation.
A class for handling words, derived from string.
static const word null
An empty word.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
#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)
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
#define DebugInFunction
Report an information message using Foam::Info.
defineTypeNameAndDebug(bound, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimDensity
VolField< scalar > volScalarField
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)