64 namespace compressible
69 alphatWallBoilingWallFunctionFvPatchScalarField::
70 alphatWallBoilingWallFunctionFvPatchScalarField
73 const DimensionedField<scalar, volMesh>& iF
76 alphatPhaseChangeWallFunctionFvPatchScalarField(p, iF),
77 phaseType_(liquidPhase),
79 alphatConv_(p.size(), 0),
80 dDep_(p.size(), 1
e-5),
82 partitioningModel_(nullptr),
83 nucleationSiteModel_(nullptr),
84 departureDiamModel_(nullptr),
85 departureFreqModel_(nullptr)
87 AbyV_ = this->patch().magSf();
90 const label faceCelli = this->patch().faceCells()[facei];
91 AbyV_[facei] /= iF.mesh().V()[faceCelli];
100 const DimensionedField<scalar, volMesh>& iF,
101 const dictionary& dict
104 alphatPhaseChangeWallFunctionFvPatchScalarField(p, iF, dict),
105 phaseType_(phaseTypeNames_.
read(dict.
lookup(
"phaseType"))),
107 alphatConv_(p.size(), 0),
108 dDep_(p.size(), 1
e-5),
110 partitioningModel_(nullptr),
111 nucleationSiteModel_(nullptr),
112 departureDiamModel_(nullptr),
113 departureFreqModel_(nullptr)
116 if (internalField().
group() == otherPhaseName_)
119 <<
"otherPhase should be the name of the vapor phase that " 120 <<
"corresponds to the liquid base or vice versa" << nl
121 <<
"This phase: " << internalField().group() << nl
122 <<
"otherPhase: " << otherPhaseName_
133 dict.subDict(
"partitioningModel")
145 dict.subDict(
"partitioningModel")
148 nucleationSiteModel_ =
151 dict.subDict(
"nucleationSiteModel")
154 departureDiamModel_ =
157 dict.subDict(
"departureDiamModel")
160 departureFreqModel_ =
163 dict.subDict(
"departureFreqModel")
166 if (dict.found(
"dDep"))
171 if (dict.found(
"qQuenching"))
180 if (dict.found(
"alphatConv"))
182 alphatConv_ =
scalarField(
"alphatConv", dict, p.size());
185 AbyV_ = this->patch().magSf();
188 const label faceCelli = this->patch().faceCells()[facei];
189 AbyV_[facei] /= iF.mesh().V()[faceCelli];
197 const alphatWallBoilingWallFunctionFvPatchScalarField& psf,
199 const DimensionedField<scalar, volMesh>& iF,
200 const fvPatchFieldMapper& mapper
203 alphatPhaseChangeWallFunctionFvPatchScalarField
210 phaseType_(psf.phaseType_),
211 AbyV_(mapper(psf.AbyV_)),
212 alphatConv_(mapper(psf.alphatConv_)),
213 dDep_(mapper(psf.dDep_)),
214 qq_(mapper(psf.qq_)),
215 partitioningModel_(psf.partitioningModel_, false),
216 nucleationSiteModel_(psf.nucleationSiteModel_, false),
217 departureDiamModel_(psf.departureDiamModel_, false),
218 departureFreqModel_(psf.departureFreqModel_, false)
225 const alphatWallBoilingWallFunctionFvPatchScalarField& psf
228 alphatPhaseChangeWallFunctionFvPatchScalarField(psf),
229 phaseType_(psf.phaseType_),
231 alphatConv_(psf.alphatConv_),
234 partitioningModel_(psf.partitioningModel_, false),
235 nucleationSiteModel_(psf.nucleationSiteModel_, false),
236 departureDiamModel_(psf.departureDiamModel_, false),
237 departureFreqModel_(psf.departureFreqModel_, false)
244 const alphatWallBoilingWallFunctionFvPatchScalarField& psf,
245 const DimensionedField<scalar, volMesh>& iF
248 alphatPhaseChangeWallFunctionFvPatchScalarField(psf, iF),
249 phaseType_(psf.phaseType_),
251 alphatConv_(psf.alphatConv_),
254 partitioningModel_(psf.partitioningModel_, false),
255 nucleationSiteModel_(psf.nucleationSiteModel_, false),
256 departureDiamModel_(psf.departureDiamModel_, false),
257 departureFreqModel_(psf.departureFreqModel_, false)
265 const fvPatchFieldMapper& m
271 m(alphatConv_, alphatConv_);
285 const alphatWallBoilingWallFunctionFvPatchScalarField& tiptf =
286 refCast<const alphatWallBoilingWallFunctionFvPatchScalarField>(ptf);
288 AbyV_.rmap(tiptf.AbyV_, addr);
289 alphatConv_.rmap(tiptf.alphatConv_, addr);
290 dDep_.rmap(tiptf.dDep_, addr);
291 qq_.rmap(tiptf.qq_, addr);
303 const phaseSystem& fluid =
304 db().lookupObject<phaseSystem>(
"phaseProperties");
306 const word volatileSpecie(fluid.lookupOrDefault<word>(
"volatile",
"none"));
308 const label patchi = patch().index();
314 const phaseModel& vapor = fluid.phases()[internalField().group()];
322 const scalarField fLiquid(partitioningModel_->fLiquid(1 - vaporw));
332 const phaseModel& liquid = fluid.phases()[internalField().group()];
333 const phaseModel& vapor = fluid.phases()[otherPhaseName_];
335 const phasePair pair(vapor, liquid);
339 db().foundObject<saturationModel>
351 momentumTransportModel::typeName,
360 momentumTransportModel::typeName,
365 const nutWallFunctionFvPatchScalarField& nutw =
368 const scalar Cmu25(
pow025(nutw.Cmu()));
372 const tmp<scalarField> tmuw = turbModel.mu(patchi);
375 const rhoThermo& lThermo = liquid.thermo();
376 const rhoThermo& vThermo = vapor.thermo();
380 const tmp<volScalarField> tk = turbModel.k();
385 turbModel.U().boundaryField()[
patchi];
390 turbModel.rho().boundaryField()[
patchi];
393 vaporTurbModel.rho().boundaryField()[
patchi];
396 lThermo.he().boundaryField()[
patchi];
399 lThermo.p().boundaryField()[
patchi];
402 lThermo.T().boundaryField()[
patchi];
423 const saturationModel& satModel =
424 db().lookupObject<saturationModel>
428 const tmp<volScalarField> tTsat = satModel.Tsat(lThermo.p());
437 if (volatileSpecie !=
"none" && isA<rhoReactionThermo>(lThermo))
439 const basicSpecieMixture& composition =
440 refCast<const rhoReactionThermo>(lThermo).
composition();
445 composition.species()[volatileSpecie],
451 if (volatileSpecie !=
"none" && isA<rhoReactionThermo>(vThermo))
453 const basicSpecieMixture& composition =
454 refCast<const rhoReactionThermo>(vThermo).
composition();
459 composition.species()[volatileSpecie],
471 const scalarField fLiquid(partitioningModel_->fLiquid(liquidw));
477 for (
label i=0; i<maxIter; i++)
484 Prt_*(
log(nutw.E()*250)/nutw.kappa() + P)
497 Tw - (Tplus_y250/Tplus)*(Tw - Tc)
502 dDep_ = departureDiamModel_->dDeparture
515 departureFreqModel_->fDeparture
530 nucleationSiteModel_->N
548 rhoLiquidw*Cpw*(Tsatw - Tl)/(rhoVaporw*L)
553 fLiquid*4.8*
exp(
min(-Ja/80,
log(vGreat)))
560 if (volatileSpecie !=
"none" && !liquid.pure())
563 liquid.Y(volatileSpecie);
565 A2 *= Yvolatile.boundaryField()[
patchi];
572 + relax_*(1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*AbyV_;
584 (0.8/
max(fDep, small))/(
pi*alphaw/rhoLiquidw)
591 + relax_*(A2*hQ*
max(Tw - Tl, scalar(0)));
601 + (qq_ + qe())/
max(hew.snGrad(), scalar(1
e-16))
603 /
max(liquidw, scalar(1
e-8))
610 scalar maxErr(
max(
mag(TsupPrev - TsupNew)));
616 fLiquid*A1*(alphatConv_ + alphaw)*hew.snGrad()
621 liquidw*(*
this + alphaw)*hew.snGrad()
628 Info<<
" dDep_: " <<
gMin(dDep_) <<
" - " 630 Info<<
" fDep: " <<
gMin(fDep) <<
" - " 638 Info<<
" A2E: " <<
gMin(A2E) <<
" - " 640 Info<<
" dmdtW: " <<
gMin(dmdtf_) <<
" - " 644 Info<<
" qq: " <<
gMin(fLiquid*qq()) <<
" - " 646 Info<<
" qe: " <<
gMin(fLiquid*qe()) <<
" - " 648 Info<<
" qEff: " <<
gMin(qEff) <<
" - " 650 Info<<
" alphat: " <<
gMin(*
this) <<
" - " 652 Info<<
" alphatConv: " <<
gMin(alphatConv_)
653 <<
" - " <<
gMax(alphatConv_) <<
endl;
660 Info<<
"Wall boiling wall function iterations: " 665 else if (i == (maxIter - 1))
667 Info<<
"Maximum number of wall boiling wall function " 668 <<
"iterations (" << maxIter <<
") reached." << endl
669 <<
"Maximum change in wall temperature on last " 670 <<
"iteration: " << maxErr <<
endl;
678 Info<<
"Saturation model for phase pair " << pair.name()
679 <<
" not found. Wall boiling disabled." <<
endl;
688 <<
"Unknown phase type. Valid types are: " 693 fixedValueFvPatchScalarField::updateCoeffs();
701 writeEntry(os,
"phaseType", phaseTypeNames_[phaseType_]);
712 partitioningModel_->write(os);
720 partitioningModel_->write(os);
725 nucleationSiteModel_->write(os);
730 departureDiamModel_->write(os);
735 departureFreqModel_->write(os);
749 alphatWallBoilingWallFunctionFvPatchScalarField
const char *const group
Group name for atomic constants.
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.
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.
PhaseCompressibleMomentumTransportModel< phaseModel > phaseCompressibleMomentumTransportModel
Typedef for phaseCompressibleMomentumTransportModel.
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.
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)
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
basicSpecieMixture & composition
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)
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)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
tmp< scalarField > Psmooth(const scalarField &Prat) const
'P' function
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)