62 alphatWallBoilingWallFunctionFvPatchScalarField::phaseTypeNames_;
69 namespace compressible
74 alphatWallBoilingWallFunctionFvPatchScalarField::
75 alphatWallBoilingWallFunctionFvPatchScalarField
78 const DimensionedField<scalar, volMesh>& iF
81 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF),
82 otherPhaseName_(
"vapor"),
83 phaseType_(liquidPhase),
86 alphatConv_(p.size(), 0),
87 dDep_(p.size(), 1
e-5),
89 partitioningModel_(nullptr),
90 nucleationSiteModel_(nullptr),
91 departureDiamModel_(nullptr),
92 departureFreqModel_(nullptr)
94 AbyV_ = this->patch().magSf();
97 const label faceCelli = this->patch().faceCells()[facei];
98 AbyV_[facei] /= iF.mesh().V()[faceCelli];
107 const DimensionedField<scalar, volMesh>& iF,
108 const dictionary& dict
111 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict),
112 otherPhaseName_(dict.
lookup(
"otherPhase")),
113 phaseType_(phaseTypeNames_.
read(dict.
lookup(
"phaseType"))),
114 relax_(dict.lookupOrDefault<scalar>(
"relax", 0.5)),
116 alphatConv_(p.size(), 0),
117 dDep_(p.size(), 1
e-5),
119 partitioningModel_(nullptr),
120 nucleationSiteModel_(nullptr),
121 departureDiamModel_(nullptr),
122 departureFreqModel_(nullptr)
126 if (internalField().
group() == otherPhaseName_)
129 <<
"otherPhase should be the name of the vapor phase that " 130 <<
"corresponds to the liquid base of vice versa" << nl
131 <<
"This phase: " << internalField().group() << nl
132 <<
"otherPhase: " << otherPhaseName_
143 dict.subDict(
"partitioningModel")
155 dict.subDict(
"partitioningModel")
158 nucleationSiteModel_ =
161 dict.subDict(
"nucleationSiteModel")
164 departureDiamModel_ =
167 dict.subDict(
"departureDiamModel")
170 departureFreqModel_ =
173 dict.subDict(
"departureFreqModel")
176 if (dict.found(
"dDep"))
181 if (dict.found(
"qQuenching"))
190 if (dict.found(
"alphatConv"))
192 alphatConv_ =
scalarField(
"alphatConv", dict, p.size());
195 AbyV_ = this->patch().magSf();
198 const label faceCelli = this->patch().faceCells()[facei];
199 AbyV_[facei] /= iF.mesh().V()[faceCelli];
207 const alphatWallBoilingWallFunctionFvPatchScalarField& psf,
209 const DimensionedField<scalar, volMesh>& iF,
210 const fvPatchFieldMapper& mapper
213 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
220 otherPhaseName_(psf.otherPhaseName_),
221 phaseType_(psf.phaseType_),
224 alphatConv_(psf.alphatConv_, mapper),
225 dDep_(psf.dDep_, mapper),
226 qq_(psf.qq_, mapper),
227 partitioningModel_(psf.partitioningModel_),
228 nucleationSiteModel_(psf.nucleationSiteModel_),
229 departureDiamModel_(psf.departureDiamModel_),
230 departureFreqModel_(psf.departureFreqModel_)
237 const alphatWallBoilingWallFunctionFvPatchScalarField& psf
240 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf),
241 otherPhaseName_(psf.otherPhaseName_),
242 phaseType_(psf.phaseType_),
245 alphatConv_(psf.alphatConv_),
248 partitioningModel_(psf.partitioningModel_),
249 nucleationSiteModel_(psf.nucleationSiteModel_),
250 departureDiamModel_(psf.departureDiamModel_),
251 departureFreqModel_(psf.departureFreqModel_)
258 const alphatWallBoilingWallFunctionFvPatchScalarField& psf,
259 const DimensionedField<scalar, volMesh>& iF
262 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf, iF),
263 otherPhaseName_(psf.otherPhaseName_),
264 phaseType_(psf.phaseType_),
267 alphatConv_(psf.alphatConv_),
270 partitioningModel_(psf.partitioningModel_),
271 nucleationSiteModel_(psf.nucleationSiteModel_),
272 departureDiamModel_(psf.departureDiamModel_),
273 departureFreqModel_(psf.departureFreqModel_)
282 if (phasePair == phasePairKey(otherPhaseName_, internalField().
group()))
293 dmdt(
const phasePairKey& phasePair)
const 302 <<
" dmdt requested for invalid phasePair!" 310 mDotL(
const phasePairKey& phasePair)
const 319 <<
" mDotL requested for invalid phasePair!" 334 if (!partitioningModel_.valid())
337 <<
"partitioningModel has not been constructed!" 342 const phaseSystem&
fluid =
343 refCast<const phaseSystem>
345 db().lookupObject<phaseSystem>(
"phaseProperties")
348 const saturationModel& satModel =
349 db().lookupObject<saturationModel>(
"saturationModel");
351 const label patchi = patch().index();
357 const phaseModel& vapor
359 fluid.phases()[internalField().group()]
369 partitioningModel_->fLiquid(1-vaporw)
374 calcAlphat(*
this)*(1 - fLiquid)/
max(vaporw, scalar(1
e-8))
381 if (!nucleationSiteModel_.valid())
384 <<
"nucleationSiteModel has not been constructed!" 389 if (!departureDiamModel_.valid())
392 <<
"departureDiameterModel has not been constructed!" 397 if (!departureFreqModel_.valid())
400 <<
"departureFrequencyModel has not been constructed!" 404 const phaseModel& liquid
406 fluid.phases()[internalField().group()]
409 const phaseModel& vapor(
fluid.phases()[otherPhaseName_]);
431 const tmp<scalarField> tnutw = turbModel.nut(patchi);
433 const scalar Cmu25(
pow025(Cmu_));
437 const tmp<scalarField> tmuw = turbModel.mu(patchi);
440 const tmp<scalarField> talphaw = liquid.thermo().alpha(patchi);
443 const tmp<volScalarField> tk = turbModel.k();
448 turbModel.U().boundaryField()[
patchi];
453 turbModel.rho().boundaryField()[
patchi];
455 liquid.thermo().he().boundaryField()[
patchi];
458 liquid.thermo().T().boundaryField()[
patchi];
473 const scalarField yPlusTherm(this->yPlusTherm(P, Prat));
476 turbModel.rho().boundaryField()[
patchi];
479 vaporTurbModel.rho().boundaryField()[
patchi];
481 tmp<volScalarField> tCp = liquid.thermo().Cp();
486 const tmp<volScalarField> tTsat =
487 satModel.Tsat(liquid.thermo().p());
491 const scalarField Tsatc(Tsatw.patchInternalField());
494 liquid.thermo().p().boundaryField()[
patchi];
498 vapor.thermo().he(pw, Tsatc, patchi) - hew.patchInternalField()
504 const scalarField fLiquid(partitioningModel_->fLiquid(liquidw));
507 alphatConv_ = calcAlphat(alphatConv_);
509 for (
label i=0; i<10; i++)
517 Tl =
max(Tc - 40, Tl);
522 nucleationSiteModel_->N
534 dDep_ = departureDiamModel_->dDeparture
547 departureFreqModel_->fDeparture
561 rhoLiquidw*Cpw*(Tsatw - Tl)/(rhoVaporw*L)
566 fLiquid*4.8*
exp(
min(-Ja/80,
log(vGreat)))
577 + relax_*(1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*AbyV_;
586 2*(alphaw*Cpw)*fDep*
sqrt((0.8/fDep)/(
pi*alphaw/rhow))
590 qq_ = (A2*hQ*
max(Tw - Tl, scalar(0)));
599 + (qq_ + qe())/
max(hew.snGrad(), scalar(1
e-16))
601 /
max(liquidw, scalar(1
e-8))
608 scalar maxErr(
max(
mag(TsupPrev - TsupNew)));
614 fLiquid*A1*(alphatConv_ + alphaw)*hew.snGrad()
619 liquidw*(*
this + alphaw)*hew.snGrad()
625 Info<<
" dDep_: " <<
gMin(dDep_) <<
" - " 627 Info<<
" fDep: " <<
gMin(fDep) <<
" - " 632 Info<<
" A2E: " <<
gMin(A2E) <<
" - " 637 Info<<
" qq: " <<
gMin(fLiquid*qq()) <<
" - " 639 Info<<
" qe: " <<
gMin(fLiquid*qe()) <<
" - " 641 Info<<
" qEff: " <<
gMin(qEff) <<
" - " 643 Info<<
" alphat: " <<
gMin(*
this) <<
" - " 645 Info<<
" alphatConv: " <<
gMin(alphatConv_)
646 <<
" - " <<
gMax(alphatConv_) <<
endl;
653 Info<<
"Wall boiling wall function iterations: " 665 <<
"Unknown phase type. Valid types are: " 670 fixedValueFvPatchScalarField::updateCoeffs();
678 os.writeKeyword(
"phaseType") << phaseTypeNames_[phaseType_]
687 os.writeKeyword(
"partitioningModel") <<
nl;
689 partitioningModel_->write(os);
695 os.writeKeyword(
"partitioningModel") <<
nl;
697 partitioningModel_->write(os);
700 os.writeKeyword(
"nucleationSiteModel") <<
nl;
702 nucleationSiteModel_->write(os);
705 os.writeKeyword(
"departureDiamModel") <<
nl;
707 departureDiamModel_->write(os);
710 os.writeKeyword(
"departureFreqModel") <<
nl;
712 departureFreqModel_->write(os);
722 dDep_.writeEntry(
"dDep", os);
723 qq_.writeEntry(
"qQuenching", os);
724 alphatConv_.writeEntry(
"alphatConv", os);
725 writeEntry(
"value", os);
734 alphatWallBoilingWallFunctionFvPatchScalarField
const char *const group
Group name for atomic constants.
virtual const scalarField & dmdt() const
Return the rate of phase-change.
dimensionedScalar Pr("Pr", dimless, laminarTransport)
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)
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
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.
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.
makePatchTypeField(fvPatchScalarField, thermalBaffleFvPatchScalarField)