33 #include "phaseSystem.H"
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")
175 const dictionary* nucleatingDict
176 =
dict.findDict(
"nucleateFluxModel");
185 nucleationSiteModel_ =
188 dict.subDict(
"nucleationSiteModel")
191 departureDiamModel_ =
194 dict.subDict(
"departureDiamModel")
197 departureFreqModel_ =
200 dict.subDict(
"departureFreqModel")
205 const dictionary* LeidenfrostDict =
206 dict.findDict(
"LeidenfrostModel");
214 const dictionary* CHFDict =
dict.findDict(
"CHFModel");
222 const dictionary* HFSubCoolDict =
dict.findDict(
"CHFSubCoolModel");
230 const dictionary* MHFDict =
dict.findDict(
"MHFModel");
238 const dictionary* TDNBDict =
dict.findDict(
"TDNBModel");
246 const dictionary*
filmDict =
dict.findDict(
"filmBoilingModel");
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
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: " <<
gMin(vaporw*(*
this + alphaw))
509 <<
" - " <<
gMax(vaporw*(*
this + alphaw)) <<
endl;
511 const scalarField qEff(vaporw*(*
this + alphaw)*hewv.snGrad());
513 Info<<
" qEffVap: " <<
gMin(qEff) <<
" - "
516 scalar Qeff =
gSum(qEff*
patch().magSf());
517 Info<<
" Effective heat transfer rate to vapor:" << Qeff
525 if (!nucleatingModel_)
527 if (!nucleationSiteModel_)
530 <<
"nucleationSiteModel has not been constructed!"
535 if (!departureDiamModel_)
538 <<
"departureDiameterModel has not been constructed!"
543 if (!departureFreqModel_)
546 <<
"departureFrequencyModel has not been constructed!"
551 const phaseModel& liquid
556 const phaseModel& vapor(
fluid.phases()[otherPhaseName_]);
559 const auto& turbModel =
568 const auto& vaporTurbModel =
578 const tmp<scalarField> tnutw = turbModel.nut(patchi);
584 const tmp<scalarField> tmuw = turbModel.mu(patchi);
587 const tmp<scalarField> talphaw = liquid.thermo().alphahe(patchi);
590 const tmp<volScalarField> tk = turbModel.k();
595 turbModel.U().boundaryField()[patchi];
600 turbModel.rho().boundaryField()[patchi];
604 liquid.thermo().T().boundaryField()[patchi];
622 vaporTurbModel.rho().boundaryField()[patchi];
624 tmp<volScalarField>
tCp = liquid.thermo().Cp();
629 const tmp<volScalarField> tTsat =
630 satModel.Tsat(liquid.thermo().p());
634 const scalarField Tsatc(Tsatw.patchInternalField());
637 liquid.thermo().p().boundaryField()[patchi];
640 liquid.thermo().he().boundaryField()[patchi];
644 liquid.thermo().he().member() ==
"e"
645 ? liquid.thermo().he(pw, Tsatc, patchi)
646 + pw/rhow.patchInternalField()
647 : liquid.thermo().he(pw, Tsatc, patchi)
652 vapor.thermo().he().member() ==
"e"
653 ? vapor.thermo().he(pw, Tsatc, patchi) + pw/rhoVaporw - hwLiqSat
654 : vapor.thermo().he(pw, Tsatc, patchi) - hwLiqSat
658 const scalarField liquidw(liquid.boundaryField()[patchi]);
661 const scalarField fLiquid(partitioningModel_->fLiquid(liquidw));
674 Tl =
max(Tc - 40, Tl);
715 CHFSoobModel_->CHFSubCool
728 Info <<
"CHF Sub Cool factor : " << CHFSubCool <<
endl;
746 Info<<
"Temperature departure from biling : "
769 LeidenfrostModel_->TLeid
781 Info<<
"Leidenfrost Temp : " << TLeiden <<
endl;
786 filmBoilingModel_->htcFilmBoil
798 Info<<
"Htc film boiling : " << htcFilmBoiling <<
endl;
809 wp_*(Tw - tDNB)/(TLeiden - tDNB),
816 Qtb = CHFtotal*(1 -
phi) +
phi*MHF;
825 if (nucleatingModel_)
828 nucleatingModel_->qNucleate
839 dmdtSubCooling *= fLiquid;
846 nucleationSiteModel_->N
858 dDep_ = departureDiamModel_->dDeparture
871 departureFreqModel_->fDeparture
882 rhow*Cpw*(Tsatw - Tl)/(rhoVaporw*
L)
887 fLiquid*4.8*
exp(
min(-Ja/80,
log(VGREAT)))
895 A1 =
max(1 - A2, scalar(1
e-4));
905 (1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*AbyV_
913 (0.8/
max(fDep, SMALL))/(
pi*alphaw/rhow)
921 +
relax*A2*hQ*
max(Tw - Tl, scalar(0))
938 if (Tw[i] > Tsatw[i])
944 regimeTypes_[i] = regimeType::subcool;
955 this->operator[](i) =
961 (qq_[i] +
mDotL_[i]/AbyV_[i])
962 /
max(hewSn[i], scalar(1
e-16))
964 /
max(liquidw[i], scalar(1
e-8)),
971 Info<<
"Sub-cool boiling: " <<
nl
972 <<
" fraction Liq: " << fLiquid[i] <<
nl
974 << (qq_[i] +
mDotL_[i]/AbyV_[i]) <<
nl
975 <<
" delta Tsub: " << (Tw[i] - Tsatw[i])
979 else if (Tw[i] > tDNB[i] && Tw[i] < TLeiden[i])
982 regimeTypes_[i] = regimeType::transient;
985 alphatConv_[i] = 0.0;
991 relax*Qtb[i]*AbyV_[i]/
L[i]
1001 this->operator[](i) =
1006 /
max(hewSn[i], scalar(1
e-16))
1007 )/
max(liquidw[i], scalar(1
e-8)),
1013 Info<<
"Transient boiling: " <<
nl
1014 <<
" fraction Liq: " << fLiquid[i] <<
nl
1015 <<
" Heat flux: " << Qtb[i] <<
nl
1016 <<
" delta Tsub: " << (Tw[i] - Tsatw[i])
1021 else if (Tw[i] > TLeiden[i])
1023 regimeTypes_[i] = regimeType::film;
1026 alphatConv_[i] = 0.0;
1032 relax*htcFilmBoiling[i]
1033 *
max(Tw[i] - Tsatw[i], scalar(0))
1046 mDotL_[i]/AbyV_[i]/
max(hewSn[i], scalar(1
e-16))
1052 this->operator[](i) =
1054 alphaFilm[i]/
max(liquidw[i], scalar(1
e-8))
1060 Info<<
"Film boiling: " <<
nl
1061 <<
" fraction Liq: " << fLiquid[i] <<
nl
1063 << htcFilmBoiling[i]*(Tw[i] - Tsatw[i]) <<
nl
1064 <<
" delta Tsub: " << (Tw[i] - Tsatw[i])
1073 regimeTypes_[i] = regimeType::nonBoiling;
1080 this->operator[](i) =
1084 fLiquid[i]*(alphatConv_[i])
1085 /
max(liquidw[i], scalar(1
e-8)),
1096 fLiquid*liquidw*(*
this + alphaw)*hew.snGrad()
1101 Info<<
" qEffLiq: " <<
gMin(qEff) <<
" - "
1105 Info<<
" alphatl: " <<
gMin((*
this)) <<
" - "
1111 Info<<
" alphatlEff: " <<
gMin(liquidw*(*
this + alphaw))
1112 <<
" - " <<
gMax(liquidw*(*
this + alphaw)) <<
endl;
1114 scalar Qeff =
gSum(qEff*
patch().magSf());
1115 Info<<
" Effective heat transfer rate to liquid: " << Qeff
1128 switch (regimeTypes_[i])
1130 case regimeType::subcool:
1134 case regimeType::transient:
1138 case regimeType::film:
1142 case regimeType::nonBoiling:
1143 nNonBoilings[i] = 1;
1148 scalar nSubCool(
gSum(nSubCools));
1149 scalar nTransient(
gSum(nTransients));
1150 scalar nFilm(
gSum(nFilms));
1151 scalar nNonBoiling(
gSum(nNonBoilings));
1155 Info<<
" sub Cool faces : " << nSubCool <<
endl;
1156 Info<<
" transient faces : " << nTransient <<
endl;
1157 Info<<
" film faces : " << nFilm <<
endl;
1158 Info<<
" non-Boiling faces : " << nNonBoiling <<
endl;
1159 Info<<
" total faces : "
1160 << nSubCool + nTransient + nFilm + nNonBoiling
1165 nNonBoilings*fLiquid*(alphatConv_ + alphaw)
1170 Info<<
" Convective heat transfer: " << Qc <<
endl;
1174 relax*fLiquid*nFilms*htcFilmBoiling*(Tw - Tsatw)
1177 scalar QFilm =
gSum(qFilm*
patch().magSf());
1178 Info<<
" Film boiling heat transfer: " << QFilm <<
endl;
1180 Info<<
" Htc Film Boiling coeff: "
1181 <<
gMin(nFilms*htcFilmBoiling)
1183 <<
gMax(nFilms*htcFilmBoiling) <<
endl;
1186 gSum(fLiquid*nTransients*Qtb*
patch().magSf());
1187 Info<<
" Transient boiling heat transfer:" << Qtbtot
1198 A1*alphatConv_*hew.snGrad() +
qe() +
qq()
1202 scalar QsubCool =
gSum(qSubCool*
patch().magSf());
1204 Info<<
" Sub Cool boiling heat transfer: " << QsubCool
1215 <<
"Unknown phase type. Valid types are: "
1220 fixedValueFvPatchScalarField::updateCoeffs();
1228 os.writeEntry(
"phaseType", phaseTypeNames_[phaseType_]);
1230 relax_->writeData(
os);
1232 os.beginBlock(
"partitioningModel");
1233 partitioningModel_->write(
os);
1242 if (nucleationSiteModel_)
1244 os.beginBlock(
"nucleationSiteModel");
1245 nucleationSiteModel_->write(
os);
1249 if (departureDiamModel_)
1251 os.beginBlock(
"departureDiamModel");
1252 departureDiamModel_->write(
os);
1256 if (departureFreqModel_)
1258 os.beginBlock(
"departureFreqModel");
1259 departureFreqModel_->write(
os);
1263 if (nucleatingModel_)
1265 os.beginBlock(
"nucleateFluxModel");
1266 nucleatingModel_->write(
os);
1270 if (filmBoilingModel_)
1272 os.beginBlock(
"filmBoilingModel");
1273 filmBoilingModel_->write(
os);
1277 if (LeidenfrostModel_)
1279 os.beginBlock(
"LeidenfrostModel");
1280 LeidenfrostModel_->write(
os);
1286 os.beginBlock(
"CHFModel");
1287 CHFModel_->write(
os);
1293 os.beginBlock(
"CHFSubCoolModel");
1294 CHFSoobModel_->write(
os);
1300 os.beginBlock(
"MHFModel");
1301 MHFModel_->write(
os);
1307 os.beginBlock(
"TDNBModel");
1308 TDNBModel_->write(
os);
1312 os.writeEntry(
"K", K_);
1313 os.writeEntry(
"wp", wp_);
1314 os.writeEntry(
"liquidTatYplus", liquidTatYplus_);
1319 os.writeEntry(
"otherPhase", otherPhaseName_);
1326 writeEntry(
"value",
os);
1335 alphatWallBoilingWallFunctionFvPatchScalarField