203 .patchInternalField()
241 void Foam::fv::wallBoiling::readCoeffs(
const dictionary&
dict)
245 saturationModelPtr_.reset
249 "saturationTemperature",
254 partitioningModel_.reset
258 dict.subDict(
"partitioningModel")
262 nucleationSiteModel_.reset
266 dict.subDict(
"nucleationSiteModel")
270 departureDiameterModel_.reset
274 dict.subDict(
"departureDiameterModel")
278 departureFrequencyModel_.reset
282 dict.subDict(
"departureFrequencyModel")
289 liquidTemperatureWallFunction_ =
290 dict.lookupOrDefault<Switch>(
"useLiquidTemperatureWallFunction",
true);
292 Prt_ =
dict.lookupOrDefault<scalar>(
"Prt",
dimless, 0.85);
294 bubbleWaitingTimeRatio_ =
295 dict.lookupOrDefault<scalar>(
"bubbleWaitingTimeRatio",
dimless, 0.8);
300 Foam::fv::wallBoiling::getLiquidTemperaturePatchField
302 const laggedProperties& lagProps,
308 isFixed.
setSize(lagProps.patch().size());
309 h.setSize(lagProps.patch().size());
310 hTaPlusQa.setSize(lagProps.patch().size());
313 liquid_.thermo().T().boundaryField()[lagProps.patchi];
316 alphatLiquid_.boundaryField()[lagProps.patchi];
318 if (isA<fixedValueFvPatchScalarField>(
T))
322 hTaPlusQa = rootVGreat*
T;
324 else if (isA<zeroGradientFvPatchScalarField>(
T))
330 else if (isA<fixedGradientFvPatchScalarField>(
T))
332 const fixedGradientFvPatchScalarField& Tfg =
333 refCast<const fixedGradientFvPatchScalarField>(
T);
337 hTaPlusQa = alphat*lagProps.CpLiquid*Tfg.gradient();
339 else if (isA<mixedFvPatchScalarField>(
T))
341 const mixedFvPatchScalarField& Tm =
342 refCast<const mixedFvPatchScalarField>(
T);
344 isFixed =
pos(Tm.valueFraction() - 1 + rootSmall);
347 /
max(1 - Tm.valueFraction(), rootVSmall)
350 *lagProps.patch().deltaCoeffs();
353 + alphat*lagProps.CpLiquid*Tm.refGrad();
358 <<
"Temperature boundary condition type not recognised"
368 const laggedProperties& lagProps,
382 if (!liquidTemperatureWallFunction_)
384 Tl = lagProps.TcLiquid;
394 log(lagProps.nutLiquid.E()*250)
395 /lagProps.nutLiquid.kappa()
406 lagProps.nutLiquid.E()
407 *
max(lagProps.yPlusLiquid, scalar(11))
409 /lagProps.nutLiquid.kappa()
414 Tl = TLiquid - (TyPlus250/TyPlus)*(TLiquid - lagProps.TcLiquid);
419 departureDiameterModel_->dDeparture
431 departureFrequencyModel_->fDeparture
443 nucleationSiteDensity =
444 nucleationSiteModel_->nucleationSiteDensity
461 *
max(lagProps.Tsat - Tl, scalar(0))
462 /(lagProps.rhoVapour*lagProps.L)
467 wetFraction*4.8*
exp(
min(-Ja/80,
log(vGreat)))
472 min(
pi*
sqr(dDeparture)*nucleationSiteDensity*Al/4, scalar(1))
477 min(
pi*
sqr(dDeparture)*nucleationSiteDensity*Al/4, scalar(5))
482 mDot = (1.0/6.0)*A2E*dDeparture*lagProps.rhoVapour*fDeparture*lagProps.AbyV;
487 2*lagProps.kappaByCpLiquid*lagProps.CpLiquid*fDeparture
490 bubbleWaitingTimeRatio_
491 /
max(fDeparture, small)
492 /(
pi*lagProps.kappaByCpLiquid/lagProps.rhoLiquid)
497 qQuenching = A2*hQ*
max(TLiquid - Tl, scalar(0));
500 qEvaporative = mDot*lagProps.L/lagProps.AbyV;
505 lagProps.patch().deltaCoeffs()
506 *
max(TLiquid - lagProps.TcLiquid, small*lagProps.TcLiquid)
509 A1*lagProps.alphatConvLiquid*lagProps.CpLiquid*gradT
517 const wallBoilingPhaseChangeRateFvPatchScalarField& mDot,
518 const laggedProperties& lagProps,
524 scalarField nucleationSiteDensity(mDot.nucleationSiteDensity_);
537 nucleationSiteDensity,
547 wallBoilingPhaseChangeRateFvPatchScalarField& mDot,
548 const laggedProperties& lagProps,
560 mDot.nucleationSiteDensity_,
568 void Foam::fv::wallBoiling::correctMDot()
const
575 if (!isPatchActive(
patchi))
continue;
580 mDot_[faceCells[i]] = scalar(0);
588 if (!isPatchActive(
patchi))
continue;
591 wallBoilingPhaseChangeRateFvPatchScalarField& mDot = mDotPfRef(
patchi);
594 const laggedProperties lagProps(*
this,
patchi);
598 partitioningModel_->wetFraction(lagProps.alphaLiquid);
602 (1 - mDot.wetFraction_)
603 /
max(1 - lagProps.alphaLiquid, rootSmall)
604 *lagProps.alphatConvVapour;
608 scalarField TLiquidIsFixed, TLiquidH, TLiquidHTaPlusQa;
610 getLiquidTemperaturePatchField
622 calcBoiling(mDot, lagProps,
T)
635 mDot.boiling_ =
neg(
R(lagProps.Tsat));
641 TLiquid + (TLiquid - lagProps.Tsat),
642 lagProps.Tsat*(1 +
sqrt(tolerance_))
646 gMax((1 - TLiquidIsFixed)*mDot.boiling_*(T1 -
T0)/(
T0 + T1));
647 for (;
e > tolerance_;
e /= 2)
656 TLiquidIsFixed*TLiquid + (1 - TLiquidIsFixed)*(
T0 + T1)/2
663 lagProps.patch().deltaCoeffs()
664 *
max(
T - lagProps.TcLiquid, small*lagProps.TcLiquid)
667 const scalarField q(evaluateBoiling(mDot, lagProps,
T));
671 q/lagProps.CpLiquid/gradT/
max(lagProps.alphaLiquid, rootSmall)
675 mDot.boiling_*alphatBoilingLiquid
676 + (1 - mDot.boiling_)*lagProps.alphatConvLiquid;
688 mDot_[faceCells[i]] += mDot[i];
701 const word& modelType,
712 readSpecie(coeffs(modelType,
dict), false)
715 liquid_(phases().
first()),
716 vapour_(phases().
second()),
724 liquidTemperatureWallFunction_(true),
726 bubbleWaitingTimeRatio_(NaN),
727 saturationModelPtr_(nullptr),
728 partitioningModel_(nullptr),
729 nucleationSiteModel_(nullptr),
730 departureDiameterModel_(nullptr),
731 departureFrequencyModel_(nullptr),
732 pressureEquationIndex_(-1),
762 return mDotPfRef(
patchi).boiling_;
774 mDotPfRef(
patchi).alphatLiquid_,
775 mDotPfRef(
patchi).alphatVapour_
787 name() +
":Lfraction",
811 if (!isPatchActive(
patchi))
continue;
821 if (mask[faceCells[i]])
continue;
823 d[faceCells[i]] += mDot.dDeparture_[i]*mDot[i]/mDot_[faceCells[i]];
845 if (!isPatchActive(
patchi))
continue;
855 nDot[faceCells[i]] += mDot.fDeparture_[i];
874 return mDot_.internalField();
881 if (!isPatchActive(
patchi))
889 refCast<const wallBoilingPhaseChangeRateFvPatchScalarField>
891 mDot_.boundaryField()[
patchi]
899 if (!isPatchActive(
patchi))
907 refCast<wallBoilingPhaseChangeRateFvPatchScalarField>
909 mDot_.boundaryFieldRef()[
patchi]
925 && (&
rho == &liquid_.rho() || &
rho == &vapour_.rho())
926 && &eqn.
psi() == &p_rgh_
931 if (pressureEquationIndex_ % 2 == 0) correctMDot();
932 pressureEquationIndex_ ++;
943 pressureEquationIndex_ = 0;
954 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 GeoMesh &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.
An ordered pair of two objects of type <Type> with first() and second() elements.
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,...
void reReadSpecie(const dictionary &dict) const
Re-read the names of the transferring specie.
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, fvMesh > > 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, fvMesh > > mDot() const
Return the mass transfer rate.
virtual const scalarField & active(const label) const
Return a mask indicating whether phase change is occurring.
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, fvMesh > > d() const
Return the diameter of nuclei.
virtual tmp< DimensionedField< scalar, fvMesh > > 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, fvMesh > > nDot() const
Return the number rate at which nuclei are generated.
Base class for fvModels that represent phase change at a wall.
const Pair< const volScalarField & > & alphats() const
Access the turbulent thermal diffusivities.
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions,...
static autoPtr< saturationTemperatureModel > New(const word &name, const dictionary &dict)
Select with name within a 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.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
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)
dimensionedScalar exp(const dimensionedScalar &ds)
const dimensionSet & dimless
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)
labelList second(const UList< labelPair > &p)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar log(const dimensionedScalar &ds)
labelList first(const UList< labelPair > &p)
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void inv(pointPatchField< tensor > &, const pointPatchField< tensor > &)
const dimensionSet & dimTime
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
const dimensionSet & dimDensity
static scalar R(const scalar a, const scalar x)
dimensionedScalar neg(const dimensionedScalar &ds)
Type gMax(const UList< Type > &f, const label comm)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensionedScalar neg0(const dimensionedScalar &ds)
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
UList< label > labelUList
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
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
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.