30 #include "interfaceCompositionModel.H" 35 template<
class BasePhaseSystem>
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",
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." 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(),
234 template<
class BasePhaseSystem>
242 template<
class BasePhaseSystem>
249 return BasePhaseSystem::dmdt(
key) + this->iDmdt(
key);
253 template<
class BasePhaseSystem>
261 interfaceCompositionModelTable,
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>
304 interfaceCompositionModelTable,
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;
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 & first() const noexcept
Access the first element.
const phaseModel & otherPhase() const
Return the other phase in this two-phase system.
virtual const rhoThermo & thermo() const =0
Access const to phase thermo.
multiphaseSystem::phaseModelList & phases
const dimensionedScalar & rho() const
Return const-access to phase1 density.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
const multiphaseInter::phaseModel & phase2() const
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
InterfaceCompositionPhaseChangePhaseSystem(const fvMesh &)
Construct from fvMesh.
const multiphaseInter::phaseModel & phase1() const
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
virtual autoPtr< phaseSystem::massTransferTable > massTransfer() const
Return the mass transfer matrices.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
phaseSystem::massTransferTable & massTransfer(massTransferPtr())
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual const volScalarField & T() const
Temperature [K].
const word & name() const
The name of this phase.
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers...
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.
virtual void correctInterfaceThermo()
Correct the interface temperatures.
CGAL::Exact_predicates_exact_constructions_kernel K
static const dimensionSet dimK
Coefficient dimensions.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
label index(const phaseModel &phase) const
Return the index of the given phase. Generates a FatalError if.
virtual tmp< volScalarField > Yf(const word &speciesName, const volScalarField &Tf) const =0
Interface mass fraction.
const dimensionSet dimVolume(pow3(dimLength))
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
An ordered pair of two objects of type <T> with first() and second() elements.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
massTransferModelTable massTransferModels_
Mass transfer models.
bool set(const Key &key, T *ptr)
Assign a new entry, overwrites existing.
virtual PtrList< volScalarField > dmdts() const
Return the mass transfer rates for each phase.
iDmdtSuSpTable iDmdtSu_
The explicit part of the interfacial mass transfer rates.
virtual tmp< volScalarField > dmdt(const phasePairKey &key) const
Return the mass transfer rate for a pair.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
An ordered or unorder pair of phase names. Typically specified as follows.
virtual word name() const
Pair name.
bool ordered() const noexcept
Return the ordered flag.
const dimensionSet & dimensions() const noexcept
Return dimensions.
const dimensionSet dimEnergy
const dimensionSet dimDensity
constexpr auto key(const Type &t) noexcept
Helper function to return the enum value.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual bool read()
Read base phaseProperties dictionary.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Mesh data needed to do the Finite Volume discretisation.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
void correctBoundaryConditions()
Correct boundary field.
const word & name() const
messageStream Info
Information stream (stdout output on master, null elsewhere)
iDmdtSuSpTable iDmdtSp_
The implicit part of the interfacial mass transfer rates.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
virtual ~InterfaceCompositionPhaseChangePhaseSystem()
Destructor.
A class for managing temporary objects.
const T & second() const noexcept
Access the second element.
Defines the attributes of an object for which implicit objectRegistry management is supported...
interfaceCompositionModelTable interfaceCompositionModels_
Interface composition models.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
virtual tmp< volScalarField > iDmdt(const phasePairKey &key) const
Return the interfacial mass transfer rate for a pair for a pair.
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
const word & name() const