45 void Foam::fv::volumeSource::readCoeffs(
const dictionary&
dict)
50 :
dict.lookupOrDefault<word>
58 volumetricFlowRate_.reset
63 mesh().time().userUnits(),
72 void Foam::fv::volumeSource::addSupType
74 const VolField<Type>& field,
79 <<
"field=" << field.name()
80 <<
", eqnField=" << eqn.psi().name() <<
endl;
98 addSupType(
null,
null, field, eqn);
103 void Foam::fv::volumeSource::addSupType
106 fvMatrix<scalar>& eqn
110 <<
"alphaOrField=" << alphaOrField.name()
111 <<
", eqnField=" << eqn.psi().name() <<
endl;
114 if (phaseName() !=
word::null && alphaOrField.name() == alphaName_)
121 addSupType<scalar>(alphaOrField, eqn);
127 void Foam::fv::volumeSource::addSupType
130 const VolField<Type>& field,
135 <<
"alphaOrRho=" << alphaOrRho.name()
136 <<
", field=" << field.name()
137 <<
", eqnField=" << eqn.psi().name() <<
endl;
141 if (phaseName() !=
word::null && alphaOrRho.name() == alphaName_)
156 fvMatrix<Type> volEqn(eqn.psi(), eqn.dimensions()/
dimDensity);
169 mesh().lookupObject<IOdictionary>
173 physicalProperties::typeName,
184 addSupType(
null, alphaOrRho, field, eqn);
190 void Foam::fv::volumeSource::addSupType
194 const VolField<Type>& field,
201 <<
", field=" << field.name()
202 <<
", eqnField=" << eqn.psi().name() <<
endl;
205 <<
"Cannot add a volume source for field " << field.name()
206 <<
" to equation for " << eqn.psi().name() <<
" because this field's "
207 <<
"equation was not recognised as being in volume-conservative form"
217 const word& modelType,
225 volumetricFlowRate_()
235 return setPtr_->zone();
251 volumetricFlowRate_->value(
mesh().time().value())
259 <<
"eqnField=" << eqn.
psi().name() <<
endl;
279 bool Foam::
fv::volumeSource::movePoints()
281 setPtr_->movePoints();
288 setPtr_->topoChange(map);
294 setPtr_->mapMesh(map);
300 setPtr_->distribute(map);
308 readCoeffs(coeffs(
dict));
Macros for easy insertion into run-time selection tables.
static autoPtr< Function1< scalar > > New(const word &name, const Function1s::unitConversions &units, const dictionary &dict)
Select from dictionary.
static word groupName(Name name, const word &group)
Named list of cell indices representing a sub-set of the mesh.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
cellZone selection or generation class with caching of zone volume
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
Finite volume model abstract base class.
static const dictionary & coeffs(const word &modelType, const dictionary &)
Return the coefficients sub-dictionary for a given model type.
const fvMesh & mesh() const
Return const access to the mesh database.
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.
This fvModel applies a volume source to the continuity equation and to all field equations....
virtual const cellZone & zone() const
Return the cellZone that the source applies to.
virtual scalar V() const
Return the volume of cells that the source applies to.
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 read(const dictionary &dict)
Read source dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
volumeSource(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.
virtual dimensionedScalar S() const
Return the source value.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
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.
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimTime
const dimensionSet dimDensity
const dimensionSet dimVolume
VolField< scalar > volScalarField
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
bool isNull(const T &t)
Return true if t is a reference to the nullObject of type T.
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.