36 template<
class BasePhaseSystem>
43 if (!iDmdt_.found(
key))
45 return phaseSystem::dmdt(
key);
50 return dmdtSign**iDmdt_[
key];
54 template<
class BasePhaseSystem>
61 if (!wDmdt_.found(
key))
63 return phaseSystem::dmdt(
key);
68 return dmdtSign**wDmdt_[
key];
74 template<
class BasePhaseSystem>
81 BasePhaseSystem(
mesh),
82 volatile_(this->template getOrDefault<
word>(
"volatile",
"none")),
87 phaseChange_(this->
lookup(
"phaseChange"))
113 this->
mesh().time().timeName(),
132 this->
mesh().time().timeName(),
151 this->
mesh().time().timeName(),
166 template<
class BasePhaseSystem>
174 template<
class BasePhaseSystem>
178 return saturationModel_();
182 template<
class BasePhaseSystem>
189 return BasePhaseSystem::dmdt(
key) + this->iDmdt(
key) + this->wDmdt(
key);
193 template<
class BasePhaseSystem>
201 const phasePair& pair = this->phasePairs_[iDmdtIter.key()];
204 this->addField(pair.
phase1(),
"dmdt", iDmdt, dmdts);
205 this->addField(pair.
phase2(),
"dmdt", - iDmdt, dmdts);
210 const phasePair& pair = this->phasePairs_[wDmdtIter.key()];
213 this->addField(pair.phase1(),
"dmdt", wDmdt, dmdts);
214 this->addField(pair.phase2(),
"dmdt", - wDmdt, dmdts);
221 template<
class BasePhaseSystem>
226 BasePhaseSystem::heatTransfer();
238 if (this->wMDotL_.found(phasePairIter.key()))
261 this->iDmdt(pair) + this->wDmdt(pair)
283 template<
class BasePhaseSystem>
313 if (Yi[i].member() != volatile_)
334 *eqns[otherName] -= dmdt;
342 template<
class BasePhaseSystem>
347 alphatPhaseChangeWallFunction;
351 typename BasePhaseSystem::heatTransferModelTable,
352 this->heatTransferModels_,
353 heatTransferModelIter
358 this->phasePairs_[heatTransferModelIter.key()]
406 (
neg0(iDmdt)*hf2 +
pos(iDmdt)*h2)
407 - (
pos0(iDmdt)*hf1 +
neg(iDmdt)*h1)
417 iDmdtNew = (H1*(Tsat - T1) + H2*(Tsat - T2))/
L;
431 Tf = (H1*T1 + H2*T2 + iDmdtNew*
L)/(H1 + H2);
433 Info<<
"Tf." << pair.name()
439 scalar iDmdtRelax(this->
mesh().fieldRelaxationFactor(
"iDmdt"));
440 iDmdt = (1 - iDmdtRelax)*iDmdt + iDmdtRelax*iDmdtNew;
444 Info<<
"iDmdt." << pair.name()
445 <<
": min = " <<
gMin(iDmdt.primitiveField())
446 <<
", mean = " <<
gAverage(iDmdt.primitiveField())
447 <<
", max = " <<
gMax(iDmdt.primitiveField())
457 bool wallBoilingActive =
false;
485 isA<alphatPhaseChangeWallFunction>
491 const alphatPhaseChangeWallFunction& PCpatch =
492 refCast<const alphatPhaseChangeWallFunction>
499 if (PCpatch.activePhasePair(
key))
501 wallBoilingActive =
true;
515 const label faceCelli =
517 wDmdt[faceCelli] -=
sign*patchDmdt[facei];
518 wMDotL[faceCelli] -=
sign*patchMDotL[facei];
526 if (wallBoilingActive)
528 Info<<
"wDmdt." << pair.name()
539 template<
class BasePhaseSystem>
void clamp_min(const Type &lower)
Impose lower (floor) clamp on the field values (in-place)
dimensionedScalar sign(const dimensionedScalar &ds)
virtual autoPtr< phaseSystem::heatTransferTable > heatTransfer() const
Return the heat transfer matrices.
const phaseModel & otherPhase() const
Return the other phase in this two-phase system.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
const multiphaseInter::phaseModel & phase2() const
virtual bool read()
Read base phaseProperties dictionary.
const vector L(dict.get< vector >("L"))
Type gMin(const FieldField< Field, Type > &f)
ThermalPhaseChangePhaseSystem(const fvMesh &)
Construct from fvMesh.
const multiphaseInter::phaseModel & phase1() const
wDmdtTable wDmdt_
Boundary Mass transfer rate.
phaseSystem::massTransferTable & massTransfer(massTransferPtr())
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual tmp< volScalarField > dmdt(const phasePairKey &key) const
Return the mass transfer rate for a pair.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
virtual const volScalarField & T() const
Temperature [K].
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
tmp< volScalarField > wDmdt(const phasePairKey &key) const
Return the boundary mass transfer rate for a pair.
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers...
Lookup type of boundary radiation properties.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.
CGAL::Exact_predicates_exact_constructions_kernel K
dimensionedScalar posPart(const dimensionedScalar &ds)
dimensionedScalar neg(const dimensionedScalar &ds)
static word member(const word &name)
Return member (name without the extension)
virtual volScalarField & he()=0
Enthalpy/Internal energy [J/kg].
#define forAll(list, i)
Loop across all elements in list.
virtual volScalarField & p()
Pressure [Pa].
GeometricField< scalar, fvPatchField, volMesh > volScalarField
tmp< volScalarField > iDmdt(const phasePairKey &key) const
Return the interfacial mass transfer rate for a pair.
dimensionedScalar pos(const dimensionedScalar &ds)
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.
static int compare(const Pair< word > &a, const Pair< word > &b)
Compare Pairs.
wMDotLTable wMDotL_
Boundary thermal energy transfer rate.
A class for handling words, derived from Foam::string.
virtual const labelUList & faceCells() const
Return faceCells.
bool set(const Key &key, T *ptr)
Assign a new entry, overwrites existing.
dimensionedScalar neg0(const dimensionedScalar &ds)
Reading is optional [identical to LAZY_READ].
virtual void correctInterfaceThermo()
Correct the interface thermodynamics.
Abstract base-class for all alphatWallFunctions supporting phase-change.
Volume integrate volField creating a volField.
An ordered or unorder pair of phase names. Typically specified as follows.
const Mesh & mesh() const noexcept
Return mesh.
dimensionedScalar pos0(const dimensionedScalar &ds)
virtual word name() const
Pair name.
Type gMax(const FieldField< Field, Type > &f)
bool ordered() const noexcept
Return the ordered flag.
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
const dimensionSet dimEnergy
const dimensionSet dimDensity
const saturationModel & saturation() const
Return the saturationModel.
const dimensionedScalar & rho() const
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Type gAverage(const FieldField< Field, Type > &f)
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
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 polyBoundaryMesh & patches
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
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual ~ThermalPhaseChangePhaseSystem()
Destructor.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
iDmdtTable iDmdt_
Interfacial Mass transfer rate.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
virtual PtrList< volScalarField > dmdts() const
Return the mass transfer rates for each phase.
A class for managing temporary objects.
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...
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
virtual autoPtr< phaseSystem::massTransferTable > massTransfer() const
Return the mass transfer matrices.
virtual const rhoThermo & thermo() const =0
Return the thermophysical model.
const word & name() const
Calculate the finiteVolume matrix for implicit and explicit sources.
dimensionedScalar negPart(const dimensionedScalar &ds)