32 template<
class BasePhaseSystem>
60 *eqns[phase1.
name()] +=
61 dmdtf*hs1 +
fvm::Sp(dmdtf12, he1) - dmdtf12*he1;
62 *eqns[phase2.
name()] -=
63 dmdtf*hs2 +
fvm::Sp(dmdtf21, he2) - dmdtf21*he2;
66 *eqns[phase1.
name()] += dmdtf21*(hs2 - hs1);
67 *eqns[phase2.
name()] -= dmdtf12*(hs1 - hs2);
70 *eqns[phase1.
name()] += dmdtf21*
K2 + dmdtf12*
K1;
71 *eqns[phase2.
name()] -= dmdtf12*
K1 + dmdtf21*
K2;
76 template<
class BasePhaseSystem>
95 isA<rhoFluidMulticomponentThermo>(thermo1)
96 ? &refCast<const rhoFluidMulticomponentThermo>(thermo1)
99 isA<rhoFluidMulticomponentThermo>(thermo2)
100 ? &refCast<const rhoFluidMulticomponentThermo>(thermo2)
120 const label speciei1 =
122 const label speciei2 =
129 ? mcThermoPtr1->
hsi(speciei1, thermo1.
p(), thermo1.
T())
135 ? mcThermoPtr2->
hsi(speciei2, thermo2.
p(), thermo2.
T())
145 ?
max(mcThermoPtr1->
Y(speciei1), residualY_)
149 ?
max(mcThermoPtr2->
Y(speciei2), residualY_)
154 *eqns[phase1.
name()] += dmidtf*hsi1;
155 *eqns[phase2.
name()] -= dmidtf*hsi2;
158 *eqns[phase1.
name()] +=
159 fvm::Sp(dmidtf12/tYi1(), he1) - dmidtf12/tYi1()*he1;
160 *eqns[phase2.
name()] -=
161 fvm::Sp(dmidtf21/tYi2(), he2) - dmidtf21/tYi2()*he2;
165 *eqns[phase1.
name()] += dmidtf21*(hsi2 - hsi1);
166 *eqns[phase2.
name()] -= dmidtf12*(hsi1 - hsi2);
169 *eqns[phase1.
name()] += dmidtf21*
K2 + dmidtf12*
K1;
170 *eqns[phase2.
name()] -= dmidtf12*
K1 + dmidtf21*
K2;
176 template<
class BasePhaseSystem>
212 case latentHeatScheme::symmetric:
214 *eqns[phase1.
name()] += dmdtf*hsf1;
215 *eqns[phase2.
name()] -= dmdtf*hsf2;
219 case latentHeatScheme::upwind:
225 *eqns[phase1.
name()] += dmdtf21*hsf1 + dmdtf12*hs1;
226 *eqns[phase2.
name()] -= dmdtf12*hsf2 + dmdtf21*hs2;
231 *eqns[phase1.
name()] +=
fvm::Sp(dmdtf12, he1) - dmdtf12*he1;
232 *eqns[phase2.
name()] -=
fvm::Sp(dmdtf21, he2) - dmdtf21*he2;
235 *eqns[phase1.
name()] += dmdtf21*
K2 + dmdtf12*
K1;
236 *eqns[phase2.
name()] -= dmdtf12*
K1 + dmdtf21*
K2;
241 template<
class BasePhaseSystem>
267 *eqns[phase1.
name()] += ((1 - weight)*dmdtf12 + weight*dmdtf21)*L;
268 *eqns[phase2.
name()] += ((1 - weight)*dmdtf21 + weight*dmdtf12)*L;
273 template<
class BasePhaseSystem>
283 addDmdtHefsWithoutL(dmdtfs, Tfs,
scheme, eqns);
284 addDmdtL(dmdtfs, Tfs, weight,
scheme, eqns);
288 template<
class BasePhaseSystem>
311 isA<rhoFluidMulticomponentThermo>(thermo1)
312 ? &refCast<const rhoFluidMulticomponentThermo>(thermo1)
315 isA<rhoFluidMulticomponentThermo>(thermo2)
316 ? &refCast<const rhoFluidMulticomponentThermo>(thermo2)
338 const label speciei1 =
340 const label speciei2 =
347 ? mcThermoPtr1->
hsi(speciei1, thermo1.
p(), Tf)
353 ? mcThermoPtr2->
hsi(speciei2, thermo2.
p(), Tf)
359 if (this->residualY_ > 0)
363 ?
max(mcThermoPtr1->
Y(speciei1), this->residualY_)
367 ?
max(mcThermoPtr2->
Y(speciei2), this->residualY_)
374 case latentHeatScheme::symmetric:
376 *eqns[phase1.
name()] += dmidtf*hsfi1;
377 *eqns[phase2.
name()] -= dmidtf*hsfi2;
381 case latentHeatScheme::upwind:
387 ? mcThermoPtr1->
hsi(speciei1, thermo1.
p(), thermo1.
T())
393 ? mcThermoPtr2->
hsi(speciei2, thermo2.
p(), thermo2.
T())
397 *eqns[phase1.
name()] += dmidtf21*hsfi1 + dmidtf12*hsi1;
398 *eqns[phase2.
name()] -= dmidtf12*hsfi2 + dmidtf21*hsi2;
403 if (this->residualY_ > 0)
405 *eqns[phase1.
name()] +=
406 fvm::Sp(dmidtf12/tYi1(), he1) - dmidtf12/tYi1()*he1;
408 if (this->residualY_ > 0)
410 *eqns[phase2.
name()] -=
411 fvm::Sp(dmidtf21/tYi2(), he2) - dmidtf21/tYi2()*he2;
416 *eqns[phase1.
name()] += dmidtf21*
K2 + dmidtf12*
K1;
417 *eqns[phase2.
name()] -= dmidtf12*
K1 + dmidtf21*
K2;
423 template<
class BasePhaseSystem>
458 *eqns[phase1.
name()] +=
459 ((1 - weight)*dmidtf12 + weight*dmidtf21)*Li;
460 *eqns[phase2.
name()] +=
461 ((1 - weight)*dmidtf21 + weight*dmidtf12)*Li;
467 template<
class BasePhaseSystem>
477 addDmidtHefsWithoutL(dmidtfs, Tfs,
scheme, eqns);
478 addDmidtL(dmidtfs, Tfs, weight,
scheme, eqns);
484 template<
class BasePhaseSystem>
491 BasePhaseSystem(mesh),
492 residualY_(this->template lookupOrDefault<scalar>(
"residualY", -1))
498 template<
class BasePhaseSystem>
505 template<
class BasePhaseSystem>
524 case latentHeatScheme::symmetric:
528 case latentHeatScheme::upwind:
535 neg0(dmdtf)*haf2 +
pos(dmdtf)*ha2
536 -
pos0(dmdtf)*haf1 -
neg(dmdtf)*ha1;
544 template<
class BasePhaseSystem>
564 case latentHeatScheme::symmetric:
568 case latentHeatScheme::upwind:
578 neg0(dmdtf)*haf2 +
pos(dmdtf)*ha2
579 -
pos0(dmdtf)*haf1 -
neg(dmdtf)*ha1;
587 template<
class BasePhaseSystem>
601 isA<rhoFluidMulticomponentThermo>(thermo1)
602 ? &refCast<const rhoFluidMulticomponentThermo>(thermo1)
605 isA<rhoFluidMulticomponentThermo>(thermo2)
606 ? &refCast<const rhoFluidMulticomponentThermo>(thermo2)
608 const label speciei1 =
610 const label speciei2 =
617 ? mcThermoPtr1->
hai(speciei1, thermo1.
p(), Tf)
618 : thermo1.
ha(thermo1.
p(), Tf)
623 ? mcThermoPtr2->
hai(speciei2, thermo2.
p(), Tf)
624 : thermo2.
ha(thermo1.
p(), Tf)
629 case latentHeatScheme::symmetric:
631 return hafi2 - hafi1;
633 case latentHeatScheme::upwind:
639 ? mcThermoPtr1->
hai(speciei1, thermo1.
p(), thermo1.
T())
645 ? mcThermoPtr2->
hai(speciei2, thermo2.
p(), thermo2.
T())
650 neg0(dmdtf)*hafi2 +
pos(dmdtf)*hai2
651 -
pos0(dmdtf)*hafi1 -
neg(dmdtf)*hai1;
659 template<
class BasePhaseSystem>
674 isA<rhoFluidMulticomponentThermo>(thermo1)
675 ? &refCast<const rhoFluidMulticomponentThermo>(thermo1)
678 isA<rhoFluidMulticomponentThermo>(thermo2)
679 ? &refCast<const rhoFluidMulticomponentThermo>(thermo2)
681 const label speciei1 =
683 const label speciei2 =
693 ? mcThermoPtr1->
hai(speciei1, p1, Tf)
699 ? mcThermoPtr2->
hai(speciei2, p2, Tf)
705 case latentHeatScheme::symmetric:
707 return hafi2 - hafi1;
709 case latentHeatScheme::upwind:
718 ? mcThermoPtr1->
hai(speciei1, p1, T1)
724 ? mcThermoPtr2->
hai(speciei2, p2, T2)
729 neg0(dmdtf)*hafi2 +
pos(dmdtf)*hai2
730 -
pos0(dmdtf)*hafi1 -
neg(dmdtf)*hai1;
738 template<
class BasePhaseSystem>
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Generic GeometricField class.
void addDmdtL(const phaseSystem::dmdtfTable &dmdtfs, const phaseSystem::dmdtfTable &Tfs, const scalar weight, const latentHeatScheme scheme, phaseSystem::heatTransferTable &eqns) const
Add latent heat terms which result from bulk phase changes.
HeatTransferPhaseSystem(const fvMesh &)
Construct from fvMesh.
virtual tmp< volScalarField > L(const phaseInterface &interface, const volScalarField &dmdtf, const volScalarField &Tf, const latentHeatScheme scheme) const
Return the latent heat for a given interface, mass transfer rate.
void addDmidtL(const phaseSystem::dmidtfTable &dmidtfs, const phaseSystem::dmdtfTable &Tfs, const scalar weight, const latentHeatScheme scheme, phaseSystem::heatTransferTable &eqns) const
Add latent heat terms which result from specie phase changes.
virtual ~HeatTransferPhaseSystem()
Destructor.
void addDmidtHefs(const phaseSystem::dmidtfTable &dmidtfs, phaseSystem::heatTransferTable &eqns) const
Add energy transfer terms which result from specie mass transfers.
virtual tmp< volScalarField > Li(const phaseInterface &interface, const word &member, const volScalarField &dmidtf, const volScalarField &Tf, const latentHeatScheme scheme) const
Return the latent heat for a given interface, specie, mass transfer.
void addDmdtHefs(const phaseSystem::dmdtfTable &dmdtfs, phaseSystem::heatTransferTable &eqns) const
Add energy transfer terms which result from bulk mass transfers.
void addDmidtHefsWithoutL(const phaseSystem::dmidtfTable &dmidtfs, const phaseSystem::dmdtfTable &Tfs, const latentHeatScheme scheme, phaseSystem::heatTransferTable &eqns) const
Add energy transfer terms which result from specie phase changes,.
void addDmdtHefsWithoutL(const phaseSystem::dmdtfTable &dmdtfs, const phaseSystem::dmdtfTable &Tfs, const latentHeatScheme scheme, phaseSystem::heatTransferTable &eqns) const
Add energy transfer terms which result from bulk phase changes,.
virtual bool read()
Read base phaseProperties dictionary.
virtual const volScalarField & T() const =0
Temperature [K].
virtual tmp< volScalarField > ha() const =0
Absolute enthalpy [J/kg].
virtual tmp< volScalarField > hs() const =0
Sensible enthalpy [J/kg].
virtual const volScalarField & he() const =0
Enthalpy/Internal energy [J/kg].
virtual const volScalarField & p() const =0
Pressure [Pa].
Mesh data needed to do the Finite Volume discretisation.
latentHeatScheme
Enumeration for the latent heat scheme.
virtual const speciesTable & species() const =0
The table of species.
virtual PtrList< volScalarField > & Y()=0
Access the mass-fraction fields.
virtual scalar hsi(const label speciei, const scalar p, const scalar T) const =0
Sensible enthalpy [J/kg].
virtual scalar hai(const label speciei, const scalar p, const scalar T) const =0
Absolute enthalpy [J/kg].
A class representing the concept of 1 (scalar(1)) used to avoid unnecessary manipulations for objects...
Class to represent an interface between phases. Derivations can further specify the configuration of ...
const phaseModel & phase1() const
Return phase 1.
const phaseModel & phase2() const
Return phase 2.
virtual tmp< volScalarField > K() const =0
Return the phase kinetic energy.
virtual const rhoFluidThermo & fluidThermo() const =0
Return the thermophysical model.
const word & name() const
Return the name of this phase.
Base-class for multi-component fluid thermodynamic properties based on density.
Base-class for fluid thermodynamic properties based on density.
Base class of the thermophysical property types.
A class for managing temporary objects.
A class for handling words, derived from string.
Calculate the matrix for implicit and explicit sources.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
static tmp< surfaceInterpolationScheme< Type > > scheme(const surfaceScalarField &faceFlux, Istream &schemeData)
Return weighting factors for scheme given from Istream.
tmp< VolField< Type > > Sp(const volScalarField &sp, const VolField< Type > &vf)
dimensionedScalar pos(const dimensionedScalar &ds)
dimensionedScalar pos0(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet dimless
dimensionedScalar negPart(const dimensionedScalar &ds)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar neg(const dimensionedScalar &ds)
dimensionedScalar neg0(const dimensionedScalar &ds)
dimensionedScalar posPart(const dimensionedScalar &ds)