30#include "interfaceCompositionModel.H"
35template<
class BasePhaseSystem>
47 this->phases()[key.second()]
56 if (interfaceCompositionModels_.found(pair))
63 : interfaceCompositionModels_[pair]->species()
69 *(*iDmdtSu_[pair])[member]
70 + *(*iDmdtSp_[pair])[member]*
phase.Y(member)
82template<
class BasePhaseSystem>
89 BasePhaseSystem(
mesh),
92 this->template getOrDefault<label>(
"nInterfaceCorrectors", 1)
95 this->generatePairsAndSubModels
97 "interfaceComposition",
101 this->generatePairsAndSubModels
113 interfaceCompositionModelIter
117 this->phasePairs_[interfaceCompositionModelIter.key()];
124 <<
"An interfacial composition model is specified for the "
125 <<
"unordered " << pair <<
" pair. Composition models only "
126 <<
"apply to ordered pairs. An entry for a "
127 <<
phasePairKey(
"A",
"B",
true) <<
" pair means a model for "
128 <<
"the A side of the A-B interface; i.e., \"A in the presence "
136 if (!this->phasePairs_.found(key))
139 <<
"A mass transfer model the " << key <<
" pair is not "
140 <<
"specified. This is required by the corresponding interface "
141 <<
"composition model."
145 const phasePair& uoPair = this->phasePairs_[key];
150 <<
"A mass transfer model for the " << pair.
phase1().
name()
151 <<
" side of the " << uoPair <<
" pair is not "
152 <<
"specified. This is required by the corresponding interface "
153 <<
"composition model."
161 massTransferModelIter
165 this->phasePairs_[massTransferModelIter.key()];
167 if (!this->heatTransferModels_.found(pair))
170 <<
"A heat transfer model for " << pair <<
" pair is not "
171 <<
"specified. This is required by the corresponding species "
182 interfaceCompositionModelIter
186 interfaceCompositionModelIter();
189 this->phasePairs_[interfaceCompositionModelIter.key()];
194 for (
const word& member : compositionModel.species())
204 this->mesh().time().timeName(),
220 this->mesh().time().timeName(),
234template<
class BasePhaseSystem>
242template<
class BasePhaseSystem>
249 return BasePhaseSystem::dmdt(key) + this->iDmdt(key);
253template<
class BasePhaseSystem>
262 interfaceCompositionModels_,
263 interfaceCompositionModelIter
267 interfaceCompositionModelIter();
270 this->phasePairs_[interfaceCompositionModelIter.key()];
274 for (
const word& member : compositionModel.species())
278 *(*iDmdtSu_[pair])[member]
279 + *(*iDmdtSp_[pair])[member]*
phase.Y(member)
282 this->addField(
phase,
"dmdt", iDmdt, dmdts);
283 this->addField(otherPhase,
"dmdt", - iDmdt, dmdts);
291template<
class BasePhaseSystem>
297 BasePhaseSystem::massTransfer();
305 interfaceCompositionModels_,
306 interfaceCompositionModelIter
310 interfaceCompositionModelIter();
313 this->phasePairs_[interfaceCompositionModelIter.key()];
323 massTransferModels_[unorderedPair][unorderedPair.
index(
phase)]->K()
329 : compositionModel.species()
342 *(*iDmdtSu_[pair])[member] =
phase.
rho()*KD*Yf;
343 *(*iDmdtSp_[pair])[member] = -
phase.
rho()*KD;
347 *(*iDmdtSu_[pair])[member]
353 *(*iDmdtSu_[pair])[member]
354 + *(*iDmdtSp_[pair])[member]*
phase.Y(member)
361 if (eqns.
found(otherName))
363 *eqns[otherName] -= iDmdt;
372template<
class BasePhaseSystem>
390 typename BasePhaseSystem::heatTransferModelTable,
391 this->heatTransferModels_,
392 heatTransferModelIter
396 this->phasePairs_[heatTransferModelIter.key()];
407 for (label i = 0; i < nInterfaceCorrectors_; ++ i)
433 if (this->interfaceCompositionModels_.found(key12))
435 this->interfaceCompositionModels_[key12]->addMDotL
437 massTransferModels_[pair].first()->
K(),
443 if (this->interfaceCompositionModels_.found(key21))
445 this->interfaceCompositionModels_[key21]->addMDotL
447 massTransferModels_[pair].second()->
K(),
463 max(H1 + H2 + mDotLPrime, HSmall)
475 if (this->interfaceCompositionModels_.found(key12))
477 this->interfaceCompositionModels_[key12]->update(Tf);
479 if (this->interfaceCompositionModels_.found(key21))
481 this->interfaceCompositionModels_[key21]->update(Tf);
488template<
class BasePhaseSystem>
491 if (BasePhaseSystem::read())
CGAL::Exact_predicates_exact_constructions_kernel K
tmp< volScalarField > dmdt() const
Return the blended mass transfer rate.
const dimensionSet & dimensions() const
Return dimensions.
T & first() noexcept
The first element of the list, position [0].
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
void correctBoundaryConditions()
Correct boundary field.
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
bool set(const Key &key, T *ptr)
Assign a new entry, overwriting existing entries.
bool found(const Key &key) const
Return true if hashed entry is found in table.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
Class to provide interfacial heat and mass transfer between a number of phases according to a interfa...
interfaceCompositionModelTable interfaceCompositionModels_
Interface composition models.
virtual void correctInterfaceThermo()
Correct the interface temperatures.
iDmdtSuSpTable iDmdtSp_
The implicit part of the interfacial mass transfer rates.
virtual autoPtr< phaseSystem::massTransferTable > massTransfer() const
Return the mass transfer matrices.
virtual tmp< volScalarField > iDmdt(const phasePairKey &key) const
Return the interfacial mass transfer rate for a pair for a pair.
virtual PtrList< volScalarField > dmdts() const
Return the mass transfer rates for each phase.
iDmdtSuSpTable iDmdtSu_
The explicit part of the interfacial mass transfer rates.
massTransferModelTable massTransferModels_
Mass transfer models.
virtual ~InterfaceCompositionPhaseChangePhaseSystem()
Destructor.
virtual bool read()
Read base phaseProperties dictionary.
An ordered pair of two objects of type <T> with first() and second() elements.
const T & second() const noexcept
Return second element, which is also the last element.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
virtual const volScalarField & T() const
Temperature [K].
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 dimensionSet dimK
Coefficient dimensions.
virtual tmp< volScalarField > Yf(const word &speciesName, const volScalarField &Tf) const =0
Interface mass fraction.
const word & name() const
The name of this phase.
virtual const rhoThermo & thermo() const =0
Access const to phase thermo.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
const phaseModel & otherPhase() const
Return the other phase in this two-phase system.
const word & name() const
An ordered or unorder pair of phase names. Typically specified as follows.
bool ordered() const noexcept
Return the ordered flag.
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
virtual word name() const
Pair name.
label index(const phaseModel &phase) const
Return the index of the given phase. Generates a FatalError if.
const multiphaseInter::phaseModel & phase1() const
const multiphaseInter::phaseModel & phase2() const
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
const word & name() const
const dimensionedScalar & rho() const
Return const-access to phase1 density.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimEnergy
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
const dimensionSet dimVolume(pow3(dimLength))
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
const dimensionSet dimDensity
errorManipArg< error, int > exit(error &err, const int errNo=1)
multiphaseSystem::phaseModelList & phases
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.