Go to the documentation of this file.
29 #include "interfaceCompositionModel.H"
35 template<
class BasePhaseSystem>
46 this->
phases()[key.first()],
56 if (interfaceCompositionModels_.found(pair))
63 interfaceCompositionModels_[pair]->species(),
67 const word& member = *memberIter;
72 IOobject::groupName(member, otherPhase.
name())
78 *(*iDmdtSu_[pair])[member]
79 + *(*iDmdtSp_[pair])[member]*
phase.Y(member)
92 template<
class BasePhaseSystem>
99 BasePhaseSystem(
mesh),
100 nInterfaceCorrectors_
102 this->
template lookupOrDefault<label>(
"nInterfaceCorrectors", 1)
105 this->generatePairsAndSubModels
107 "interfaceComposition",
108 interfaceCompositionModels_
111 this->generatePairsAndSubModels
122 interfaceCompositionModels_,
123 interfaceCompositionModelIter
127 this->phasePairs_[interfaceCompositionModelIter.key()];
134 <<
"An interfacial composition model is specified for the "
135 <<
"unordered " << pair <<
" pair. Composition models only "
136 <<
"apply to ordered pairs. An entry for a "
137 <<
phasePairKey(
"A",
"B",
true) <<
" pair means a model for "
138 <<
"the A side of the A-B interface; i.e., \"A in the presence "
146 if (!this->phasePairs_.found(key))
149 <<
"A mass transfer model the " << key <<
" pair is not "
150 <<
"specified. This is required by the corresponding interface "
151 <<
"composition model."
155 const phasePair& uoPair = this->phasePairs_[key];
157 if (!massTransferModels_[uoPair][uoPair.
index(
phase)].valid())
160 <<
"A mass transfer model for the " << pair.
phase1().
name()
161 <<
" side of the " << uoPair <<
" pair is not "
162 <<
"specified. This is required by the corresponding interface "
163 <<
"composition model."
171 massTransferModelIter
175 this->phasePairs_[massTransferModelIter.key()];
177 if (!this->heatTransferModels_.found(pair))
180 <<
"A heat transfer model for " << pair <<
" pair is not "
181 <<
"specified. This is required by the corresponding species "
191 interfaceCompositionModels_,
192 interfaceCompositionModelIter
196 interfaceCompositionModelIter();
199 this->phasePairs_[interfaceCompositionModelIter.key()];
206 const word& member = *memberIter;
215 IOobject::groupName(
"iDmdtSu", pair.
name()),
216 this->
mesh().time().timeName(),
231 IOobject::groupName(
"iDmdtSp", pair.
name()),
232 this->
mesh().time().timeName(),
246 template<
class BasePhaseSystem>
254 template<
class BasePhaseSystem>
261 return BasePhaseSystem::dmdt(key) + this->iDmdt(key);
265 template<
class BasePhaseSystem>
274 interfaceCompositionModels_,
275 interfaceCompositionModelIter
279 interfaceCompositionModelIter();
282 this->phasePairs_[interfaceCompositionModelIter.key()];
288 const word& member = *memberIter;
293 IOobject::groupName(member, otherPhase.
name())
298 *(*iDmdtSu_[pair])[member]
299 + *(*iDmdtSp_[pair])[member]*
phase.Y(member)
302 this->addField(
phase,
"dmdt", iDmdt, dmdts);
303 this->addField(otherPhase,
"dmdt", - iDmdt, dmdts);
311 template<
class BasePhaseSystem>
325 interfaceCompositionModels_,
326 interfaceCompositionModelIter
330 interfaceCompositionModelIter();
333 this->phasePairs_[interfaceCompositionModelIter.key()];
343 massTransferModels_[unorderedPair][unorderedPair.index(
phase)]->K()
348 const word& member = *memberIter;
353 IOobject::groupName(member, otherPhase.
name())
360 *(*iDmdtSu_[pair])[member] =
phase.
rho()*KD*Yf;
361 *(*iDmdtSp_[pair])[member] = -
phase.
rho()*KD;
365 *(*iDmdtSu_[pair])[member]
371 *(*iDmdtSu_[pair])[member]
372 + *(*iDmdtSp_[pair])[member]*
phase.Y(member)
379 if (eqns.found(otherName))
381 *eqns[otherName] -= iDmdt;
390 template<
class BasePhaseSystem>
408 typename BasePhaseSystem::heatTransferModelTable,
409 this->heatTransferModels_,
410 heatTransferModelIter
414 this->phasePairs_[heatTransferModelIter.key()];
425 for (
label i = 0; i < nInterfaceCorrectors_; ++ i)
451 if (this->interfaceCompositionModels_.found(key12))
453 this->interfaceCompositionModels_[key12]->addMDotL
455 massTransferModels_[pair].first()->
K(),
461 if (this->interfaceCompositionModels_.found(key21))
463 this->interfaceCompositionModels_[key21]->addMDotL
465 massTransferModels_[pair].second()->
K(),
481 max(H1 + H2 + mDotLPrime, HSmall)
493 if (this->interfaceCompositionModels_.found(key12))
495 this->interfaceCompositionModels_[key12]->update(Tf);
497 if (this->interfaceCompositionModels_.found(key21))
499 this->interfaceCompositionModels_[key21]->update(Tf);
506 template<
class BasePhaseSystem>
const T & second() const noexcept
Return second element, which is also the last element.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
virtual bool read()
Read base phaseProperties dictionary.
A class for handling words, derived from Foam::string.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
A class for managing temporary objects.
const dimensionSet dimEnergy
const dimensionSet dimDensity
virtual tmp< volScalarField > D(const word &speciesName) const =0
Mass diffusivity.
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
const phaseModel & otherPhase() const
Return the other phase in this two-phase system.
label index(const phaseModel &phase) const
Return the index of the given phase. Generates a FatalError if.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual const rhoThermo & thermo() const =0
Return the thermophysical model.
virtual void correctInterfaceThermo()
Correct the interface temperatures.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.
Generic base class for interface composition models. These models describe the composition in phase 1...
const hashedWordList & species() const
Return the transferring species names.
CGAL::Exact_predicates_exact_constructions_kernel K
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tmp< GeometricField< Type, faPatchField, areaMesh > > average(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Area-weighted average a edgeField creating a areaField.
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
virtual tmp< volScalarField > dmdt(const phasePairKey &key) const
Return the mass transfer rate for a pair.
Mesh data needed to do the Finite Volume discretisation.
bool ordered() const
Return the ordered flag.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const word & name() const
InterfaceCompositionPhaseChangePhaseSystem(const fvMesh &)
Construct from fvMesh.
void correctBoundaryConditions()
Correct boundary field.
const word & name() const
Return the name of this phase.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
virtual PtrList< volScalarField > dmdts() const
Return the mass transfer rates for each phase.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
An ordered pair of two objects of type <T> with first() and second() elements.
virtual const volScalarField & T() const
Temperature [K].
A HashTable of pointers to objects of type <T>.
virtual tmp< volScalarField > Yf(const word &speciesName, const volScalarField &Tf) const =0
Interface mass fraction.
multiphaseSystem::phaseModelList & phases
virtual word name() const
Pair name.
virtual ~InterfaceCompositionPhaseChangePhaseSystem()
Destructor.
virtual autoPtr< phaseSystem::massTransferTable > massTransfer() const
Return the mass transfer matrices.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const phaseModel & phase2() const
Return phase 2.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
virtual tmp< volScalarField > iDmdt(const phasePairKey &key) const
Return the interfacial mass transfer rate for a pair for a pair.
const dimensionSet dimVolume(pow3(dimLength))
phaseSystem::massTransferTable & massTransfer(massTransferPtr())
const phaseModel & phase1() const
Return phase 1.
const dimensionedScalar & rho() const
Return const-access to phase1 density.