57 alphatWallBoilingWallFunctionFvPatchScalarField::phaseTypeNames_;
64 namespace compressible
69 alphatWallBoilingWallFunctionFvPatchScalarField::
70 alphatWallBoilingWallFunctionFvPatchScalarField
73 const DimensionedField<scalar, volMesh>& iF
76 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF),
77 otherPhaseName_(
"vapor"),
78 phaseType_(liquidPhase),
81 alphatConv_(p.size(), 0),
82 dDep_(p.size(), 1
e-5),
84 partitioningModel_(nullptr),
85 nucleationSiteModel_(nullptr),
86 departureDiamModel_(nullptr),
87 departureFreqModel_(nullptr)
89 AbyV_ = this->patch().magSf();
92 const label faceCelli = this->patch().faceCells()[facei];
93 AbyV_[facei] /= iF.mesh().V()[faceCelli];
102 const DimensionedField<scalar, volMesh>& iF,
103 const dictionary& dict
106 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict),
107 otherPhaseName_(dict.
lookup(
"otherPhase")),
108 phaseType_(phaseTypeNames_.
read(dict.
lookup(
"phaseType"))),
109 relax_(dict.lookupOrDefault<scalar>(
"relax", 0.5)),
111 alphatConv_(p.size(), 0),
112 dDep_(p.size(), 1
e-5),
114 partitioningModel_(nullptr),
115 nucleationSiteModel_(nullptr),
116 departureDiamModel_(nullptr),
117 departureFreqModel_(nullptr)
121 if (internalField().
group() == otherPhaseName_)
124 <<
"otherPhase should be the name of the vapor phase that " 125 <<
"corresponds to the liquid base of vice versa" << nl
126 <<
"This phase: " << internalField().group() << nl
127 <<
"otherPhase: " << otherPhaseName_
138 dict.subDict(
"partitioningModel")
150 dict.subDict(
"partitioningModel")
153 nucleationSiteModel_ =
156 dict.subDict(
"nucleationSiteModel")
159 departureDiamModel_ =
162 dict.subDict(
"departureDiamModel")
165 departureFreqModel_ =
168 dict.subDict(
"departureFreqModel")
171 if (dict.found(
"dDep"))
176 if (dict.found(
"qQuenching"))
185 if (dict.found(
"alphatConv"))
187 alphatConv_ =
scalarField(
"alphatConv", dict, p.size());
190 AbyV_ = this->patch().magSf();
193 const label faceCelli = this->patch().faceCells()[facei];
194 AbyV_[facei] /= iF.mesh().V()[faceCelli];
202 const alphatWallBoilingWallFunctionFvPatchScalarField& psf,
204 const DimensionedField<scalar, volMesh>& iF,
205 const fvPatchFieldMapper& mapper
208 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
215 otherPhaseName_(psf.otherPhaseName_),
216 phaseType_(psf.phaseType_),
219 alphatConv_(mapper(psf.alphatConv_)),
220 dDep_(mapper(psf.dDep_)),
221 qq_(mapper(psf.qq_)),
222 partitioningModel_(psf.partitioningModel_),
223 nucleationSiteModel_(psf.nucleationSiteModel_),
224 departureDiamModel_(psf.departureDiamModel_),
225 departureFreqModel_(psf.departureFreqModel_)
232 const alphatWallBoilingWallFunctionFvPatchScalarField& psf
235 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf),
236 otherPhaseName_(psf.otherPhaseName_),
237 phaseType_(psf.phaseType_),
240 alphatConv_(psf.alphatConv_),
243 partitioningModel_(psf.partitioningModel_),
244 nucleationSiteModel_(psf.nucleationSiteModel_),
245 departureDiamModel_(psf.departureDiamModel_),
246 departureFreqModel_(psf.departureFreqModel_)
253 const alphatWallBoilingWallFunctionFvPatchScalarField& psf,
254 const DimensionedField<scalar, volMesh>& iF
257 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf, iF),
258 otherPhaseName_(psf.otherPhaseName_),
259 phaseType_(psf.phaseType_),
262 alphatConv_(psf.alphatConv_),
265 partitioningModel_(psf.partitioningModel_),
266 nucleationSiteModel_(psf.nucleationSiteModel_),
267 departureDiamModel_(psf.departureDiamModel_),
268 departureFreqModel_(psf.departureFreqModel_)
277 if (phasePair == phasePairKey(otherPhaseName_, internalField().
group()))
288 dmdt(
const phasePairKey& phasePair)
const 297 <<
" dmdt requested for invalid phasePair!" 305 mDotL(
const phasePairKey& phasePair)
const 314 <<
" mDotL requested for invalid phasePair!" 329 if (!partitioningModel_.valid())
332 <<
"partitioningModel has not been constructed!" 337 const phaseSystem&
fluid =
338 refCast<const phaseSystem>
340 db().lookupObject<phaseSystem>(
"phaseProperties")
343 const saturationModel& satModel =
344 db().lookupObject<saturationModel>(
"saturationModel");
346 const label patchi = patch().index();
352 const phaseModel& vapor
354 fluid.phases()[internalField().group()]
364 partitioningModel_->fLiquid(1-vaporw)
369 calcAlphat(*
this)*(1 - fLiquid)/
max(vaporw, scalar(1
e-8))
376 if (!nucleationSiteModel_.valid())
379 <<
"nucleationSiteModel has not been constructed!" 384 if (!departureDiamModel_.valid())
387 <<
"departureDiameterModel has not been constructed!" 392 if (!departureFreqModel_.valid())
395 <<
"departureFrequencyModel has not been constructed!" 399 const phaseModel& liquid
401 fluid.phases()[internalField().group()]
404 const phaseModel& vapor(
fluid.phases()[otherPhaseName_]);
426 const nutWallFunctionFvPatchScalarField& nutw =
429 const scalar Cmu25(
pow025(nutw.Cmu()));
433 const tmp<scalarField> tmuw = turbModel.mu(patchi);
436 const tmp<scalarField> talphaw = liquid.thermo().alpha(patchi);
439 const tmp<volScalarField> tk = turbModel.k();
444 turbModel.U().boundaryField()[
patchi];
449 turbModel.rho().boundaryField()[
patchi];
452 vaporTurbModel.rho().boundaryField()[
patchi];
455 liquid.thermo().p().boundaryField()[
patchi];
458 liquid.thermo().T().boundaryField()[
patchi];
473 const scalarField yPlusTherm(this->yPlusTherm(nutw, P, Prat));
475 tmp<volScalarField> tCp = liquid.thermo().Cp();
480 const tmp<volScalarField> tTsat =
481 satModel.Tsat(liquid.thermo().p());
485 const scalarField Tsatc(Tsatw.patchInternalField());
488 = liquid.thermo().he().boundaryField()[
patchi];
492 liquid.thermo().he().member() ==
"e" 493 ? hew.patchInternalField() + pw/rhoLiquidw.patchInternalField()
494 : hew.patchInternalField()
499 vapor.thermo().he().member() ==
"e" 500 ? vapor.thermo().he(pw, Tsatc, patchi) + pw/rhoVaporw - hw
501 : vapor.thermo().he(pw, Tsatc, patchi) - hw
507 const scalarField fLiquid(partitioningModel_->fLiquid(liquidw));
510 alphatConv_ = calcAlphat(alphatConv_);
512 for (
label i=0; i<10; i++)
518 Prt_*(
log(nutw.E()*250)/nutw.kappa() + P)
523 Prt_*(
log(nutw.E()*
yPlus)/nutw.kappa() + P)
531 Tw - (Tplus_y250/Tplus)*(Tw - Tc)
538 nucleationSiteModel_->N
550 dDep_ = departureDiamModel_->dDeparture
563 departureFreqModel_->fDeparture
577 rhoLiquidw*Cpw*(Tsatw - Tl)/(rhoVaporw*L)
582 fLiquid*4.8*
exp(
min(-Ja/80,
log(vGreat)))
593 + relax_*(1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*AbyV_;
602 2*(alphaw*Cpw)*fDep*
sqrt((0.8/fDep)/(
pi*alphaw/rhoLiquidw))
606 qq_ = (A2*hQ*
max(Tw - Tl, scalar(0)));
615 + (qq_ + qe())/
max(hew.snGrad(), scalar(1
e-16))
617 /
max(liquidw, scalar(1
e-8))
624 scalar maxErr(
max(
mag(TsupPrev - TsupNew)));
630 fLiquid*A1*(alphatConv_ + alphaw)*hew.snGrad()
635 liquidw*(*
this + alphaw)*hew.snGrad()
641 Info<<
" dDep_: " <<
gMin(dDep_) <<
" - " 643 Info<<
" fDep: " <<
gMin(fDep) <<
" - " 648 Info<<
" A2E: " <<
gMin(A2E) <<
" - " 653 Info<<
" qq: " <<
gMin(fLiquid*qq()) <<
" - " 655 Info<<
" qe: " <<
gMin(fLiquid*qe()) <<
" - " 657 Info<<
" qEff: " <<
gMin(qEff) <<
" - " 659 Info<<
" alphat: " <<
gMin(*
this) <<
" - " 661 Info<<
" alphatConv: " <<
gMin(alphatConv_)
662 <<
" - " <<
gMax(alphatConv_) <<
endl;
669 Info<<
"Wall boiling wall function iterations: " 681 <<
"Unknown phase type. Valid types are: " 686 fixedValueFvPatchScalarField::updateCoeffs();
694 writeEntry(os,
"phaseType", phaseTypeNames_[phaseType_]);
702 os.writeKeyword(
"partitioningModel") <<
nl;
704 partitioningModel_->write(os);
710 os.writeKeyword(
"partitioningModel") <<
nl;
712 partitioningModel_->write(os);
715 os.writeKeyword(
"nucleationSiteModel") <<
nl;
717 nucleationSiteModel_->write(os);
720 os.writeKeyword(
"departureDiamModel") <<
nl;
722 departureDiamModel_->write(os);
725 os.writeKeyword(
"departureFreqModel") <<
nl;
727 departureFreqModel_->write(os);
734 writeEntry(os,
"otherPhase", otherPhaseName_);
748 alphatWallBoilingWallFunctionFvPatchScalarField
const char *const group
Group name for atomic constants.
virtual const scalarField & dmdt() const
Return the rate of phase-change.
static autoPtr< departureDiameterModel > New(const dictionary &dict)
Select null constructed.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
#define forAll(list, i)
Loop across all elements in list.
scalarField dmdt_
Rate of phase-change.
ThermalDiffusivity< PhaseCompressibleTurbulenceModel< phaseModel > > phaseCompressibleTurbulenceModel
Typedef for phaseCompressibleTurbulenceModel.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static autoPtr< partitioningModel > New(const dictionary &dict)
Select null constructed.
fvPatchField< vector > fvPatchVectorField
Ostream & indent(Ostream &os)
Indent stream.
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar pow025(const dimensionedScalar &ds)
virtual const scalarField & mDotL() const
Return the enthalpy source due to phase-change.
static autoPtr< nucleationSiteModel > New(const dictionary &dict)
Select null constructed.
virtual void write(Ostream &) const
Write.
Initialise the NamedEnum HashTable from the static list of names.
virtual bool activePhasePair(const phasePairKey &) const
Is there phase change mass transfer for this phasePair.
Macros for easy insertion into run-time selection tables.
virtual bool activePhasePair(const phasePairKey &) const
Is there phase change mass transfer for this phasePair.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
bool read(const char *, int32_t &)
stressControl lookup("compactNormalStress") >> compactNormalStress
dimensionedScalar exp(const dimensionedScalar &ds)
fvPatchField< scalar > fvPatchScalarField
static const word propertiesName
Default name of the turbulence properties dictionary.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static word groupName(Name name, const word &group)
phaseType
Enumeration listing the possible operational modes.
errorManip< error > abort(error &err)
alphatWallBoilingWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Type gMax(const FieldField< Field, Type > &f)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
scalarField mDotL_
Latent heat of the phase-change.
static autoPtr< departureFrequencyModel > New(const dictionary &dict)
Select null constructed.
virtual void write(Ostream &) const
Write.
dimensioned< scalar > mag(const dimensioned< Type > &)
const doubleScalar e
Elementary charge.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
static const nutWallFunctionFvPatchScalarField & nutw(const turbulenceModel &turbModel, const label patchi)
Return the nut patchField for the given wall patch.
makePatchTypeField(fvPatchScalarField, thermalBaffleFvPatchScalarField)