Go to the documentation of this file.
38 template<
class BasePhaseSystem>
46 this->generatePairsAndSubModels(
"massTransferModel", massTransferModels_);
50 if (!dmdt_.found(iterModel()->pair()))
59 IOobject::groupName(
"dmdt",iterModel()->pair().
name()),
76 template<
class BasePhaseSystem>
101 if (massTransferModels_.found(keyik))
104 massTransferModels_[keyik];
108 const word species(speciesName.substr(0, speciesName.find(
'.')));
110 L -=
neg(dmdtNetki)*interfacePtr->
L(species,
T);
113 if (massTransferModels_.found(keyki))
116 massTransferModels_[keyki];
120 const word species(speciesName.substr(0, speciesName.find(
'.')));
122 L +=
pos(dmdtNetki)*interfacePtr->
L(species,
T);
131 template<
class BasePhaseSystem>
149 auto& dmdt = tdmdt.ref();
151 if (dmdt_.found(
key))
160 template<
class BasePhaseSystem>
168 auto& eqn = teqn.ref();
176 for (++iterk; iterk != this->phaseModels_.end(); ++iterk)
178 if (iteri()().
name() != iterk()().
name())
200 auto& dmdtNetki = tdmdtNetki.
ref();
213 auto& Sp = tSp.ref();
226 auto& Su = tSu.ref();
229 if (massTransferModels_.found(keyik))
232 massTransferModels_[keyik];
234 dmdtNetki -= *dmdt_[keyik];
260 if (massTransferModels_.found(keyki))
263 massTransferModels_[keyki];
265 dmdtNetki += *dmdt_[keyki];
302 template<
class BasePhaseSystem>
310 auto& eqn = teqn.ref();
323 auto& Sp = tSp.ref();
336 auto& Su = tSu.ref();
352 if (massTransferModels_.found(key12))
355 massTransferModels_[key12];
358 interfacePtr->
KSp(interfaceCompositionModel::P,
p);
365 - this->coeffs(
phase1.name())
366 + this->coeffs(
phase2.name())
371 interfacePtr->
KSu(interfaceCompositionModel::P,
p);
378 - this->coeffs(
phase1.name())
379 + this->coeffs(
phase2.name())
389 - this->coeffs(
phase1.name())
390 + this->coeffs(
phase2.name())
402 if (massTransferModels_.found(key21))
405 massTransferModels_[key21];
408 interfacePtr->
KSp(interfaceCompositionModel::P,
p);
415 - this->coeffs(
phase1.name())
416 + this->coeffs(
phase2.name())
421 interfacePtr->
KSu(interfaceCompositionModel::P,
p);
428 - this->coeffs(
phase1.name())
429 + this->coeffs(
phase2.name())
439 - this->coeffs(
phase1.name())
440 + this->coeffs(
phase2.name())
452 template<
class BasePhaseSystem>
464 for (++iterk; iterk != this->phaseModels_.end(); ++iterk)
466 if (iteri()().
name() != iterk()().
name())
476 if (massTransferModels_.found(keyik))
479 massTransferModels_[keyik];
483 *dmdt_[keyik] = Kexp.
ref();
487 if (massTransferModels_.found(keyki))
490 massTransferModels_[keyki];
495 *dmdt_[keyki] = Kexp.
ref();
503 template<
class BasePhaseSystem>
512 bool includeDivU(
true);
541 if (massTransferModels_.found(key12))
544 massTransferModels_[key12];
569 if (massTransferModels_.found(key21))
572 massTransferModels_[key21];
585 volScalarField::Internal& SpPhase1 =
Sp[
phase1.name()];
587 volScalarField::Internal& SuPhase1 =
Su[
phase1.name()];
589 volScalarField::Internal& SpPhase2 =
Sp[
phase2.name()];
591 volScalarField::Internal& SuPhase2 =
Su[
phase2.name()];
615 scalar dmdt21 = dmdtNet[celli];
616 scalar coeffs12Cell = coeffs12[celli];
618 scalar alpha1Limited =
max(
min(
alpha1[celli], 1.0), 0.0);
621 SuPhase1[celli] += coeffs1[celli]*dmdt21;
627 if (coeffs12Cell > 0)
630 SpPhase1[celli] -= dmdt21*coeffs12Cell;
632 else if (coeffs12Cell < 0)
636 dmdt21*coeffs12Cell*alpha1Limited;
641 if (coeffs12Cell > 0)
645 dmdt21*coeffs12Cell*alpha1Limited;
647 else if (coeffs12Cell < 0)
650 SpPhase1[celli] -= dmdt21*coeffs12Cell;
658 scalar dmdt12 = -dmdtNet[celli];
659 scalar coeffs21Cell = -coeffs12[celli];
661 scalar alpha2Limited =
max(
min(
alpha2[celli], 1.0), 0.0);
664 SuPhase2[celli] += coeffs2[celli]*dmdt12;
670 if (coeffs21Cell > 0)
673 SpPhase2[celli] -= dmdt12*coeffs21Cell;
675 else if (coeffs21Cell < 0)
679 dmdt12*coeffs21Cell*alpha2Limited;
684 if (coeffs21Cell > 0)
688 coeffs21Cell*dmdt12*alpha2Limited;
690 else if (coeffs21Cell < 0)
693 SpPhase2[celli] -= dmdt12*coeffs21Cell;
702 max(
gMax((dmdt21*coeffs1)()),
gMax((dmdt12*coeffs2)()));
707 template<
class BasePhaseSystem>
711 volScalarField::Internal&
Su,
712 volScalarField::Internal&
Sp,
713 const word speciesName
719 if (iter()->transferSpecie() == speciesName)
730 template<
class BasePhaseSystem>
733 bool includeVolChange(
true);
736 if (!iter()->includeVolChange())
738 includeVolChange =
false;
741 return includeVolChange;
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
const dimensionSet dimPressure
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const vector L(dict.get< vector >("L"))
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
virtual tmp< volScalarField > Kexp(const volScalarField &field)=0
Explicit full mass transfer.
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.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimEnergy
const dimensionSet dimDensity
const volScalarField & alpha2
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
tmp< volScalarField > calculateL(const volScalarField &dmdtNetki, const phasePairKey &keyik, const phasePairKey &keyki, const volScalarField &T) const
Calculate L between phases.
virtual tmp< fvScalarMatrix > volTransfer(const volScalarField &p)
Return the volumetric rate transfer matrix.
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
MassTransferPhaseSystem(const fvMesh &)
Construct from fvMesh.
Calculate the divergence of the given field.
const volScalarField & alpha1
const word transferSpecie() const
Return the transferring species name.
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
#define forAll(list, i)
Loop across all elements in list.
virtual void massSpeciesTransfer(const phaseModel &phase, volScalarField::Internal &Su, volScalarField::Internal &Sp, const word speciesName)
Calculate mass transfer for species.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
virtual tmp< volScalarField > L(const word &speciesName, const volScalarField &Tf) const =0
Latent heat (delta Hc)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
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 bool includeDivU() const noexcept
#define forAllIters(container, iter)
Iterate across all elements in the container object.
virtual tmp< volScalarField > KSu(label modelVariable, const volScalarField &field)=0
Explicit mass transfer.
Mesh data needed to do the Finite Volume discretisation.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
virtual tmp< volScalarField > KSp(label modelVariable, const volScalarField &field)=0
Implicit mass transfer.
virtual tmp< fvScalarMatrix > heatTransfer(const volScalarField &T)
Return the heat transfer matrix.
Calculate the matrix for implicit and explicit sources.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
const word & name() const
forAllConstIters(mixture.phases(), phase)
Internal & ref(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
Fundamental dimensioned constants.
virtual bool includeVolChange()
Add volume change in pEq.
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 void correctMassSources(const volScalarField &T)
Correct/calculates mass sources dmdt for phases.
tmp< volScalarField > dmdt(const phasePairKey &key) const
Return total interfacial mass flow rate.
bool valid() const noexcept
Identical to good(), or bool operator.
const dimensionSet dimVolume(pow3(dimLength))
const phaseModel & phase1() const
dimensionedScalar neg(const dimensionedScalar &ds)
Type gMax(const FieldField< Field, Type > &f)
virtual void alphaTransfer(SuSpTable &Su, SuSpTable &Sp)
Calculate mass transfer for alpha's.
const dimensionSet dimless
Dimensionless.
dimensionedScalar pos(const dimensionedScalar &ds)