40 template<
class BasePhaseSystem>
79 template<
class BasePhaseSystem>
98 if (massTransferModels_.found(keyik))
101 massTransferModels_[keyik];
105 const word species(speciesName.substr(0, speciesName.find(
'.')));
107 L -=
neg(dmdtNetki)*interfacePtr->
L(species,
T);
110 if (massTransferModels_.found(keyki))
113 massTransferModels_[keyki];
117 const word species(speciesName.substr(0, speciesName.find(
'.')));
119 L -=
pos(dmdtNetki)*interfacePtr->
L(species,
T);
128 template<
class BasePhaseSystem>
142 auto& dmdt = tdmdt.ref();
144 if (dmdt_.found(
key))
153 template<
class BasePhaseSystem>
161 auto& eqn = teqn.ref();
169 for (++iterk; iterk != this->phaseModels_.end(); ++iterk)
171 if (iteri()().
name() != iterk()().
name())
189 auto& dmdtNetki = tdmdtNetki.
ref();
198 auto& Sp = tSp.ref();
207 auto& Su = tSu.ref();
210 if (massTransferModels_.found(keyik))
213 massTransferModels_[keyik];
215 dmdtNetki -= *dmdt_[keyik];
241 if (massTransferModels_.found(keyki))
244 massTransferModels_[keyki];
246 dmdtNetki += *dmdt_[keyki];
283 template<
class BasePhaseSystem>
291 auto& eqn = teqn.ref();
300 auto& Sp = tSp.ref();
309 auto& Su = tSu.ref();
325 if (massTransferModels_.found(key12))
328 massTransferModels_[key12];
375 if (massTransferModels_.found(key21))
378 massTransferModels_[key21];
425 template<
class BasePhaseSystem>
437 for (++iterk; iterk != this->phaseModels_.end(); ++iterk)
439 if (iteri()().
name() != iterk()().
name())
449 if (massTransferModels_.found(keyik))
452 massTransferModels_[keyik];
456 *dmdt_[keyik] = Kexp.
ref();
460 if (massTransferModels_.found(keyki))
463 massTransferModels_[keyki];
468 *dmdt_[keyki] = Kexp.
ref();
476 template<
class BasePhaseSystem>
485 bool includeDivU(
true);
489 const phasePair& pair = iter()();
497 tmp<volScalarField> tCoeffs1 = this->coeffs(
phase1.
name());
500 tmp<volScalarField> tCoeffs2 = this->coeffs(
phase2.
name());
504 const phasePairKey key12
511 tmp<volScalarField> tdmdt12(this->dmdt(key12));
514 if (massTransferModels_.found(key12))
516 autoPtr<interfaceCompositionModel>& interfacePtr =
517 massTransferModels_[key12];
519 tmp<volScalarField> KSu =
527 includeDivU = interfacePtr->includeDivU();
532 const phasePairKey key21
539 tmp<volScalarField> tdmdt21(this->dmdt(key21));
542 if (massTransferModels_.found(key21))
544 autoPtr<interfaceCompositionModel>& interfacePtr =
545 massTransferModels_[key21];
547 tmp<volScalarField> KSu =
555 includeDivU = interfacePtr->includeDivU();
585 scalar dmdt21 = dmdtNet[celli];
586 scalar coeffs12Cell = coeffs12[celli];
588 scalar alpha1Limited =
clamp(
alpha1[celli], zero_one{});
591 SuPhase1[celli] += coeffs1[celli]*dmdt21;
597 if (coeffs12Cell > 0)
600 SpPhase1[celli] -= dmdt21*coeffs12Cell;
602 else if (coeffs12Cell < 0)
606 dmdt21*coeffs12Cell*alpha1Limited;
611 if (coeffs12Cell > 0)
615 dmdt21*coeffs12Cell*alpha1Limited;
617 else if (coeffs12Cell < 0)
620 SpPhase1[celli] -= dmdt21*coeffs12Cell;
628 scalar dmdt12 = -dmdtNet[celli];
629 scalar coeffs21Cell = -coeffs12[celli];
631 scalar alpha2Limited =
clamp(
alpha2[celli], zero_one{});
634 SuPhase2[celli] += coeffs2[celli]*dmdt12;
640 if (coeffs21Cell > 0)
643 SpPhase2[celli] -= dmdt12*coeffs21Cell;
645 else if (coeffs21Cell < 0)
649 dmdt12*coeffs21Cell*alpha2Limited;
654 if (coeffs21Cell > 0)
658 coeffs21Cell*dmdt12*alpha2Limited;
660 else if (coeffs21Cell < 0)
663 SpPhase2[celli] -= dmdt12*coeffs21Cell;
677 template<
class BasePhaseSystem>
683 const word speciesName
689 if (iter()->transferSpecie() == speciesName)
700 template<
class BasePhaseSystem>
703 bool includeVolChange(
true);
706 if (!iter()->includeVolChange())
708 includeVolChange =
false;
711 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
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.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
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...
Request registration (bool: true)
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...
Do not request registration (bool: false)
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