32 template<
class BasePhaseSystem>
39 HeatAndMassTransferPhaseSystem<BasePhaseSystem>(mesh),
40 volatile_(this->
lookup(
"volatile")),
41 saturationModel_(saturationModel::
New(this->subDict(
"saturationModel"))),
42 massTransfer_(this->
lookup(
"massTransfer"))
52 const phasePair& pair(phasePairIter());
68 this->
mesh().time().timeName(),
83 template<
class BasePhaseSystem>
91 template<
class BasePhaseSystem>
95 return saturationModel_();
99 template<
class BasePhaseSystem>
103 typedef compressible::alphatPhaseChangeWallFunctionFvPatchScalarField
104 alphatPhaseChangeWallFunction;
106 autoPtr<phaseSystem::heatTransferTable> eqnsPtr =
119 const phasePair& pair(phasePairIter());
126 const phaseModel& phase = pair.phase1();
127 const phaseModel& otherPhase = pair.phase2();
134 phase.mesh().time().timeName(),
148 "alphat." + otherPhase.name()
155 "alphat." + otherPhase.name()
161 const fvPatch& currPatch = patches[
patchi];
165 isA<alphatPhaseChangeWallFunction>
167 alphat.boundaryField()[
patchi]
172 refCast<const alphatPhaseChangeWallFunction>
174 alphat.boundaryField()[
patchi]
179 label faceCelli = currPatch.faceCells()[facei];
180 mDotL[faceCelli] = patchMDotL[facei];
186 *eqns[otherPhase.name()] -= mDotL;
194 template<
class BasePhaseSystem>
199 autoPtr<phaseSystem::massTransferTable> eqnsPtr
208 const phaseModel& phase = this->phaseModels_[
phasei];
210 const PtrList<volScalarField>& Yi = phase.Y();
229 const phasePair& pair(phasePairIter());
235 const phaseModel& phase = pair.phase1();
236 const phaseModel& otherPhase = pair.phase2();
253 *eqns[otherName] += dmdt12 -
fvm::Sp(dmdt12, eqns[otherName]->
psi());
260 template<
class BasePhaseSystem>
264 const phasePairKey& key
269 return dmdtSign**iDmdt_[key];
273 template<
class BasePhaseSystem>
280 tmp<volScalarField> tiDmdt
287 this->mesh_.time().timeName(),
302 const phasePair& pair(phasePairIter());
309 const phaseModel* phase1 = &pair.phase1();
310 const phaseModel* phase2 = &pair.phase2();
314 if (phase1 == &phase)
316 tiDmdt.ref() += this->iDmdt(pair);
319 Swap(phase1, phase2);
327 template<
class BasePhaseSystem>
330 typedef compressible::alphatPhaseChangeWallFunctionFvPatchScalarField
331 alphatPhaseChangeWallFunction;
342 const phasePair& pair(phasePairIter());
349 const phaseModel& phase1 = pair.phase1();
350 const phaseModel& phase2 = pair.phase2();
352 Info<< phase1.name() <<
" min/max T " 353 <<
min(phase1.thermo().T()).value()
355 <<
max(phase1.thermo().T()).value()
358 Info<< phase2.name() <<
" min/max T " 359 <<
min(phase2.thermo().T()).value()
361 <<
max(phase2.thermo().T()).value()
383 - (
neg(iDmdt)*he1 +
pos0(iDmdt)*hef1),
394 this->heatTransferModels_[pair][pair.first()]->K(0)
399 this->heatTransferModels_[pair][pair.second()]->K(0)
402 Tf = saturationModel_->Tsat(phase1.thermo().p());
405 (H1*(Tf - T1) + H2*(Tf - T2))/L;
413 volScalarField H1(this->heatTransferModels_[pair][pair.first()]->K());
414 volScalarField H2(this->heatTransferModels_[pair][pair.second()]->K());
417 const scalar HLimit = 1
e-4;
418 H1.boundaryFieldRef() =
419 max(H1.boundaryField(), phase1.boundaryField()*HLimit);
420 H2.boundaryFieldRef() =
421 max(H2.boundaryField(), phase2.boundaryField()*HLimit);
423 Tf = (H1*T1 + H2*T2 + iDmdtNew*L)/(H1 + H2);
425 Info<<
"Tf." << pair.name()
426 <<
": min = " <<
min(Tf.primitiveField())
427 <<
", mean = " <<
average(Tf.primitiveField())
428 <<
", max = " <<
max(Tf.primitiveField())
431 scalar iDmdtRelax(this->
mesh().fieldRelaxationFactor(
"iDmdt"));
432 iDmdt = (1 - iDmdtRelax)*iDmdt + iDmdtRelax*iDmdtNew;
436 Info<<
"iDmdt." << pair.name()
437 <<
": min = " <<
min(iDmdt.primitiveField())
438 <<
", mean = " <<
average(iDmdt.primitiveField())
439 <<
", max = " <<
max(iDmdt.primitiveField())
450 this->
mesh().time().timeName(),
464 "alphat." + phase2.name()
471 "alphat." + phase2.name()
477 const fvPatch& currPatch = patches[
patchi];
481 isA<alphatPhaseChangeWallFunction>
483 alphat.boundaryField()[
patchi]
488 refCast<const alphatPhaseChangeWallFunction>
490 alphat.boundaryField()[
patchi]
495 label faceCelli = currPatch.faceCells()[facei];
496 wDmdt[faceCelli] += patchDmdt[facei];
501 Info<<
"wDmdt." << pair.name()
502 <<
": min = " <<
min(wDmdt.primitiveField())
503 <<
", mean = " <<
average(wDmdt.primitiveField())
504 <<
", max = " <<
max(wDmdt.primitiveField())
509 dmdt = wDmdt + iDmdt;
511 Info<<
"dmdt." << pair.name()
512 <<
": min = " <<
min(dmdt.primitiveField())
513 <<
", mean = " <<
average(dmdt.primitiveField())
514 <<
", max = " <<
max(dmdt.primitiveField())
521 template<
class BasePhaseSystem>
fvMatrix< scalar > fvScalarMatrix
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual autoPtr< phaseSystem::heatTransferTable > heatTransfer() const
Return the heat transfer matrices.
const double e
Elementary charge.
HashTable< autoPtr< phasePair >, phasePairKey, phasePairKey::hash > phasePairTable
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
ThermalPhaseChangePhaseSystem(const fvMesh &)
Construct from fvMesh.
static int compare(const Pair< word > &a, const Pair< word > &b)
Compare Pairs.
virtual void correctThermo()
Correct the thermodynamics.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual autoPtr< phaseSystem::massTransferTable > massTransfer() const
Return the mass transfer matrices.
const word & name() const
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
dimensionedScalar posPart(const dimensionedScalar &ds)
dimensionedScalar neg(const dimensionedScalar &ds)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
HashPtrTable< fvScalarMatrix, word, string::hash > heatTransferTable
stressControl lookup("compactNormalStress") >> compactNormalStress
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static word groupName(Name name, const word &group)
virtual autoPtr< phaseSystem::heatTransferTable > heatTransfer() const
Return the heat transfer matrices.
Volume integrate volField creating a volField.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
dimensionedScalar pos0(const dimensionedScalar &ds)
const Mesh & mesh() const
Return mesh.
virtual bool read()
Read base phaseProperties dictionary.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
const dimensionSet dimDensity
const saturationModel & saturation() const
Return the saturationModel.
PtrList< fvPatch > fvPatchList
container classes for fvPatch
virtual ~ThermalPhaseChangePhaseSystem()
Destructor.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
dimensioned< scalar > mag(const dimensioned< Type > &)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const volScalarField & psi
HashPtrTable< fvScalarMatrix, word, string::hash > massTransferTable
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
virtual tmp< volScalarField > iDmdt(const phasePairKey &key) const
Return the interfacial mass flow rate.
A class for managing temporary objects.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
dimensionedScalar negPart(const dimensionedScalar &ds)