52 void Foam::Lagrangian::constantFluxCarrierTransfer::readCoeffs
54 const dictionary& modelDict
57 const bool haveVolumeFlux = modelDict.found(
"volumeFlux");
58 const bool haveMassFlux = modelDict.found(
"massFlux");
60 if (haveVolumeFlux == haveMassFlux)
63 <<
"keywords volumeFlux and massFlux are both "
64 << (haveVolumeFlux ?
"" :
"un" ) <<
"defined in "
65 <<
"dictionary " << modelDict.name()
69 flux_.
read(modelDict);
71 if (flux_.
value() < 0)
74 << flux_.
name() <<
" must be positive"
81 Foam::Lagrangian::constantFluxCarrierTransfer::Sp
83 const LagrangianSubMesh& subMesh
86 tmp<LagrangianSubScalarField> tSByV =
87 cloud<clouds::shaped>().aByV(subMesh)*flux_;
93 clouds::coupledToConstantDensityFluid,
97 if (isCloud<clouds::coupledToConstantDensityFluid>())
101 /cloud<clouds::coupledToConstantDensityFluid>().rho();
107 /cloud<clouds::massive>().rho(subMesh);
117 void Foam::Lagrangian::constantFluxCarrierTransfer::addSupType
121 LagrangianEqn<scalar>& eqn
124 const LagrangianSubMesh& subMesh = deltaT.mesh();
125 const SubList<LagrangianState> subStates = subMesh.sub(
mesh().states());
132 if (sumDeltaTSp_.valid()) sumDeltaTSp_.ref() += deltaT*
Sp;
140 tmp<LagrangianSubScalarField>
Su =
Sp*vOrM;
147 Su.ref()[subi] *= 1 + 1/
max(sumDeltaTSp_()[subi], small);
158 void Foam::Lagrangian::constantFluxCarrierTransfer::addSupType
161 const LagrangianSubSubField<Type>& field,
162 LagrangianEqn<Type>& eqn
166 <<
"The Lagrangian model '" <<
name() <<
"' of cloud '"
167 <<
mesh().
name() <<
"' cannot add a transfer for the field '"
168 << field.name() <<
"' because the equation is not volume or "
174 void Foam::Lagrangian::constantFluxCarrierTransfer::addSupType
178 const LagrangianSubSubField<Type>& field,
179 LagrangianEqn<Type>& eqn
182 const LagrangianSubMesh& subMesh = deltaT.mesh();
183 const SubList<LagrangianState> subStates = subMesh.sub(
mesh().states());
187 if (eqn.isPsi(field))
195 tmp<LagrangianSubField<Type>>
Su =
Sp*vOrM*field;
202 Su.ref()[subi] *= 1 + 1/
max(sumDeltaTSp_()[subi], small);
226 modelDict.
found(
"volumeFlux")
228 : modelDict.
found(
"massFlux")
234 readCoeffs(modelDict);
244 isCloud<clouds::massive>()
252 const word& fieldName,
253 const word& eqnFieldName
259 const bool isCarrierEqn = eqnMember[eqnMember.size() - 1] ==
'c';
298 if (isCloud<clouds::coupledToConstantDensityFluid>())
313 if (tlifetime()[subi] < deltaT[subi])
324 const word& fieldName,
332 isCloud<clouds::massive>()
372 Lagrangian::constantFluxCarrierTransfer
379 Lagrangian::constantFluxCarrierTransfer
389 if (
final) sumDeltaTSp_.clear();
400 readCoeffs(modelDict);
#define IMPLEMENT_LAGRANGIAN_MODEL_ADD_FIELD_SUP(Type, modelType)
#define IMPLEMENT_LAGRANGIAN_MODEL_ADD_V_OR_M_FIELD_SUP(Type, modelType)
#define forAll(list, i)
Loop across all elements in list.
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...
const GeoMesh & mesh() const
Return mesh.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
word group() const
Return group (extension part of name)
word member() const
Return member (name without the extension)
Class containing Lagrangian geometry and topology.
Base class for Lagrangian models.
virtual bool read(const dictionary &modelDict)
Read dictionary.
Base class for Lagrangian sources. Minimal wrapper over LagrangianModel that provides an interface to...
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
word sub(const word &fieldName) const
Return the name of a field corresponding to this sub-mesh.
Model to represent mass transfer into the carrier phase with a constant surface volume or mass flux....
virtual wordList addSupFields() const
Return the name of the volume or mass field.
virtual bool addsSupToField(const word &fieldName, const word &eqnFieldName) const
Return true if this is a Lagrangian field or a field of the.
virtual tmp< LagrangianSubScalarField > source(const word &fieldName, const LagrangianSubMesh &subMesh) const
Return the source value.
virtual bool read(const dictionary &modelDict)
Read dictionary.
virtual void preAddSup(const LagrangianSubScalarField &deltaT, const bool final)
Hook before source evaluation.
virtual void postAddSup(const LagrangianSubScalarField &deltaT, const bool final)
Add a source term to an equation.
virtual void calculate(const LagrangianSubScalarField &deltaT, const bool final)
Update the transfer rate and remove any consumed particles.
constantFluxCarrierTransfer(const word &name, const LagrangianMesh &mesh, const dictionary &modelDict, const dictionary &stateDict)
Construct from components.
A List obtained as a section of another List.
Mix-in for Lagrangian models that refer to a cloud.
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
Base class for clouds which are coupled to a constant density fluid.
Base class for clouds with particles with mass.
static const word mName
Name of mass fields.
static const word vName
Name of volume fields.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
void read(const dictionary &, const unitSet &defaultUnits=NullObjectRef< unitSet >())
Update the value of dimensioned<Type>
const Type & value() const
Return const reference to value.
const word & name() const
Return const reference to name.
const word & name() const
Return reference to name.
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.
defineTypeNameAndDebug(collisionPhaseTransfer, 0)
addToRunTimeSelectionTable(LagrangianModel, collisionPhaseTransfer, dictionary)
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
tmp< VolField< Type > > Sp(const volScalarField &sp, const VolField< Type > &vf)
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
const dimensionSet & dimless
const dimensionSet & dimMass
FOR_ALL_FIELD_TYPES(makeDimensionedPointFieldFunctions)
const dimensionSet & dimVolume
const dimensionSet & dimTime
void cbrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
LagrangianSubSubField< scalar > LagrangianSubScalarSubField
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
LagrangianSubField< scalar > LagrangianSubScalarField
const dimensionSet & dimArea
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.