52 alphatWallBoilingWallFunctionFvPatchScalarField::phaseTypeNames_
54 { phaseType::vaporPhase,
"vapor" },
55 { phaseType::liquidPhase,
"liquid" },
68 alphatWallBoilingWallFunctionFvPatchScalarField::
69 alphatWallBoilingWallFunctionFvPatchScalarField
76 otherPhaseName_(
"vapor"),
77 phaseType_(liquidPhase),
80 alphatConv_(
p.size(), 0),
81 dDep_(
p.size(), 1
e-5),
84 partitioningModel_(
nullptr),
85 nucleationSiteModel_(
nullptr),
86 departureDiamModel_(
nullptr),
87 departureFreqModel_(
nullptr),
88 nucleatingModel_(
nullptr),
89 filmBoilingModel_(
nullptr),
90 LeidenfrostModel_(
nullptr),
92 CHFSoobModel_(
nullptr),
96 liquidTatYplus_(
false),
97 regimeTypes_(
p.size(), -1)
99 AbyV_ = this->
patch().magSf();
102 const label faceCelli = this->
patch().faceCells()[facei];
103 AbyV_[facei] /= iF.
mesh().V()[faceCelli];
108 alphatWallBoilingWallFunctionFvPatchScalarField::
109 alphatWallBoilingWallFunctionFvPatchScalarField
116 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(
p, iF,
dict),
118 phaseType_(phaseTypeNames_.
get(
"phaseType",
dict)),
121 alphatConv_(
p.size(), 0),
122 dDep_(
p.size(), 1
e-5),
125 partitioningModel_(nullptr),
126 nucleationSiteModel_(nullptr),
127 departureDiamModel_(nullptr),
128 departureFreqModel_(nullptr),
129 nucleatingModel_(nullptr),
130 filmBoilingModel_(nullptr),
131 LeidenfrostModel_(nullptr),
133 CHFSoobModel_(nullptr),
137 liquidTatYplus_(
dict.getOrDefault<bool>(
"liquidTatYplus", false)),
138 regimeTypes_(
p.size(), -1)
141 if (internalField().
group() == otherPhaseName_)
144 <<
"otherPhase should be the name of the vapor phase that " 145 <<
"corresponds to the liquid base of vice versa" <<
nl 146 <<
"This phase: " << internalField().group() <<
nl 147 <<
"otherPhase: " << otherPhaseName_
154 dict.subDict(
"partitioningModel")
170 dict.subDict(
"partitioningModel")
176 =
dict.findDict(
"nucleateFluxModel");
185 nucleationSiteModel_ =
188 dict.subDict(
"nucleationSiteModel")
191 departureDiamModel_ =
194 dict.subDict(
"departureDiamModel")
197 departureFreqModel_ =
200 dict.subDict(
"departureFreqModel")
206 dict.findDict(
"LeidenfrostModel");
222 const dictionary* HFSubCoolDict =
dict.findDict(
"CHFSubCoolModel");
254 if (
dict.found(
"dDep"))
259 dict.readIfPresent(
"K", K_);
261 dict.readIfPresent(
"wp", wp_);
263 if (
dict.found(
"qQuenching"))
272 if (
dict.found(
"alphatConv"))
277 AbyV_ = this->
patch().magSf();
280 const label faceCelli = this->
patch().faceCells()[facei];
281 AbyV_[facei] /= iF.
mesh().V()[faceCelli];
289 const alphatWallBoilingWallFunctionFvPatchScalarField& psf,
295 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
302 otherPhaseName_(psf.otherPhaseName_),
303 phaseType_(psf.phaseType_),
304 relax_(psf.relax_.clone()),
306 alphatConv_(psf.alphatConv_, mapper),
307 dDep_(psf.dDep_, mapper),
308 qq_(psf.qq_, mapper),
310 partitioningModel_(psf.partitioningModel_),
311 nucleationSiteModel_(psf.nucleationSiteModel_),
312 departureDiamModel_(psf.departureDiamModel_),
313 nucleatingModel_(psf.nucleatingModel_),
314 filmBoilingModel_(psf.filmBoilingModel_),
315 LeidenfrostModel_(psf.LeidenfrostModel_),
316 CHFModel_(psf.CHFModel_),
317 CHFSoobModel_(psf.CHFSoobModel_),
318 MHFModel_(psf.MHFModel_),
319 TDNBModel_(psf.TDNBModel_),
321 liquidTatYplus_(psf.liquidTatYplus_),
322 regimeTypes_(psf.regimeTypes_)
333 otherPhaseName_(psf.otherPhaseName_),
334 phaseType_(psf.phaseType_),
335 relax_(psf.relax_.clone()),
337 alphatConv_(psf.alphatConv_),
341 partitioningModel_(psf.partitioningModel_),
342 nucleationSiteModel_(psf.nucleationSiteModel_),
343 departureDiamModel_(psf.departureDiamModel_),
344 nucleatingModel_(psf.nucleatingModel_),
345 filmBoilingModel_(psf.filmBoilingModel_),
346 LeidenfrostModel_(psf.LeidenfrostModel_),
347 CHFModel_(psf.CHFModel_),
348 CHFSoobModel_(psf.CHFSoobModel_),
349 MHFModel_(psf.MHFModel_),
350 TDNBModel_(psf.TDNBModel_),
352 liquidTatYplus_(psf.liquidTatYplus_),
353 regimeTypes_(psf.regimeTypes_)
365 otherPhaseName_(psf.otherPhaseName_),
366 phaseType_(psf.phaseType_),
367 relax_(psf.relax_.clone()),
369 alphatConv_(psf.alphatConv_),
373 partitioningModel_(psf.partitioningModel_),
374 nucleationSiteModel_(psf.nucleationSiteModel_),
375 departureDiamModel_(psf.departureDiamModel_),
376 nucleatingModel_(psf.nucleatingModel_),
377 filmBoilingModel_(psf.filmBoilingModel_),
378 LeidenfrostModel_(psf.LeidenfrostModel_),
379 CHFModel_(psf.CHFModel_),
380 CHFSoobModel_(psf.CHFSoobModel_),
381 MHFModel_(psf.MHFModel_),
382 TDNBModel_(psf.TDNBModel_),
384 liquidTatYplus_(psf.liquidTatYplus_),
385 regimeTypes_(psf.regimeTypes_)
411 <<
" dmdt requested for invalid phasePair!" 426 <<
" mDotL requested for invalid phasePair!" 441 if (!partitioningModel_)
444 <<
"partitioningModel has not been constructed!" 449 const phaseSystem&
fluid =
450 refCast<const phaseSystem>
452 db().lookupObject<phaseSystem>(
"phaseProperties")
455 const auto& satModel =
456 db().lookupObject<saturationModel>(
"saturationModel");
458 const label patchi =
patch().index();
460 const scalar t = this->db().time().timeOutputValue();
461 const scalar
relax = relax_->value(t);
467 const phaseModel& vapor
469 fluid.phases()[internalField().group()]
472 const tmp<scalarField> talphaw = vapor.thermo().alpha(patchi);
476 vapor.thermo().he().boundaryField()[patchi];
481 max(vapor.boundaryField()[patchi], scalar(1
e-16))
489 partitioningModel_->fLiquid(1-vaporw)
497 this->operator[](i) =
499 (1 - fLiquid[i])*(alphatv[i] + alphaw[i])
500 /
max(vaporw[i], scalar(1
e-8))
508 Info<<
" alphatEffv: " <<
gMinMax(vaporw*(*
this + alphaw))
511 const scalarField qEff(vaporw*(*
this + alphaw)*hewv.snGrad());
516 Info<<
" Effective heat transfer rate to vapor:" << Qeff
524 if (!nucleatingModel_)
526 if (!nucleationSiteModel_)
529 <<
"nucleationSiteModel has not been constructed!" 534 if (!departureDiamModel_)
537 <<
"departureDiameterModel has not been constructed!" 542 if (!departureFreqModel_)
545 <<
"departureFrequencyModel has not been constructed!" 550 const phaseModel& liquid
552 fluid.phases()[internalField().group()]
555 const phaseModel& vapor(
fluid.phases()[otherPhaseName_]);
558 const auto& turbModel =
567 const auto& vaporTurbModel =
577 const tmp<scalarField> tnutw = turbModel.nut(patchi);
583 const tmp<scalarField> tmuw = turbModel.mu(patchi);
586 const tmp<scalarField> talphaw = liquid.thermo().alphahe(patchi);
589 const tmp<volScalarField> tk = turbModel.k();
594 turbModel.U().boundaryField()[patchi];
599 turbModel.rho().boundaryField()[patchi];
603 liquid.thermo().
T().boundaryField()[patchi];
621 vaporTurbModel.rho().boundaryField()[patchi];
623 tmp<volScalarField>
tCp = liquid.thermo().Cp();
628 const tmp<volScalarField> tTsat =
629 satModel.Tsat(liquid.thermo().p());
633 const scalarField Tsatc(Tsatw.patchInternalField());
636 liquid.thermo().p().boundaryField()[patchi];
639 liquid.thermo().he().boundaryField()[patchi];
643 liquid.thermo().he().member() ==
"e" 644 ? liquid.thermo().he(pw, Tsatc, patchi)
645 + pw/rhow.patchInternalField()
646 : liquid.thermo().he(pw, Tsatc, patchi)
651 vapor.thermo().he().member() ==
"e" 652 ? vapor.thermo().he(pw, Tsatc, patchi) + pw/rhoVaporw - hwLiqSat
653 : vapor.thermo().he(pw, Tsatc, patchi) - hwLiqSat
657 const scalarField liquidw(liquid.boundaryField()[patchi]);
660 const scalarField fLiquid(partitioningModel_->fLiquid(liquidw));
673 Tl =
max(Tc - 40, Tl);
714 CHFSoobModel_->CHFSubCool
727 Info <<
"CHF Sub Cool factor : " << CHFSubCool <<
endl;
745 Info<<
"Temperature departure from biling : " 768 LeidenfrostModel_->TLeid
780 Info<<
"Leidenfrost Temp : " << TLeiden <<
endl;
785 filmBoilingModel_->htcFilmBoil
797 Info<<
"Htc film boiling : " << htcFilmBoiling <<
endl;
808 wp_*(Tw - tDNB)/(TLeiden - tDNB),
815 Qtb = CHFtotal*(1 -
phi) +
phi*MHF;
824 if (nucleatingModel_)
827 nucleatingModel_->qNucleate
838 dmdtSubCooling *= fLiquid;
845 nucleationSiteModel_->N
857 dDep_ = departureDiamModel_->dDeparture
870 departureFreqModel_->fDeparture
881 rhow*Cpw*(Tsatw - Tl)/(rhoVaporw*
L)
886 fLiquid*4.8*
exp(
min(-Ja/80,
log(VGREAT)))
894 A1 =
max(1 - A2, scalar(1
e-4));
904 (1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*AbyV_
912 (0.8/
max(fDep, SMALL))/(
pi*alphaw/rhow)
920 +
relax*A2*hQ*
max(Tw - Tl, scalar(0))
937 if (Tw[i] > Tsatw[i])
943 regimeTypes_[i] = regimeType::subcool;
954 this->operator[](i) =
960 (qq_[i] +
mDotL_[i]/AbyV_[i])
961 /
max(hewSn[i], scalar(1
e-16))
963 /
max(liquidw[i], scalar(1
e-8)),
970 Info<<
"Sub-cool boiling: " <<
nl 971 <<
" fraction Liq: " << fLiquid[i] <<
nl 973 << (qq_[i] +
mDotL_[i]/AbyV_[i]) <<
nl 974 <<
" delta Tsub: " << (Tw[i] - Tsatw[i])
978 else if (Tw[i] > tDNB[i] && Tw[i] < TLeiden[i])
981 regimeTypes_[i] = regimeType::transient;
984 alphatConv_[i] = 0.0;
990 relax*Qtb[i]*AbyV_[i]/
L[i]
1000 this->operator[](i) =
1005 /
max(hewSn[i], scalar(1
e-16))
1006 )/
max(liquidw[i], scalar(1
e-8)),
1012 Info<<
"Transient boiling: " <<
nl 1013 <<
" fraction Liq: " << fLiquid[i] <<
nl 1014 <<
" Heat flux: " << Qtb[i] <<
nl 1015 <<
" delta Tsub: " << (Tw[i] - Tsatw[i])
1020 else if (Tw[i] > TLeiden[i])
1022 regimeTypes_[i] = regimeType::film;
1025 alphatConv_[i] = 0.0;
1031 relax*htcFilmBoiling[i]
1032 *
max(Tw[i] - Tsatw[i], scalar(0))
1045 mDotL_[i]/AbyV_[i]/
max(hewSn[i], scalar(1
e-16))
1051 this->operator[](i) =
1053 alphaFilm[i]/
max(liquidw[i], scalar(1
e-8))
1059 Info<<
"Film boiling: " <<
nl 1060 <<
" fraction Liq: " << fLiquid[i] <<
nl 1062 << htcFilmBoiling[i]*(Tw[i] - Tsatw[i]) <<
nl 1063 <<
" delta Tsub: " << (Tw[i] - Tsatw[i])
1072 regimeTypes_[i] = regimeType::nonBoiling;
1079 this->operator[](i) =
1083 fLiquid[i]*(alphatConv_[i])
1084 /
max(liquidw[i], scalar(1
e-8)),
1095 fLiquid*liquidw*(*
this + alphaw)*hew.snGrad()
1098 Info<<
"alphat for liquid: " <<
nl <<
nl;
1102 Info<<
" alphatlEff: " 1103 <<
gMinMax(liquidw*(*
this + alphaw)) <<
nl;
1105 Info<<
" Effective heat transfer rate to liquid: " 1119 switch (regimeTypes_[i])
1121 case regimeType::subcool:
1125 case regimeType::transient:
1129 case regimeType::film:
1133 case regimeType::nonBoiling:
1134 nNonBoilings[i] = 1;
1139 scalar nSubCool(
gSum(nSubCools));
1140 scalar nTransient(
gSum(nTransients));
1141 scalar nFilm(
gSum(nFilms));
1142 scalar nNonBoiling(
gSum(nNonBoilings));
1146 Info<<
" sub Cool faces : " << nSubCool <<
endl;
1147 Info<<
" transient faces : " << nTransient <<
endl;
1148 Info<<
" film faces : " << nFilm <<
endl;
1149 Info<<
" non-Boiling faces : " << nNonBoiling <<
endl;
1150 Info<<
" total faces : " 1151 << nSubCool + nTransient + nFilm + nNonBoiling
1156 nNonBoilings*fLiquid*(alphatConv_ + alphaw)
1161 Info<<
" Convective heat transfer: " << Qc <<
endl;
1165 relax*fLiquid*nFilms*htcFilmBoiling*(Tw - Tsatw)
1169 Info<<
" Film boiling heat transfer: " << QFilm <<
endl;
1171 Info<<
" Htc Film Boiling coeff: " 1172 <<
gMin(nFilms*htcFilmBoiling)
1174 <<
gMax(nFilms*htcFilmBoiling) <<
endl;
1177 gSum(fLiquid*nTransients*Qtb*
patch().magSf());
1178 Info<<
" Transient boiling heat transfer:" << Qtbtot
1189 A1*alphatConv_*hew.snGrad() +
qe() +
qq()
1195 Info<<
" Sub Cool boiling heat transfer: " << QsubCool
1206 <<
"Unknown phase type. Valid types are: " 1211 fixedValueFvPatchScalarField::updateCoeffs();
1219 os.writeEntry(
"phaseType", phaseTypeNames_[phaseType_]);
1221 relax_->writeData(
os);
1223 os.beginBlock(
"partitioningModel");
1224 partitioningModel_->write(
os);
1233 if (nucleationSiteModel_)
1235 os.beginBlock(
"nucleationSiteModel");
1236 nucleationSiteModel_->write(
os);
1240 if (departureDiamModel_)
1242 os.beginBlock(
"departureDiamModel");
1243 departureDiamModel_->write(
os);
1247 if (departureFreqModel_)
1249 os.beginBlock(
"departureFreqModel");
1250 departureFreqModel_->write(
os);
1254 if (nucleatingModel_)
1256 os.beginBlock(
"nucleateFluxModel");
1257 nucleatingModel_->write(
os);
1261 if (filmBoilingModel_)
1263 os.beginBlock(
"filmBoilingModel");
1264 filmBoilingModel_->write(
os);
1268 if (LeidenfrostModel_)
1270 os.beginBlock(
"LeidenfrostModel");
1271 LeidenfrostModel_->write(
os);
1277 os.beginBlock(
"CHFModel");
1278 CHFModel_->write(
os);
1284 os.beginBlock(
"CHFSubCoolModel");
1285 CHFSoobModel_->write(
os);
1291 os.beginBlock(
"MHFModel");
1292 MHFModel_->write(
os);
1298 os.beginBlock(
"TDNBModel");
1299 TDNBModel_->write(
os);
1303 os.writeEntry(
"K", K_);
1304 os.writeEntry(
"wp", wp_);
1305 os.writeEntry(
"liquidTatYplus", liquidTatYplus_);
1310 os.writeEntry(
"otherPhase", otherPhaseName_);
1313 dDep_.writeEntry(
"dDep",
os);
1326 alphatWallBoilingWallFunctionFvPatchScalarField
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
static autoPtr< CHFSubCoolModel > New(const dictionary &dict)
Select default constructed.
virtual const scalarField & dmdt() const
Return the rate of phase-change.
dimensionedScalar Pr("Pr", dimless, laminarTransport)
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
static autoPtr< CHFModel > New(const dictionary &dict)
Select default constructed.
tmp< scalarField > Psmooth(const scalarField &Prat) const
'P' function
scalarField dmdt_
Rate of phase-change.
static autoPtr< nucleateFluxModel > New(const dictionary &dict)
Select default constructed.
ThermalDiffusivity< PhaseCompressibleTurbulenceModel< phaseModel > > phaseCompressibleTurbulenceModel
Typedef for phaseCompressibleTurbulenceModel.
fvPatchField< vector > fvPatchVectorField
Type gWeightedSum(const UList< scalar > &weights, const UList< Type > &fld, const label comm)
The global weighted sum (integral) of a field, using the mag() of the weights.
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const vector L(dict.get< vector >("L"))
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
const tmp< volScalarField > & tCp
static autoPtr< TDNBModel > New(const dictionary &dict)
Select default constructed.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
static autoPtr< partitioningModel > New(const dictionary &dict)
Select default constructed.
constexpr char nl
The newline '\n' character (0x0a)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
dimensionedScalar pow025(const dimensionedScalar &ds)
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.
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.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
label k
Boltzmann constant.
virtual void write(Ostream &) const
Write.
static autoPtr< nucleationSiteModel > New(const dictionary &dict)
Select default constructed.
tmp< scalarField > calcAlphat(const scalarField &prevAlphat) const
Update turbulent thermal diffusivity.
scalar Cmu_
Empirical model coefficient.
Macros for easy insertion into run-time selection tables.
static autoPtr< filmBoilingModel > New(const dictionary &dict)
Select default constructed.
#define forAll(list, i)
Loop across all elements in list.
constexpr const char *const group
Group name for atomic constants.
makePatchTypeField(fvPatchScalarField, alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
A thermal wall function for simulation of boiling wall.
static autoPtr< LeidenfrostModel > New(const dictionary &dict)
Select default constructed.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
scalar E_
Wall roughness parameter.
const dimensionedScalar e
Elementary charge.
Type gSum(const FieldField< Field, Type > &f)
dimensionedScalar exp(const dimensionedScalar &ds)
virtual bool activePhasePair(const phasePairKey &) const
Is there phase change mass transfer for this phasePair.
scalar Prt_
Turbulent Prandtl number.
fvPatchField< scalar > fvPatchScalarField
static const word propertiesName
Default name of the turbulence properties dictionary.
virtual void write(Ostream &) const
Write.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch fields.
constexpr scalar pi(M_PI)
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
tmp< scalarField > yPlusTherm(const scalarField &P, const scalarField &Prat) const
Calculate y+ at the edge of the thermal laminar sublayer.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
phaseType
Enumeration listing the possible operational modes.
static autoPtr< departureDiameterModel > New(const dictionary &dict)
Select default constructed.
errorManip< error > abort(error &err)
An ordered or unorder pair of phase names. Typically specified as follows.
alphatWallBoilingWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
const volScalarField & Cp
int debug
Static debugging option.
static autoPtr< MHFModel > New(const dictionary &dict)
Select default constructed.
Type gMax(const FieldField< Field, Type > &f)
OBJstream os(runTime.globalPath()/outputName)
static autoPtr< departureFrequencyModel > New(const dictionary &dict)
Select default constructed.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
scalar kappa_
Von Karman constant.
scalarField mDotL_
Latent heat of the phase-change.
const Vector< label > N(dict.get< Vector< label >>("N"))
const scalarField & qq() const
Return the quenching surface heat flux [W/m2].
tmp< scalarField > qe() const
Return the evaporation surface heat flux [W/m2].
This boundary condition provides a thermal wall function for turbulent thermal diffusivity (usuallyal...
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Mesh & mesh() const noexcept
Return const reference to mesh.
const std::string patch
OpenFOAM patch number as a std::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors)
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
static constexpr const zero Zero
Global zero (0)