44 void Foam::fv::massTransfer::readCoeffs(
const dictionary&
dict)
54 <<
"Cannot change the phases of a " << typeName <<
" model "
97 if (
mesh().foundObject<volScalarField::Internal>(rhoNames()[i]))
103 const word physicalPropertiesName =
106 if (
mesh().foundObject<IOdictionary>(physicalPropertiesName))
125 <<
"Could not determine the density " << rhoNames()[i]
126 <<
" for phase " << phaseNames()[i]
139 <<
"alphaOrField=" << alphaOrField.
name()
140 <<
", eqnField=" << eqn.
psi().name() <<
endl;
142 const label i = index(alphaNames(), alphaOrField.
name());
147 eqn +=
S(alphaOrField.
name())/
rho(i);
152 addSupType<scalar>(alphaOrField, eqn);
165 <<
"alphaOrRho=" << alphaOrRho.
name()
166 <<
", rhoOrField=" << rhoOrField.
name()
167 <<
", eqnField=" << eqn.
psi().name() <<
endl;
172 index(alphaNames(), alphaOrRho.
name()) != -1
173 && index(rhoNames(), rhoOrField.
name()) != -1
176 eqn +=
S(alphaOrRho.
name());
181 addSupType<scalar>(alphaOrRho, rhoOrField, eqn);
191 const word& modelType,
197 phaseNames_(lookupPhaseNames(
dict)),
198 alphaNames_(lookupPhaseFieldNames(
dict,
"alpha")),
199 rhoNames_(lookupPhaseFieldNames(
dict,
"rho"))
213 ||
group == phaseNames_.first()
214 ||
group == phaseNames_.second();
228 <<
"eqnField=" << eqn.
psi().name() <<
endl;
231 <<
"Field-less mass transfers are not possible"
253 readCoeffs(coeffs(
dict));
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static tmp< DimensionedField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Mesh &mesh, const dimensionSet &, const PrimitiveField< Type > &)
Return a temporary field constructed from name, mesh,.
Generic GeometricField class.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
word group() const
Return group (extension part of name)
const word & name() const
Return name.
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.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
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.
virtual bool read(const dictionary &dict)
Read source dictionary.
Base class for sources which are specified as a specific value (e.g., mass flow rate per unit volume)...
Base class for mass transfers between phases.
void addSupType(const VolField< Type > &field, fvMatrix< Type > &eqn) const
Add a source term to an equation.
const Pair< word > lookupPhaseNames(const dictionary &dict) const
Lookup the phase names.
virtual bool read(const dictionary &dict)
Read source dictionary.
tmp< volScalarField::Internal > rho(const label i) const
Return the density.
massTransfer(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
const Pair< word > lookupPhaseFieldNames(const dictionary &dict, const word &name) const
Lookup the phase field names.
virtual void addSup(fvMatrix< scalar > &eqn) const
Add a source term to a field-less proxy equation.
virtual bool addsSupToField(const word &fieldName) const
Return true if the fvModel adds a source term to the given.
virtual tmp< DimensionedField< scalar, volMesh > > S(const word &fieldName) const
Return the source value.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type and name.
A base class for physical properties.
A class for managing temporary objects.
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 FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#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)
#define DebugInFunction
Report an information message using Foam::Info.
const char *const group
Group name for atomic constants.
defineTypeNameAndDebug(bound, 0)
tmp< fvMatrix< Type > > S(const Pair< tmp< volScalarField::Internal >> &, const VolField< Type > &)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionedScalar sign(const dimensionedScalar &ds)
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.
const dimensionSet dimDensity
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.