Go to the documentation of this file.
30 #include "interfaceCompositionModel.H"
35 template<
class BasePhaseSystem>
46 this->
phases()[key.first()],
56 if (interfaceCompositionModels_.found(pair))
63 : interfaceCompositionModels_[pair]->species()
69 *(*iDmdtSu_[pair])[member]
70 + *(*iDmdtSp_[pair])[member]*
phase.Y(member)
82 template<
class BasePhaseSystem>
89 BasePhaseSystem(
mesh),
92 this->
template getOrDefault<label>(
"nInterfaceCorrectors", 1)
95 this->generatePairsAndSubModels
97 "interfaceComposition",
98 interfaceCompositionModels_
101 this->generatePairsAndSubModels
112 interfaceCompositionModels_,
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."
147 if (!massTransferModels_[uoPair][uoPair.
index(
phase)])
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 "
181 interfaceCompositionModels_,
182 interfaceCompositionModelIter
186 interfaceCompositionModelIter();
189 this->phasePairs_[interfaceCompositionModelIter.key()];
194 for (
const word& member : compositionModel.
species())
203 IOobject::groupName(
"iDmdtSu", pair.
name()),
204 this->
mesh().time().timeName(),
219 IOobject::groupName(
"iDmdtSp", pair.
name()),
220 this->
mesh().time().timeName(),
234 template<
class BasePhaseSystem>
242 template<
class BasePhaseSystem>
249 return BasePhaseSystem::dmdt(
key) + this->iDmdt(
key);
253 template<
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);
291 template<
class BasePhaseSystem>
305 interfaceCompositionModels_,
306 interfaceCompositionModelIter
310 interfaceCompositionModelIter();
313 this->phasePairs_[interfaceCompositionModelIter.key()];
323 massTransferModels_[unorderedPair][unorderedPair.index(
phase)]->K()
335 IOobject::groupName(member, otherPhase.
name())
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;
372 template<
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);
488 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.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
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
Access const to phase thermo.
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 models. Mass transfer models are interface models between two thermo...
CGAL::Exact_predicates_exact_constructions_kernel K
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
bool ordered() const noexcept
Return the ordered flag.
phaseSystem::massTransferTable & massTransfer(massTransferPtr())
tmp< GeometricField< Type, faPatchField, areaMesh > > average(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Area-weighted average a edgeField creating a areaField.
messageStream Info
Information stream (stdout output on master, null elsewhere)
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....
An ordered or unorder pair of phase names. Typically specified as follows.
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.
const hashedWordList & species() const
The transferring species names.
Mesh data needed to do the Finite Volume discretisation.
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
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>, with deallocation management of the pointers.
virtual tmp< volScalarField > Yf(const word &speciesName, const volScalarField &Tf) const =0
Interface mass fraction.
const phaseModel & otherPhase() const
Return the other phase in this two-phase system.
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
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
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))
const phaseModel & phase1() const
multiphaseSystem::phaseModelList & phases
const dimensionedScalar & rho() const
Return const-access to phase1 density.