204 .patchInternalField()
242 void Foam::fv::wallBoiling::readCoeffs(
const dictionary&
dict)
244 saturationModelPtr_.reset
248 "saturationTemperature",
253 partitioningModel_.reset
257 dict.subDict(
"partitioningModel")
261 nucleationSiteModel_.reset
265 dict.subDict(
"nucleationSiteModel")
269 departureDiameterModel_.reset
273 dict.subDict(
"departureDiameterModel")
277 departureFrequencyModel_.reset
281 dict.subDict(
"departureFrequencyModel")
285 tolerance_ =
dict.lookupOrDefault<scalar>(
"tolerance",
unitless, rootSmall);
287 liquidTemperatureWallFunction_ =
288 dict.lookupOrDefault<Switch>(
"useLiquidTemperatureWallFunction",
true);
290 Prt_ =
dict.lookupOrDefault<scalar>(
"Prt",
dimless, 0.85);
292 bubbleWaitingTimeRatio_ =
293 dict.lookupOrDefault<scalar>(
"bubbleWaitingTimeRatio",
dimless, 0.8);
302 zeroFixedValueFvPatchScalarField::typeName
307 const bool liquidIsBoiling =
308 isA<alphatBoilingWallFunctionFvPatchScalarField>
310 alphatLiquid_.boundaryField()[
patchi]
312 const bool vapourIsBoiling =
313 isA<alphatBoilingWallFunctionFvPatchScalarField>
315 alphatVapour_.boundaryField()[
patchi]
318 if (liquidIsBoiling != vapourIsBoiling)
322 << (liquidIsBoiling ? alphatLiquid_ : alphatVapour_).
name()
323 <<
" has a boiling wall function on patch "
325 << (vapourIsBoiling ? alphatLiquid_ : alphatVapour_).
name()
332 wallBoilingPhaseChangeRateFvPatchScalarField::typeName;
336 return boundaryTypes;
341 Foam::fv::wallBoiling::getLiquidTemperaturePatchField
343 const laggedProperties& lagProps,
349 isFixed.
setSize(lagProps.patch().size());
350 h.setSize(lagProps.patch().size());
351 hTaPlusQa.setSize(lagProps.patch().size());
354 liquid_.thermo().T().boundaryField()[lagProps.patchi];
357 alphatLiquid_.boundaryField()[lagProps.patchi];
359 if (isA<fixedValueFvPatchScalarField>(
T))
363 hTaPlusQa = rootVGreat*
T;
365 else if (isA<zeroGradientFvPatchScalarField>(
T))
371 else if (isA<fixedGradientFvPatchScalarField>(
T))
373 const fixedGradientFvPatchScalarField& Tfg =
374 refCast<const fixedGradientFvPatchScalarField>(
T);
378 hTaPlusQa = alphat*lagProps.CpLiquid*Tfg.gradient();
380 else if (isA<mixedFvPatchScalarField>(
T))
382 const mixedFvPatchScalarField& Tm =
383 refCast<const mixedFvPatchScalarField>(
T);
385 isFixed =
pos(Tm.valueFraction() - 1 + rootSmall);
388 /
max(1 - Tm.valueFraction(), rootVSmall)
391 *lagProps.patch().deltaCoeffs();
394 + alphat*lagProps.CpLiquid*Tm.refGrad();
399 <<
"Temperature boundary condition type not recognised"
409 const laggedProperties& lagProps,
423 if (!liquidTemperatureWallFunction_)
425 Tl = lagProps.TcLiquid;
435 log(lagProps.nutLiquid.E()*250)
436 /lagProps.nutLiquid.kappa()
447 lagProps.nutLiquid.E()
448 *
max(lagProps.yPlusLiquid, scalar(11))
450 /lagProps.nutLiquid.kappa()
455 Tl = TLiquid - (TyPlus250/TyPlus)*(TLiquid - lagProps.TcLiquid);
460 departureDiameterModel_->dDeparture
472 departureFrequencyModel_->fDeparture
484 nucleationSiteDensity =
485 nucleationSiteModel_->nucleationSiteDensity
502 *
max(lagProps.Tsat - Tl, scalar(0))
503 /(lagProps.rhoVapour*lagProps.L)
508 wetFraction*4.8*
exp(
min(-Ja/80,
log(vGreat)))
513 min(
pi*
sqr(dDeparture)*nucleationSiteDensity*Al/4, scalar(1))
518 min(
pi*
sqr(dDeparture)*nucleationSiteDensity*Al/4, scalar(5))
523 mDot = (1.0/6.0)*A2E*dDeparture*lagProps.rhoVapour*fDeparture*lagProps.AbyV;
528 2*lagProps.kappaByCpLiquid*lagProps.CpLiquid*fDeparture
531 bubbleWaitingTimeRatio_
532 /
max(fDeparture, small)
533 /(
pi*lagProps.kappaByCpLiquid/lagProps.rhoLiquid)
538 qQuenching = A2*hQ*
max(TLiquid - Tl, scalar(0));
541 qEvaporative = mDot*lagProps.L/lagProps.AbyV;
546 lagProps.patch().deltaCoeffs()
547 *
max(TLiquid - lagProps.TcLiquid, small*lagProps.TcLiquid)
550 A1*lagProps.alphatConvLiquid*lagProps.CpLiquid*gradT
558 const wallBoilingPhaseChangeRateFvPatchScalarField& mDot,
559 const laggedProperties& lagProps,
565 scalarField nucleationSiteDensity(mDot.nucleationSiteDensity_);
578 nucleationSiteDensity,
588 wallBoilingPhaseChangeRateFvPatchScalarField& mDot,
589 const laggedProperties& lagProps,
601 mDot.nucleationSiteDensity_,
609 void Foam::fv::wallBoiling::correctMDot()
const
616 if (!isBoiling(
patchi))
continue;
621 mDot_[faceCells[i]] = scalar(0);
629 if (!isBoiling(
patchi))
continue;
632 wallBoilingPhaseChangeRateFvPatchScalarField& mDot = mDotPfRef(
patchi);
635 const laggedProperties lagProps(*
this,
patchi);
639 partitioningModel_->wetFraction(lagProps.alphaLiquid);
643 (1 - mDot.wetFraction_)
644 /
max(1 - lagProps.alphaLiquid, rootSmall)
645 *lagProps.alphatConvVapour;
649 scalarField TLiquidIsFixed, TLiquidH, TLiquidHTaPlusQa;
651 getLiquidTemperaturePatchField
663 calcBoiling(mDot, lagProps,
T)
682 TLiquid + (TLiquid - lagProps.Tsat),
683 lagProps.Tsat*(1 +
sqrt(tolerance_))
687 gMax((1 - TLiquidIsFixed)*isBoiling*(T1 -
T0)/(
T0 + T1));
688 for (;
e > tolerance_;
e /= 2)
697 TLiquidIsFixed*TLiquid + (1 - TLiquidIsFixed)*(
T0 + T1)/2
704 lagProps.patch().deltaCoeffs()
705 *
max(
T - lagProps.TcLiquid, small*lagProps.TcLiquid)
708 const scalarField q(evaluateBoiling(mDot, lagProps,
T));
712 q/lagProps.CpLiquid/gradT/
max(lagProps.alphaLiquid, rootSmall)
716 isBoiling*alphatBoilingLiquid
717 + (1 - isBoiling)*lagProps.alphatConvLiquid;
720 <<
": min/mean/max mDot = " <<
gMin(mDot) <<
'/'
727 mDot_[faceCells[i]] += mDot[i];
740 const word& modelType,
748 liquid_(fluid_.phases()[phaseNames().
first()]),
749 vapour_(fluid_.phases()[phaseNames().
second()]),
766 mesh().lookupObject<solvers::multiphaseEuler>(
solver::typeName).p_rgh
769 liquidTemperatureWallFunction_(true),
771 bubbleWaitingTimeRatio_(NaN),
772 saturationModelPtr_(nullptr),
773 partitioningModel_(nullptr),
774 nucleationSiteModel_(nullptr),
775 departureDiameterModel_(nullptr),
776 departureFrequencyModel_(nullptr),
777 pressureEquationIndex_(-1),
802 isA<wallBoilingPhaseChangeRateFvPatchScalarField>
804 mDot_.boundaryFieldRef()[
patchi]
816 name() +
":Lfraction",
840 if (!isBoiling(
patchi))
continue;
850 if (mask[faceCells[i]])
continue;
852 d[faceCells[i]] += mDot.dDeparture_[i]*mDot[i]/mDot_[faceCells[i]];
874 if (!isBoiling(
patchi))
continue;
884 nDot[faceCells[i]] += mDot.fDeparture_[i];
903 return mDot_.internalField();
918 refCast<const wallBoilingPhaseChangeRateFvPatchScalarField>
920 mDot_.boundaryField()[
patchi]
936 refCast<wallBoilingPhaseChangeRateFvPatchScalarField>
938 mDot_.boundaryFieldRef()[
patchi]
954 && (&
rho == &liquid_.rho() || &
rho == &vapour_.rho())
955 && &eqn.
psi() == &p_rgh_
960 if (pressureEquationIndex_ % 2 == 0) correctMDot();
961 pressureEquationIndex_ ++;
972 pressureEquationIndex_ = 0;
983 readCoeffs(coeffs(
dict));
scalar Cp(const scalar p, const scalar T) const
#define forAll(list, i)
Loop across all elements in list.
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...
static tmp< DimensionedField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Mesh &mesh, const dimensionSet &, const PrimitiveField< Type > &)
Return a temporary field constructed from name, mesh,.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void setSize(const label)
Reset size of List.
This boundary condition provides a thermal wall function for turbulent thermal diffusivity (usuallyal...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Base-class for fluid thermodynamic properties.
Abstract base class for fluid thermophysical transport models RAS, LES and laminar.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Finite volume model abstract base class.
static const dictionary & coeffs(const word &modelType, const dictionary &)
Return the coefficients sub-dictionary for a given model type.
const fvMesh & mesh() const
Return const access to the mesh database.
const word & name() const
Return const access to the source name.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
tmp< volScalarField::Internal > rho(const label i) const
Return the density.
virtual void addSup(fvMatrix< scalar > &eqn) const
Add a source term to a field-less proxy equation.
Mix-in interface for nucleation models. Provides access to properties of the nucleation process,...
Base class for phase change models.
virtual bool read(const dictionary &dict)
Read source dictionary.
const volScalarField & p() const
Access the pressure field.
Model for nucleate wall boiling between two phases on the surface of a number of wall patches.
virtual tmp< DimensionedField< scalar, volMesh > > Lfraction() const
Return the fraction of the latent heat that is transferred into.
virtual void correct()
Correct the fvModel.
wallBoiling(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
virtual tmp< DimensionedField< scalar, volMesh > > mDot() const
Return the mass transfer rate.
bool isBoiling(const label patchi) const
Is the given patch boiling?
virtual bool read(const dictionary &dict)
Read source dictionary.
const wallBoilingPhaseChangeRateFvPatchScalarField & mDotPf(const label patchi) const
Return the mass transfer rate for the given patch.
void addSup(const volScalarField &alpha, const volScalarField &rho, const volScalarField &heOrYi, fvMatrix< scalar > &eqn) const
Use phaseChange's source functions.
virtual tmp< DimensionedField< scalar, volMesh > > d() const
Return the diameter of nuclei.
virtual tmp< DimensionedField< scalar, volMesh > > tau() const
Return the nucleation time scale.
wallBoilingPhaseChangeRateFvPatchScalarField & mDotPfRef(const label patchi) const
Return the mass transfer rate for the given patch.
virtual tmp< DimensionedField< scalar, volMesh > > nDot() const
Return the number rate at which nuclei are generated.
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions,...
Class to represent a system of phases.
static autoPtr< saturationTemperatureModel > New(const dictionary &dict)
Select with dictionary.
Abstract base class for run-time selectable region solvers.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
static autoPtr< departureDiameterModel > New(const dictionary &dict)
Select null constructed.
static autoPtr< departureFrequencyModel > New(const dictionary &dict)
Select null constructed.
static autoPtr< nucleationSiteModel > New(const dictionary &dict)
Select null constructed.
static autoPtr< partitioningModel > New(const dictionary &dict)
Select null constructed.
This boundary condition is used for the phase change rate field of the wall boiling fvModel....
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
const dimensionedScalar h
Planck constant.
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionedScalar pos(const dimensionedScalar &ds)
List< word > wordList
A List of words.
dimensionedScalar exp(const dimensionedScalar &ds)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void pow025(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
const dimensionSet dimless
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
labelList second(const UList< labelPair > &p)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar log(const dimensionedScalar &ds)
labelList first(const UList< labelPair > &p)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimTime
const dimensionSet dimDensity
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
static scalar R(const scalar a, const scalar x)
dimensionedScalar neg(const dimensionedScalar &ds)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
Type gAverage(const FieldField< Field, Type > &f)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
dimensionedScalar neg0(const dimensionedScalar &ds)
void inv(LagrangianPatchField< tensor > &f, const LagrangianPatchField< tensor > &f1)
Type gMin(const FieldField< Field, Type > &f)
const unitConversion unitless
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
UList< label > labelUList
Ostream & indent(Ostream &os)
Indent stream.
Type gMax(const FieldField< Field, Type > &f)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
fvPatchField< scalar > fvPatchScalarField
faceListList boundary(nPatches)
fluidMulticomponentThermo & thermo
laggedProperties(const wallBoiling &model, const label patchi)
Constructor.
compressible::alphatJayatillekeWallFunctionFvPatchScalarField alphatJayatillekeWallFunction
Typedef to shorten the name of the Jayatilleke wall function.
const scalarField P
Smoothing function.
const label patchi
Patch index.
const scalarField alphatConvVapour
Phase convective turbulent thermal diffusivity.
const nutWallFunctionFvPatchScalarField & nutLiquid
Liquid viscosity wall function.
const scalarField yPlusLiquid
Dimensionless wall distance.
const scalarField alphatConvLiquid
Liquid convective turbulent thermal diffusivity.
const fluidThermophysicalTransportModel & ttmVapour
Vapour thermophysical transport model.
const fluidThermophysicalTransportModel & ttmLiquid
Liquid thermophysical transport model.
const scalarField & rhoLiquid
const scalarField & alphaVapour
Vapour volume fraction.
const wallBoiling & model
Wall function field.
const scalarField & alphaLiquid
Liquid volume fraction.
const fvPatch & patch() const
Patch.
const scalarField & rhoVapour
const scalarField & CpLiquid
Liquid heat capacity.
const scalarField Tsat
Saturation temperature.
const scalarField & nuLiquid
const scalarField TcLiquid
Cell temperature.
const scalarField kappaByCpLiquid
Liquid laminar thermal diffusivity.
const scalarField AbyV
Patch area by neighbouring cell volume ratio.
const scalarField L
Latent heat.