49 alphatWallBoilingWallFunctionFvPatchScalarField::phaseType
52alphatWallBoilingWallFunctionFvPatchScalarField::phaseTypeNames_
54 { phaseType::vaporPhase,
"vapor" },
55 { phaseType::liquidPhase,
"liquid" },
76 otherPhaseName_(
"vapor"),
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];
116 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(
p, iF,
dict),
117 otherPhaseName_(
dict.get<
word>(
"otherPhase")),
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!"
452 db().lookupObject<phaseSystem>(
"phaseProperties")
455 const auto& satModel =
458 const label patchi = patch().index();
460 const scalar t = this->db().time().timeOutputValue();
461 const scalar
relax = relax_->value(t);
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))
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
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];
623 tmp<volScalarField>
tCp = liquid.thermo().Cp();
628 const tmp<volScalarField> tTsat =
629 satModel.Tsat(liquid.thermo().p());
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)
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
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);
1314 qq_.writeEntry(
"qQuenching",
os);
1315 alphatConv_.writeEntry(
"alphatConv",
os);
1326 alphatWallBoilingWallFunctionFvPatchScalarField
Macros for easy insertion into run-time selection tables.
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.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors).
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
static word member(const word &name)
Return member (name without the extension).
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual volScalarField & he()=0
Enthalpy/Internal energy [J/kg].
virtual const volScalarField & alpha() const
Thermal diffusivity for enthalpy of mixture [kg/m/s].
const volScalarField & rho() const
Return the density field.
This boundary condition provides a thermal wall function for turbulent thermal diffusivity (usuallyal...
scalar kappa_
Von Karman constant.
tmp< scalarField > calcAlphat(const scalarField &prevAlphat) const
Update turbulent thermal diffusivity.
tmp< scalarField > yPlusTherm(const scalarField &P, const scalarField &Prat) const
Calculate y+ at the edge of the thermal laminar sublayer.
tmp< scalarField > Psmooth(const scalarField &Prat) const
'P' function
scalar Cmu_
Empirical model coefficient.
scalar E_
Wall roughness parameter.
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
scalar Prt_
Turbulent Prandtl number.
scalarField dmdt_
Rate of phase-change.
scalarField mDotL_
Latent heat of the phase-change.
virtual const scalarField & mDotL() const
Return the enthalpy source due to phase-change.
A thermal wall function for simulation of boiling wall.
virtual const scalarField & dmdt() const
Return the rate of phase-change.
virtual void write(Ostream &) const
Write.
virtual tmp< fvPatchField< scalar > > clone() const
Return a clone.
tmp< scalarField > qe() const
Return the evaporation surface heat flux [W/m2].
alphatWallBoilingWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual bool activePhasePair(const phasePairKey &) const
Is there phase change mass transfer for this phasePair.
const scalarField & qq() const
Return the quenching surface heat flux [W/m2].
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A FieldMapper for finite-volume patch fields.
virtual void write(Ostream &) const
Write.
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
scalar Cp(scalar p, scalar T) const
Liquid heat capacity [J/(kg K)].
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
const word & name() const
virtual const rhoThermo & thermo() const =0
Return the thermophysical model.
An ordered or unorder pair of phase names. Typically specified as follows.
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Class to represent a system of phases and model interfacial transfers between them.
A class for managing temporary objects.
static const word propertiesName
Default name of the turbulence properties dictionary.
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
static autoPtr< CHFModel > New(const dictionary &dict)
Select default constructed.
static autoPtr< CHFSubCoolModel > New(const dictionary &dict)
Select default constructed.
static autoPtr< LeidenfrostModel > New(const dictionary &dict)
Select default constructed.
static autoPtr< MHFModel > New(const dictionary &dict)
Select default constructed.
static autoPtr< TDNBModel > New(const dictionary &dict)
Select default constructed.
static autoPtr< departureDiameterModel > New(const dictionary &dict)
Select default constructed.
static autoPtr< departureFrequencyModel > New(const dictionary &dict)
Select default constructed.
static autoPtr< filmBoilingModel > New(const dictionary &dict)
Select default constructed.
static autoPtr< nucleateFluxModel > New(const dictionary &dict)
Select default constructed.
static autoPtr< nucleationSiteModel > New(const dictionary &dict)
Select default constructed.
static autoPtr< partitioningModel > New(const dictionary &dict)
Select default constructed.
A class for handling words, derived from Foam::string.
const tmp< volScalarField > & tCp
const volScalarField & Cp
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Define a concrete fvPatchField type and add to run-time tables Example, (fvPatchScalarField,...
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
constexpr scalar pi(M_PI)
constexpr const char *const group
Group name for mathematical constants.
Namespace for handling debugging switches.
const std::string patch
OpenFOAM patch number as a std::string.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
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.
Type gSum(const FieldField< Field, Type > &f)
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar log(const dimensionedScalar &ds)
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
ThermalDiffusivity< PhaseCompressibleTurbulenceModel< phaseModel > > phaseCompressibleTurbulenceModel
Typedef for phaseCompressibleTurbulenceModel.
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
Type gMin(const FieldField< Field, Type > &f)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gMax(const FieldField< Field, Type > &f)
fvPatchField< vector > fvPatchVectorField
fvPatchField< scalar > fvPatchScalarField
dimensionedScalar pow025(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a).
dimensionedScalar Pr("Pr", dimless, laminarTransport)
#define forAll(list, i)
Loop across all elements in list.
const vector L(dict.get< vector >("L"))
const Vector< label > N(dict.get< Vector< label > >("N"))