30 #include "twoPhaseSystem.H" 65 alphatWallBoilingWallFunctionFvPatchScalarField::phaseTypeNames_;
77 alphatWallBoilingWallFunctionFvPatchScalarField::
78 alphatWallBoilingWallFunctionFvPatchScalarField
81 const DimensionedField<scalar, volMesh>& iF
84 alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF),
85 phaseType_(liquidPhase),
88 alphatConv_(p.size(), 0),
89 dDep_(p.size(), 1
e-5),
91 partitioningModel_(nullptr),
92 nucleationSiteModel_(nullptr),
93 departureDiamModel_(nullptr),
94 departureFreqModel_(nullptr)
96 AbyV_ = this->patch().magSf();
99 const label faceCelli = this->patch().faceCells()[facei];
100 AbyV_[facei] /= iF.mesh().V()[faceCelli];
109 const DimensionedField<scalar, volMesh>& iF,
110 const dictionary& dict
114 phaseType_(phaseTypeNames_.
read(dict.
lookup(
"phaseType"))),
115 relax_(dict.lookupOrDefault<scalar>(
"relax", 0.5)),
117 alphatConv_(p.size(), 0),
118 dDep_(p.size(), 1
e-5),
120 partitioningModel_(nullptr),
121 nucleationSiteModel_(nullptr),
122 departureDiamModel_(nullptr),
123 departureFreqModel_(nullptr)
132 dict.subDict(
"partitioningModel")
144 dict.subDict(
"partitioningModel")
147 nucleationSiteModel_ =
150 dict.subDict(
"nucleationSiteModel")
153 departureDiamModel_ =
156 dict.subDict(
"departureDiamModel")
159 departureFreqModel_ =
162 dict.subDict(
"departureFreqModel")
165 if (dict.found(
"dDep"))
170 if (dict.found(
"qQuenching"))
179 if (dict.found(
"alphatConv"))
181 alphatConv_ =
scalarField(
"alphatConv", dict, p.size());
184 AbyV_ = this->patch().magSf();
187 const label faceCelli = this->patch().faceCells()[facei];
188 AbyV_[facei] /= iF.mesh().V()[faceCelli];
196 const alphatWallBoilingWallFunctionFvPatchScalarField& psf,
198 const DimensionedField<scalar, volMesh>& iF,
199 const fvPatchFieldMapper& mapper
211 alphatConv_(psf.alphatConv_, mapper),
212 dDep_(psf.dDep_, mapper),
213 qq_(psf.qq_, mapper),
214 partitioningModel_(psf.partitioningModel_),
215 nucleationSiteModel_(psf.nucleationSiteModel_),
216 departureDiamModel_(psf.departureDiamModel_),
217 departureFreqModel_(psf.departureFreqModel_)
224 const alphatWallBoilingWallFunctionFvPatchScalarField& psf
230 alphatConv_(psf.alphatConv_),
233 partitioningModel_(psf.partitioningModel_),
234 nucleationSiteModel_(psf.nucleationSiteModel_),
235 departureDiamModel_(psf.departureDiamModel_),
236 departureFreqModel_(psf.departureFreqModel_)
243 const alphatWallBoilingWallFunctionFvPatchScalarField& psf,
244 const DimensionedField<scalar, volMesh>& iF
250 alphatConv_(psf.alphatConv_),
253 partitioningModel_(psf.partitioningModel_),
254 nucleationSiteModel_(psf.nucleationSiteModel_),
255 departureDiamModel_(psf.departureDiamModel_),
256 departureFreqModel_(psf.departureFreqModel_)
270 if (!partitioningModel_.valid())
273 <<
"partitioningModel has not been constructed!" 278 const ThermalPhaseChangePhaseSystem
280 MomentumTransferPhaseSystem<twoPhaseSystem>
284 const ThermalPhaseChangePhaseSystem
286 MomentumTransferPhaseSystem<twoPhaseSystem>
290 db().lookupObject<phaseSystem>(
"phaseProperties")
293 const label patchi = patch().index();
299 const phaseModel& vapor
301 fluid.phase1().name() == internalField().group()
306 const phaseModel& liquid(
fluid.otherPhase(vapor));
316 partitioningModel_->fLiquid(liquidw)
328 if (!nucleationSiteModel_.valid())
331 <<
"nucleationSiteModel has not been constructed!" 336 if (!departureDiamModel_.valid())
339 <<
"departureDiameterModel has not been constructed!" 344 if (!departureFreqModel_.valid())
347 <<
"departureFrequencyModel has not been constructed!" 351 const phaseModel& liquid
353 fluid.phase1().name() == internalField().group()
358 const phaseModel& vapor(
fluid.otherPhase(liquid));
364 const tmp<scalarField> tnutw = turbModel.
nut(patchi);
370 const tmp<scalarField> tmuw = turbModel.mu(patchi);
373 const tmp<scalarField> talphaw = liquid.thermo().alpha(patchi);
376 const tmp<volScalarField> tk = turbModel.k();
381 turbModel.U().boundaryField()[
patchi];
386 turbModel.rho().boundaryField()[
patchi];
388 liquid.thermo().he().boundaryField()[
patchi];
391 liquid.thermo().T().boundaryField()[
patchi];
409 liquid.turbulence().rho().boundaryField()[
patchi];
412 vapor.turbulence().rho().boundaryField()[
patchi];
414 tmp<volScalarField> tCp = liquid.thermo().Cp();
419 const tmp<volScalarField> tTsat =
420 fluid.saturation().Tsat(liquid.thermo().p());
423 const scalarField Tsatc(Tsatw.patchInternalField());
426 liquid.thermo().p().boundaryField()[
patchi];
430 vapor.thermo().he(pw,Tsatc,patchi)-hew.patchInternalField()
436 const scalarField fLiquid(partitioningModel_->fLiquid(liquidw));
441 for (
label i=0; i<10; i++)
449 Tl =
max(Tc - 40, Tl);
454 nucleationSiteModel_->N
466 dDep_ = departureDiamModel_->dDeparture
479 departureFreqModel_->fDeparture
493 rhoLiquidw*Cpw*(Tsatw - Tl)/(rhoVaporw*L)
497 fLiquid*4.8*
exp(
min(-Ja/80,
log(VGREAT)))
508 + relax_*(1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*AbyV_;
517 2*(alphaw*Cpw)*fDep*
sqrt((0.8/fDep)/(
pi*alphaw/rhow))
521 qq_ = (A2*hQ*
max(Tw - Tl, scalar(0)));
530 + (qq_ + qe())/
max(hew.snGrad(), scalar(1
e-16))
532 /
max(liquidw, scalar(1
e-8))
539 scalar maxErr(
max(
mag(TsupPrev - TsupNew)));
545 Info<<
"Wall boiling wall function iterations: " 555 fLiquid*A1*(alphatConv_ + alphaw)*hew.snGrad()
560 liquidw*(*
this + alphaw)*hew.snGrad()
566 Info<<
" dDep_: " <<
gMin(dDep_) <<
" - " 568 Info<<
" fDep: " <<
gMin(fDep) <<
" - " 573 Info<<
" A2E: " <<
gMin(A2E) <<
" - " 578 Info<<
" qq: " <<
gMin(fLiquid*qq()) <<
" - " 580 Info<<
" qe: " <<
gMin(fLiquid*qe()) <<
" - " 582 Info<<
" qEff: " <<
gMin(qEff) <<
" - " 584 Info<<
" alphat: " <<
gMin(*
this) <<
" - " 586 Info<<
" alphatConv: " <<
gMin(alphatConv_)
587 <<
" - " <<
gMax(alphatConv_) <<
endl;
595 <<
"Unknown phase type. Valid types are: " 600 fixedValueFvPatchScalarField::updateCoeffs();
608 os.writeKeyword(
"phaseType") << phaseTypeNames_[phaseType_]
617 os.writeKeyword(
"partitioningModel") <<
nl;
619 partitioningModel_->write(os);
625 os.writeKeyword(
"partitioningModel") <<
nl;
627 partitioningModel_->write(os);
630 os.writeKeyword(
"nucleationSiteModel") <<
nl;
632 nucleationSiteModel_->write(os);
635 os.writeKeyword(
"departureDiamModel") <<
nl;
637 departureDiamModel_->write(os);
640 os.writeKeyword(
"departureFreqModel") <<
nl;
642 departureFreqModel_->write(os);
650 dDep_.writeEntry(
"dDep", os);
651 qq_.writeEntry(
"qQuenching", os);
652 alphatConv_.writeEntry(
"alphatConv", os);
653 writeEntry(
"value", os);
662 alphatWallBoilingWallFunctionFvPatchScalarField
dimensionedScalar Pr("Pr", dimless, laminarTransport)
static autoPtr< departureDiameterModel > New(const dictionary &dict)
Select null constructed.
tmp< scalarField > Psmooth(const scalarField &Prat) const
'P' function
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
#define forAll(list, i)
Loop across all elements in list.
scalarField dmdt_
Rate of phase-change.
ThermalDiffusivity< PhaseCompressibleTurbulenceModel< phaseModel > > phaseCompressibleTurbulenceModel
Typedef for phaseCompressibleTurbulenceModel.
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.
fvPatchField< vector > fvPatchVectorField
Ostream & indent(Ostream &os)
Indent stream.
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
const double e
Elementary charge.
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)
tmp< scalarField > calcAlphat(const scalarField &prevAlphat) const
Update turbulent thermal diffusivity.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
To & refCast(From &r)
Reference type cast template function.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar pow025(const dimensionedScalar &ds)
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
static autoPtr< nucleationSiteModel > New(const dictionary &dict)
Select null constructed.
virtual void write(Ostream &) const
Write.
Initialise the NamedEnum HashTable from the static list of names.
scalar Cmu_
Cmu coefficient.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
bool read(const char *, int32_t &)
stressControl lookup("compactNormalStress") >> compactNormalStress
dimensionedScalar exp(const dimensionedScalar &ds)
scalar Prt_
Turbulent Prandtl number.
fvPatchField< scalar > fvPatchScalarField
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
phaseType
Enumeration listing the possible operational modes.
errorManip< error > abort(error &err)
tmp< scalarField > yPlusTherm(const scalarField &P, const scalarField &Prat) const
Calculate y+ at the edge of the thermal laminar sublayer.
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.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
scalar kappa_
Von Karman constant.
scalarField mDotL_
Latent heat of the phase-change.
static autoPtr< departureFrequencyModel > New(const dictionary &dict)
Select null constructed.
virtual void write(Ostream &) const
Write.
dimensioned< scalar > mag(const dimensioned< Type > &)
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
makePatchTypeField(fvPatchScalarField, thermalBaffleFvPatchScalarField)