53 >::names[] = {
"vapour",
"vapor",
"liquid"};
69 namespace compressible
113 otherPhase(otherPhase),
114 alphaw(phase.boundaryField()[
patchi()]),
115 otherAlphaw(otherPhase.boundaryField()[
patchi()]),
116 interface(phase, otherPhase),
141 return field.patch();
147 return patch().index();
212 liquid.fluid().lookupOrDefault<
word>(
"volatile",
"none")
219 patch().boundaryMesh().mesh().V(),
224 rhoLiquidw(trhoLiquidw()),
226 rhoVapourw(trhoVapourw()),
239 ttm.momentumTransport(),
246 *
sqrt(ttm.momentumTransport().
k()().boundaryField()[
patchi()])
247 *ttm.momentumTransport().
y()[
patchi()]
254 rhoLiquidw*nuw/kappaByCp/field.Prt_
263 liquid.fluid().lookupInterfacialModel
269 .boundaryField()[
patchi()]
273 volatileSpecie !=
"none"
301 alphatWallBoilingWallFunctionFvPatchScalarField::calcBoiling
303 const boilingLiquidProperties& props,
314 if (!useLiquidTemperatureWallFunction_)
327 log(props.nutw.E()*250)
337 log(props.nutw.E()*
max(props.yPlus, scalar(11)))
343 Tl = Tw - (TyPlus250/TyPlus)*(Tw - props.Tc);
348 departureDiameterModel_->dDeparture
360 departureFrequencyModel_->fDeparture
372 nucleationSiteDensity =
373 nucleationSiteModel_->nucleationSiteDensity
390 *
max(props.Tsat - Tl, scalar(0))
391 /(props.rhoVapourw*props.L)
396 wetFraction_*4.8*
exp(
min(-Ja/80,
log(vGreat)))
401 min(
pi*
sqr(dDeparture)*nucleationSiteDensity*Al/4, scalar(1))
406 min(
pi*
sqr(dDeparture)*nucleationSiteDensity*Al/4, scalar(5))
409 if (props.volatileSpecie !=
"none" && !props.phase.pure())
413 .Y(props.volatileSpecie)
414 .boundaryField()[patch().index()];
421 dmdtf = (1.0/6.0)*A2E*dDeparture*props.rhoVapourw*fDeparture*props.AbyV;
426 2*props.kappaByCp*props.Cpw*fDeparture
430 /
max(fDeparture, small)
431 /(
pi*props.kappaByCp/props.rhoLiquidw)
436 qQuenching = A2*hQ*
max(Tw - Tl, scalar(0));
439 qEvaporative = dmdtf*props.L/props.AbyV;
444 patch().deltaCoeffs()*
max(Tw - props.Tc, small*props.Tc)
446 return A1*props.alphatConv*props.Cpw*gradTw + qQuenching_ + qEvaporative_;
451 alphatWallBoilingWallFunctionFvPatchScalarField::calcBoiling
453 const boilingLiquidProperties& props,
459 scalarField nucleationSiteDensity(nucleationSiteDensity_);
471 nucleationSiteDensity,
480 alphatWallBoilingWallFunctionFvPatchScalarField::evaluateBoiling
482 const boilingLiquidProperties& props,
493 nucleationSiteDensity_,
502 alphatWallBoilingWallFunctionFvPatchScalarField::getTemperaturePatchField
504 const boilingLiquidProperties& props,
510 isFixed.setSize(patch().size());
511 h.setSize(patch().size());
512 hTaPlusQa.setSize(patch().size());
515 props.phase.thermo().
T().boundaryField()[patch().index()];
517 if (isA<fixedValueFvPatchScalarField>(Tw))
521 hTaPlusQa = rootVGreat*Tw;
523 else if (isA<zeroGradientFvPatchScalarField>(Tw))
529 else if (isA<fixedGradientFvPatchScalarField>(Tw))
531 const fixedGradientFvPatchScalarField& Twm =
532 refCast<const fixedGradientFvPatchScalarField>(Tw);
536 hTaPlusQa = (*this)*props.Cpw*Twm.gradient();
538 else if (isA<mixedFvPatchScalarField>(Tw))
540 const mixedFvPatchScalarField& Twm =
541 refCast<const mixedFvPatchScalarField>(Tw);
543 isFixed =
pos(Twm.valueFraction() - 1 + rootSmall);
546 /
max(1 - Twm.valueFraction(), rootVSmall)
547 *(*this)*props.Cpw*patch().deltaCoeffs();
550 + (*this)*props.Cpw*Twm.refGrad();
555 <<
"Temperature boundary condition type not recognised"
565 alphatWallBoilingWallFunctionFvPatchScalarField::
566 alphatWallBoilingWallFunctionFvPatchScalarField
573 fixedValueFvPatchScalarField(
p, iF,
dict),
576 phaseType_(phaseTypeNames_.
read(
dict.lookup(
"phaseType"))),
577 useLiquidTemperatureWallFunction_
579 dict.lookupOrDefault<
Switch>(
"useLiquidTemperatureWallFunction", true)
581 tolerance_(
dict.lookupOrDefault<scalar>(
"tolerance", rootSmall)),
583 Prt_(
dict.lookupOrDefault<scalar>(
"Prt", 0.85)),
584 tau_(
dict.lookupOrDefault<scalar>(
"bubbleWaitingTimeRatio", 0.8)),
586 partitioningModel_(nullptr),
587 nucleationSiteModel_(nullptr),
588 departureDiameterModel_(nullptr),
589 departureFrequencyModel_(nullptr),
591 wetFraction_(
p.size(), 0),
592 dDeparture_(
p.size(), 1
e-5),
593 fDeparture_(
p.size(), 0),
594 nucleationSiteDensity_(
p.size(), 0),
595 qQuenching_(
p.size(), 0),
596 qEvaporative_(
p.size(), 0),
603 dict.subDict(
"partitioningModel")
608 nucleationSiteModel_ =
611 dict.subDict(
"nucleationSiteModel")
613 departureDiameterModel_ =
616 dict.subDictBackwardsCompatible
618 {
"departureDiameterModel",
"departureDiamModel"}
621 departureFrequencyModel_ =
624 dict.subDictBackwardsCompatible
626 {
"departureFrequencyModel",
"departureFreqModel"}
632 auto readFieldBackwardsCompatible = [&
p]
641 if (
dict.found(keywords[i]))
650 readFieldBackwardsCompatible
653 {
"wetFraction",
"wallLiquidFraction"},
659 readFieldBackwardsCompatible(
dict, {
"dDeparture"}, dDeparture_);
661 readFieldBackwardsCompatible
664 {
"fDeparture",
"depFrequency"},
668 readFieldBackwardsCompatible
671 {
"nucleationSiteDensity",
"nucSiteDensity"},
672 nucleationSiteDensity_
675 readFieldBackwardsCompatible(
dict, {
"qQuenching"}, qQuenching_);
677 readFieldBackwardsCompatible(
dict, {
"qEvaporative"}, qEvaporative_);
679 readFieldBackwardsCompatible(
dict, {
"dmdtf"}, dmdtf_);
693 fixedValueFvPatchScalarField(psf,
p, iF, mapper),
696 phaseType_(psf.phaseType_),
697 useLiquidTemperatureWallFunction_(psf.useLiquidTemperatureWallFunction_),
698 tolerance_(psf.tolerance_),
703 partitioningModel_(psf.partitioningModel_, false),
704 nucleationSiteModel_(psf.nucleationSiteModel_, false),
705 departureDiameterModel_(psf.departureDiameterModel_, false),
706 departureFrequencyModel_(psf.departureFrequencyModel_, false),
708 wetFraction_(mapper(psf.wetFraction_)),
709 dDeparture_(mapper(psf.dDeparture_)),
710 fDeparture_(mapper(psf.fDeparture_)),
711 nucleationSiteDensity_(mapper(psf.nucleationSiteDensity_)),
712 qQuenching_(mapper(psf.qQuenching_)),
713 qEvaporative_(mapper(psf.qEvaporative_)),
714 dmdtf_(mapper(psf.dmdtf_))
725 fixedValueFvPatchScalarField(psf, iF),
728 phaseType_(psf.phaseType_),
729 useLiquidTemperatureWallFunction_(psf.useLiquidTemperatureWallFunction_),
730 tolerance_(psf.tolerance_),
735 partitioningModel_(psf.partitioningModel_, false),
736 nucleationSiteModel_(psf.nucleationSiteModel_, false),
737 departureDiameterModel_(psf.departureDiameterModel_, false),
738 departureFrequencyModel_(psf.departureFrequencyModel_, false),
740 wetFraction_(psf.wetFraction_),
741 dDeparture_(psf.dDeparture_),
742 fDeparture_(psf.fDeparture_),
743 nucleationSiteDensity_(psf.nucleationSiteDensity_),
744 qQuenching_(psf.qQuenching_),
745 qEvaporative_(psf.qEvaporative_),
758 fixedValueFvPatchScalarField::map(ptf, mapper);
761 refCast<const alphatWallBoilingWallFunctionFvPatchScalarField>(ptf);
763 mapper(wetFraction_, tiptf.wetFraction_);
764 mapper(dDeparture_, tiptf.dDeparture_);
765 mapper(fDeparture_, tiptf.fDeparture_);
766 mapper(nucleationSiteDensity_, tiptf.nucleationSiteDensity_);
767 mapper(qQuenching_, tiptf.qQuenching_);
768 mapper(qEvaporative_, tiptf.qEvaporative_);
769 mapper(dmdtf_, tiptf.dmdtf_);
778 fixedValueFvPatchScalarField::reset(ptf);
781 refCast<const alphatWallBoilingWallFunctionFvPatchScalarField>(ptf);
783 wetFraction_.
reset(tiptf.wetFraction_);
784 dDeparture_.
reset(tiptf.dDeparture_);
785 fDeparture_.
reset(tiptf.fDeparture_);
786 nucleationSiteDensity_.
reset(tiptf.nucleationSiteDensity_);
787 qQuenching_.
reset(tiptf.qQuenching_);
788 qEvaporative_.
reset(tiptf.qEvaporative_);
789 dmdtf_.
reset(tiptf.dmdtf_);
817 wetFraction_ = partitioningModel_->wetFraction(props.
otherAlphaw);
848 Info<<
"Saturation model for interface "
850 <<
" not found. Wall boiling disabled." <<
endl;
861 wetFraction_ = partitioningModel_->wetFraction(props.
alphaw);
867 getTemperaturePatchField
878 return calcBoiling(props, Tw) - TwpfHTaPlusQa + TwpfH*Tw;
896 Twpf + (Twpf - props.
Tsat),
901 gMax((1 - TwpfIsFixed)*isBoiling*(Tw1 - Tw0)/(Tw0 + Tw1));
902 for (;
e > tolerance_;
e /= 2)
906 Tw0 =
pos(rM)*Tw0 +
neg0(rM)*TwM;
907 Tw1 =
pos(rM)*TwM +
neg0(rM)*Tw1;
911 TwpfIsFixed*Twpf + (1 - TwpfIsFixed)*(Tw0 + Tw1)/2
918 patch().deltaCoeffs()*
max(Tw - props.
Tc, small*props.
Tc)
925 isBoiling*q/props.
Cpw/gradTw/
max(props.
alphaw, rootSmall)
934 fixedValueFvPatchScalarField::updateCoeffs();
948 "useLiquidTemperatureWallFunction",
949 useLiquidTemperatureWallFunction_
955 writeEntry(os,
"bubbleWaitingTimeRatio", tau_);
960 partitioningModel_->write(os);
967 nucleationSiteModel_->write(os);
972 departureDiameterModel_->write(os);
977 departureFrequencyModel_->write(os);
988 writeEntry(os,
"nucleationSiteDensity", nucleationSiteDensity_);
990 writeEntry(os,
"qEvaporative", qEvaporative_);
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...
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors)
void reset(const Field< Type > &)
Reset the field values to the given field.
Initialise the NamedEnum HashTable from the static list of names.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
This boundary condition provides a thermal wall function for turbulent thermal diffusivity (usuallyal...
Abstract base-class for all alphatWallFunctions supporting phase-change.
virtual void write(Ostream &) const
Write.
const word otherPhaseName_
Name of the other phase.
A thermal wall function for simulation of subcooled nucleate wall boiling with runtime selectable sub...
virtual void write(Ostream &) const
Write.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
phaseType
Enumeration listing the possible operational modes.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static const NamedEnum< phaseType, 3 > phaseTypeNames_
Heat source type names.
virtual void map(const fvPatchScalarField &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
alphatWallBoilingWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base class for fluid thermophysical transport models RAS, LES and laminar.
Foam::fvPatchFieldMapper.
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.
Wrapper around saturationTemperatureModel to facilitate convenient construction on interfaces.
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions,...
Class to represent an interface between phases. Derivations can further specify the configuration of ...
virtual word name() const
Name.
Class to represent a system of phases and model interfacial transfers between them.
bool foundInterfacialModel(const phaseInterface &interface) const
Check availability of a sub model for a given interface.
static const word propertiesName
Default name of the phase properties dictionary.
const phaseModelList & phases() const
Return the phase models.
A class for managing temporary objects.
Upwind interpolation scheme class.
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.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
makePatchTypeField(fvPatchScalarField, alphatJayatillekeWallFunctionFvPatchScalarField)
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
const dimensionedScalar h
Planck constant.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionedScalar pos(const dimensionedScalar &ds)
dimensionedScalar exp(const dimensionedScalar &ds)
bool read(const char *, int32_t &)
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.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
To & refCast(From &r)
Reference type cast template function.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar log(const dimensionedScalar &ds)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensionedScalar sqrt(const dimensionedScalar &ds)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
static scalar R(const scalar a, const scalar x)
dimensionedScalar neg(const dimensionedScalar &ds)
dimensionedScalar neg0(const dimensionedScalar &ds)
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
word name(const complex &)
Return a string representation of a complex.
Ostream & indent(Ostream &os)
Indent stream.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Type gMax(const FieldField< Field, Type > &f)
fvPatchField< scalar > fvPatchScalarField
dimensionedScalar pow025(const dimensionedScalar &ds)
fluidMulticomponentThermo & thermo
const word volatileSpecie
Name of the volatile specie.
const scalarField & rhoLiquidw
const scalarField Tc
Cell temperature.
const scalarField P
Smoothing function.
const scalarField yPlus
Dimensionless wall distance.
const scalarField & Cpw
Liquid heat capacity.
boilingLiquidProperties(const alphatWallBoilingWallFunctionFvPatchScalarField &field, const phaseModel &liquid, const phaseModel &vapour)
Constructor.
const nutWallFunctionFvPatchScalarField & nutw
Liquid viscosity wall function.
const scalarField kappaByCp
Liquid laminar thermal diffusivity.
const scalarField Tsat
Saturation temperature.
const tmp< scalarField > trhoVapourw
Vapour density.
const tmp< scalarField > tnuw
Liquid laminar kinematic viscosity.
const scalarField & rhoVapourw
const scalarField AbyV
Patch area by neighbouring cell volume ratio.
const tmp< scalarField > trhoLiquidw
Liquid density.
const scalarField L
Latent heat.
const scalarField alphatConv
Phase convective turbulent thermal diffusivity.
const phaseModel & otherPhase
Other phase.
const phaseModel & phase
Phase.
const phaseInterface interface
Interface.
label patchi() const
Patch index.
const scalarField & otherAlphaw
Other volume fraction.
properties(const alphatWallBoilingWallFunctionFvPatchScalarField &field, const phaseModel &phase, const phaseModel &otherPhase)
Constructor.
const fluidThermophysicalTransportModel & ttm
Phase thermophysical transport model.
const fvPatch & patch() const
Patch.
const scalarField & alphaw
Volume fraction.
const alphatWallBoilingWallFunctionFvPatchScalarField & field
Wall function field.