65 namespace compressible
70 alphatWallBoilingWallFunctionFvPatchScalarField::
71 alphatWallBoilingWallFunctionFvPatchScalarField
74 const DimensionedField<scalar, volMesh>& iF
77 alphatPhaseChangeWallFunctionFvPatchScalarField(p, iF),
78 phaseType_(liquidPhase),
80 alphatConv_(p.size(), 0),
81 dDep_(p.size(), 1
e-5),
83 partitioningModel_(nullptr),
84 nucleationSiteModel_(nullptr),
85 departureDiamModel_(nullptr),
86 departureFreqModel_(nullptr)
88 AbyV_ = this->patch().magSf();
91 const label faceCelli = this->patch().faceCells()[facei];
92 AbyV_[facei] /= iF.mesh().V()[faceCelli];
101 const DimensionedField<scalar, volMesh>& iF,
102 const dictionary& dict
105 alphatPhaseChangeWallFunctionFvPatchScalarField(p, iF, dict),
106 phaseType_(phaseTypeNames_.
read(dict.
lookup(
"phaseType"))),
108 alphatConv_(p.size(), 0),
109 dDep_(p.size(), 1
e-5),
111 partitioningModel_(nullptr),
112 nucleationSiteModel_(nullptr),
113 departureDiamModel_(nullptr),
114 departureFreqModel_(nullptr)
117 if (internalField().
group() == otherPhaseName_)
120 <<
"otherPhase should be the name of the vapor phase that " 121 <<
"corresponds to the liquid base or vice versa" << nl
122 <<
"This phase: " << internalField().group() << nl
123 <<
"otherPhase: " << otherPhaseName_
134 dict.subDict(
"partitioningModel")
146 dict.subDict(
"partitioningModel")
149 nucleationSiteModel_ =
152 dict.subDict(
"nucleationSiteModel")
155 departureDiamModel_ =
158 dict.subDict(
"departureDiamModel")
161 departureFreqModel_ =
164 dict.subDict(
"departureFreqModel")
167 if (dict.found(
"dDep"))
172 if (dict.found(
"qQuenching"))
181 if (dict.found(
"alphatConv"))
183 alphatConv_ =
scalarField(
"alphatConv", dict, p.size());
186 AbyV_ = this->patch().magSf();
189 const label faceCelli = this->patch().faceCells()[facei];
190 AbyV_[facei] /= iF.mesh().V()[faceCelli];
198 const alphatWallBoilingWallFunctionFvPatchScalarField& psf,
200 const DimensionedField<scalar, volMesh>& iF,
201 const fvPatchFieldMapper& mapper
204 alphatPhaseChangeWallFunctionFvPatchScalarField
211 phaseType_(psf.phaseType_),
212 AbyV_(mapper(psf.AbyV_)),
213 alphatConv_(mapper(psf.alphatConv_)),
214 dDep_(mapper(psf.dDep_)),
215 qq_(mapper(psf.qq_)),
216 partitioningModel_(psf.partitioningModel_, false),
217 nucleationSiteModel_(psf.nucleationSiteModel_, false),
218 departureDiamModel_(psf.departureDiamModel_, false),
219 departureFreqModel_(psf.departureFreqModel_, false)
226 const alphatWallBoilingWallFunctionFvPatchScalarField& psf,
227 const DimensionedField<scalar, volMesh>& iF
230 alphatPhaseChangeWallFunctionFvPatchScalarField(psf, iF),
231 phaseType_(psf.phaseType_),
233 alphatConv_(psf.alphatConv_),
236 partitioningModel_(psf.partitioningModel_, false),
237 nucleationSiteModel_(psf.nucleationSiteModel_, false),
238 departureDiamModel_(psf.departureDiamModel_, false),
239 departureFreqModel_(psf.departureFreqModel_, false)
247 const fvPatchFieldMapper& m
253 m(alphatConv_, alphatConv_);
267 const alphatWallBoilingWallFunctionFvPatchScalarField& tiptf =
268 refCast<const alphatWallBoilingWallFunctionFvPatchScalarField>(ptf);
270 AbyV_.rmap(tiptf.AbyV_, addr);
271 alphatConv_.rmap(tiptf.alphatConv_, addr);
272 dDep_.rmap(tiptf.dDep_, addr);
273 qq_.rmap(tiptf.qq_, addr);
284 const alphatWallBoilingWallFunctionFvPatchScalarField& tiptf =
285 refCast<const alphatWallBoilingWallFunctionFvPatchScalarField>(ptf);
287 AbyV_.reset(tiptf.AbyV_);
288 alphatConv_.reset(tiptf.alphatConv_);
289 dDep_.reset(tiptf.dDep_);
290 qq_.reset(tiptf.qq_);
302 const phaseSystem& fluid =
305 const word volatileSpecie(fluid.lookupOrDefault<word>(
"volatile",
"none"));
307 const label patchi = patch().index();
313 const phaseModel& vapor = fluid.phases()[internalField().group()];
321 const scalarField fLiquid(partitioningModel_->fLiquid(1 - vaporw));
331 const phaseModel& liquid = fluid.phases()[internalField().group()];
332 const phaseModel& vapor = fluid.phases()[otherPhaseName_];
334 const phaseInterface interface(vapor, liquid);
336 if (fluid.foundInterfacialModel<saturationModel>(interface))
344 momentumTransportModel::typeName,
353 momentumTransportModel::typeName,
358 const nutWallFunctionFvPatchScalarField& nutw =
361 const scalar Cmu25(
pow025(nutw.Cmu()));
365 const tmp<scalarField> tnuw = turbModel.nu(patchi);
368 const rhoThermo& lThermo = liquid.thermo();
370 const tmp<scalarField> talphaw
372 lThermo.kappa().boundaryField()[
patchi]
373 /lThermo.Cp().boundaryField()[
patchi]
377 const tmp<volScalarField> tk = turbModel.k();
382 turbModel.U().boundaryField()[
patchi];
387 turbModel.rho().boundaryField()[
patchi];
390 vaporTurbModel.rho().boundaryField()[
patchi];
393 lThermo.he().boundaryField()[
patchi];
396 lThermo.T().boundaryField()[
patchi];
417 const saturationModel& satModel =
418 fluid.lookupInterfacialModel<saturationModel>(interface);
419 const tmp<volScalarField> tTsat = satModel.Tsat(lThermo.p());
426 volatileSpecie !=
"none" 427 ? -refCast<const heatTransferPhaseSystem>(fluid)
437 : -refCast<const heatTransferPhaseSystem>(fluid)
452 const scalarField fLiquid(partitioningModel_->fLiquid(liquidw));
458 for (
label i=0; i<maxIter; i++)
465 Prt_*(
log(nutw.E()*250)/nutw.kappa() + P)
478 Tw - (Tplus_y250/Tplus)*(Tw - Tc)
483 dDep_ = departureDiamModel_->dDeparture
496 departureFreqModel_->fDeparture
511 nucleationSiteModel_->N
529 rhoLiquidw*Cpw*(Tsatw - Tl)/(rhoVaporw*L)
534 fLiquid*4.8*
exp(
min(-Ja/80,
log(vGreat)))
541 if (volatileSpecie !=
"none" && !liquid.pure())
544 liquid.Y(volatileSpecie);
546 A2 *= Yvolatile.boundaryField()[
patchi];
553 + relax_*(1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*AbyV_;
561 (0.8/
max(fDep, small))/(
pi*alphaw/rhoLiquidw)
568 + relax_*(A2*hQ*
max(Tw - Tl, scalar(0)));
581 + (qq_ + qe)/
max(hew.snGrad(), scalar(1
e-16))
583 /
max(liquidw, scalar(1
e-8))
590 scalar maxErr(
max(
mag(TsupPrev - TsupNew)));
596 fLiquid*A1*(alphatConv_ + alphaw)*hew.snGrad()
601 liquidw*(*
this + alphaw)*hew.snGrad()
608 Info<<
" dDep_: " <<
gMin(dDep_) <<
" - " 610 Info<<
" fDep: " <<
gMin(fDep) <<
" - " 618 Info<<
" A2E: " <<
gMin(A2E) <<
" - " 620 Info<<
" dmdtW: " <<
gMin(dmdtf_) <<
" - " 624 Info<<
" qq: " <<
gMin(fLiquid*qq_) <<
" - " 626 Info<<
" qe: " <<
gMin(fLiquid*qe) <<
" - " 628 Info<<
" qEff: " <<
gMin(qEff) <<
" - " 630 Info<<
" alphat: " <<
gMin(*
this) <<
" - " 632 Info<<
" alphatConv: " <<
gMin(alphatConv_)
633 <<
" - " <<
gMax(alphatConv_) <<
endl;
640 Info<<
"Wall boiling wall function iterations: " 645 else if (i == (maxIter - 1))
647 Info<<
"Maximum number of wall boiling wall function " 648 <<
"iterations (" << maxIter <<
") reached." <<
endl 649 <<
"Maximum change in wall temperature on last " 650 <<
"iteration: " << maxErr <<
endl;
658 Info<<
"Saturation model for interface " << interface.name()
659 <<
" not found. Wall boiling disabled." <<
endl;
668 <<
"Unknown phase type. Valid types are: " 673 fixedValueFvPatchScalarField::updateCoeffs();
681 writeEntry(os,
"phaseType", phaseTypeNames_[phaseType_]);
692 partitioningModel_->write(os);
700 partitioningModel_->write(os);
705 nucleationSiteModel_->write(os);
710 departureDiamModel_->write(os);
715 departureFreqModel_->write(os);
729 alphatWallBoilingWallFunctionFvPatchScalarField
const char *const group
Group name for atomic constants.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
static autoPtr< departureDiameterModel > New(const dictionary &dict)
Select null constructed.
static const word propertiesName
Default name of the phase properties dictionary.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
FvWallInfoData< WallInfo, label > 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.
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
virtual void write(Ostream &) const
Write.
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< scalarField > calcAlphat(const scalarField &prevAlphat) const
Evaluate the turbulent thermal diffusivity.
void evaluate(GeometricField< Type, PatchField, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, PatchField, GeoMesh > &x)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
scalar Prt_
Turbulent Prandtl number.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar pow025(const dimensionedScalar &ds)
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
static autoPtr< nucleationSiteModel > New(const dictionary &dict)
Select null constructed.
static const NamedEnum< phaseType, 2 > phaseTypeNames_
Heat source type names.
Initialise the NamedEnum HashTable from the static list of names.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
static const nutWallFunctionFvPatchScalarField & nutw(const momentumTransportModel &turbModel, const label patchi)
Return the nut patchField for the given wall patch.
bool read(const char *, int32_t &)
stressControl lookup("compactNormalStress") >> compactNormalStress
dimensionedScalar exp(const dimensionedScalar &ds)
fvPatchField< scalar > fvPatchScalarField
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static word groupName(Name name, const word &group)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
List< label > labelList
A List of labels.
tmp< scalarField > yPlusTherm(const nutWallFunctionFvPatchScalarField &nutw, const scalarField &P, const scalarField &Prat) const
Calculate y+ at the edge of the thermal laminar sublayer.
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)
tmp< scalarField > Psmooth(const scalarField &Prat) const
'P' function
phaseCompressibleMomentumTransportModel momentumTransportModel
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
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.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
makePatchTypeField(fvPatchScalarField, thermalBaffleFvPatchScalarField)