45 void Foam::fv::volumeSource::readCoeffs()
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_->cells();
241 return setPtr_->nCells();
257 volumetricFlowRate_->value(mesh().time().value())
265 <<
"eqnField=" << eqn.
psi().name() <<
endl;
285 bool Foam::
fv::volumeSource::movePoints()
287 setPtr_->movePoints();
294 setPtr_->topoChange(map);
300 setPtr_->mapMesh(map);
306 setPtr_->distribute(map);
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)
A list of keyword definitions, which are a keyword followed by any number of values (e....
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T, if not found return the given default.
General run-time selected cell set selection class for fvMesh.
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.
const dictionary & coeffs() const
Return dictionary.
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 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 labelUList cells() const
Return the cells that the source applies to.
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 label nCells() const
Return the number of cells that the source applies to.
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.
#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)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimTime
const dimensionSet dimDensity
const dimensionSet dimVolume
VolField< scalar > volScalarField
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.