40 template<
class BasePhaseSystem>
78 template<
class BasePhaseSystem>
103 if (massTransferModels_.found(keyik))
106 massTransferModels_[keyik];
110 const word species(speciesName.substr(0, speciesName.find(
'.')));
112 L -=
neg(dmdtNetki)*interfacePtr->
L(species,
T);
115 if (massTransferModels_.found(keyki))
118 massTransferModels_[keyki];
122 const word species(speciesName.substr(0, speciesName.find(
'.')));
124 L -=
pos(dmdtNetki)*interfacePtr->
L(species,
T);
133 template<
class BasePhaseSystem>
151 auto& dmdt = tdmdt.ref();
153 if (dmdt_.found(
key))
162 template<
class BasePhaseSystem>
170 auto& eqn = teqn.ref();
178 for (++iterk; iterk != this->phaseModels_.end(); ++iterk)
180 if (iteri()().
name() != iterk()().
name())
202 auto& dmdtNetki = tdmdtNetki.
ref();
215 auto& Sp = tSp.ref();
228 auto& Su = tSu.ref();
231 if (massTransferModels_.found(keyik))
234 massTransferModels_[keyik];
236 dmdtNetki -= *dmdt_[keyik];
262 if (massTransferModels_.found(keyki))
265 massTransferModels_[keyki];
267 dmdtNetki += *dmdt_[keyki];
304 template<
class BasePhaseSystem>
312 auto& eqn = teqn.ref();
325 auto& Sp = tSp.ref();
338 auto& Su = tSu.ref();
354 if (massTransferModels_.found(key12))
357 massTransferModels_[key12];
404 if (massTransferModels_.found(key21))
407 massTransferModels_[key21];
454 template<
class BasePhaseSystem>
466 for (++iterk; iterk != this->phaseModels_.end(); ++iterk)
468 if (iteri()().
name() != iterk()().
name())
478 if (massTransferModels_.found(keyik))
481 massTransferModels_[keyik];
485 *dmdt_[keyik] = Kexp.
ref();
489 if (massTransferModels_.found(keyki))
492 massTransferModels_[keyki];
497 *dmdt_[keyki] = Kexp.
ref();
505 template<
class BasePhaseSystem>
514 bool includeDivU(
true);
518 const phasePair& pair = iter()();
526 tmp<volScalarField> tCoeffs1 = this->coeffs(
phase1.
name());
529 tmp<volScalarField> tCoeffs2 = this->coeffs(
phase2.
name());
533 const phasePairKey key12
540 tmp<volScalarField> tdmdt12(this->dmdt(key12));
543 if (massTransferModels_.found(key12))
545 autoPtr<interfaceCompositionModel>& interfacePtr =
546 massTransferModels_[key12];
548 tmp<volScalarField> KSu =
556 includeDivU = interfacePtr->includeDivU();
561 const phasePairKey key21
568 tmp<volScalarField> tdmdt21(this->dmdt(key21));
571 if (massTransferModels_.found(key21))
573 autoPtr<interfaceCompositionModel>& interfacePtr =
574 massTransferModels_[key21];
576 tmp<volScalarField> KSu =
584 includeDivU = interfacePtr->includeDivU();
614 scalar dmdt21 = dmdtNet[celli];
615 scalar coeffs12Cell = coeffs12[celli];
617 scalar alpha1Limited =
clamp(
alpha1[celli], zero_one{});
620 SuPhase1[celli] += coeffs1[celli]*dmdt21;
626 if (coeffs12Cell > 0)
629 SpPhase1[celli] -= dmdt21*coeffs12Cell;
631 else if (coeffs12Cell < 0)
635 dmdt21*coeffs12Cell*alpha1Limited;
640 if (coeffs12Cell > 0)
644 dmdt21*coeffs12Cell*alpha1Limited;
646 else if (coeffs12Cell < 0)
649 SpPhase1[celli] -= dmdt21*coeffs12Cell;
657 scalar dmdt12 = -dmdtNet[celli];
658 scalar coeffs21Cell = -coeffs12[celli];
660 scalar alpha2Limited =
clamp(
alpha2[celli], zero_one{});
663 SuPhase2[celli] += coeffs2[celli]*dmdt12;
669 if (coeffs21Cell > 0)
672 SpPhase2[celli] -= dmdt12*coeffs21Cell;
674 else if (coeffs21Cell < 0)
678 dmdt12*coeffs21Cell*alpha2Limited;
683 if (coeffs21Cell > 0)
687 coeffs21Cell*dmdt12*alpha2Limited;
689 else if (coeffs21Cell < 0)
692 SpPhase2[celli] -= dmdt12*coeffs21Cell;
706 template<
class BasePhaseSystem>
712 const word speciesName
718 if (iter()->transferSpecie() == speciesName)
729 template<
class BasePhaseSystem>
732 bool includeVolChange(
true);
735 if (!iter()->includeVolChange())
737 includeVolChange =
false;
740 return includeVolChange;
bool valid() const noexcept
Identical to good(), or bool operator.
virtual bool includeVolChange()
Add volume change in pEq.
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
const multiphaseInter::phaseModel & phase2() const
const vector L(dict.get< vector >("L"))
virtual tmp< volScalarField > KSp(label modelVariable, const volScalarField &field)=0
Implicit mass transfer.
bool found(const Key &key) const
Same as contains()
const multiphaseInter::phaseModel & phase1() const
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
virtual tmp< fvScalarMatrix > heatTransfer(const volScalarField &T)
Return the heat transfer matrix.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
dmdtTable dmdt_
Overall inter-phase mass transfer rates [Kg/s].
virtual tmp< volScalarField > KSu(label modelVariable, const volScalarField &field)=0
Explicit mass transfer.
const word & name() const
The name of this phase.
const volScalarField & alpha2
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
tmp< volScalarField > dmdt(const phasePairKey &key) const
Return total interfacial mass flow rate.
dimensionedScalar neg(const dimensionedScalar &ds)
Fundamental dimensioned constants.
virtual void correctMassSources(const volScalarField &T)
Correct/calculates mass sources dmdt for phases.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar pos(const dimensionedScalar &ds)
const dimensionSet dimVolume(pow3(dimLength))
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
const word transferSpecie() const
Return the transferring species name.
virtual tmp< fvScalarMatrix > volTransfer(const volScalarField &p)
Return the volumetric rate transfer matrix.
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)
bool set(const Key &key, T *ptr)
Assign a new entry, overwrites existing.
virtual tmp< volScalarField > Kexp(const volScalarField &field)=0
Explicit full mass transfer.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
const dimensionSet dimPressure
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
Calculate the divergence of the given field.
An ordered or unorder pair of phase names. Typically specified as follows.
Type gMax(const FieldField< Field, Type > &f)
MassTransferPhaseSystem(const fvMesh &)
Construct from fvMesh.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const dimensionSet dimEnergy
const dimensionSet dimDensity
virtual void alphaTransfer(SuSpTable &Su, SuSpTable &Sp)
Calculate mass transfer for alpha's.
virtual void massSpeciesTransfer(const Foam::phaseModel &phase, volScalarField::Internal &Su, volScalarField::Internal &Sp, const word speciesName)
Calculate mass transfer for species.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Mesh data needed to do the Finite Volume discretisation.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Automatically write from objectRegistry::writeObject()
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...
const word & name() const
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef()
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
virtual tmp< volScalarField > L(const word &speciesName, const volScalarField &Tf) const =0
Latent heat (delta Hc)
tmp< volScalarField > calculateL(const volScalarField &dmdtNetki, const phasePairKey &keyik, const phasePairKey &keyki, const volScalarField &T) const
Calculate L between phases.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Calculate the finiteVolume matrix for implicit and explicit sources.
forAllConstIters(mixture.phases(), phase)
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
massTransferModelTable massTransferModels_
Mass transfer models.
static constexpr const zero Zero
Global zero (0)
const volScalarField & alpha1