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()),
235 ttm.momentumTransport(),
242 *
sqrt(ttm.momentumTransport().
k()().boundaryField()[
patchi()])
243 *ttm.momentumTransport().yb()[
patchi()]
250 rhoLiquidw*nuw/kappaByCp/field.Prt_
259 liquid.fluid().lookupInterfacialModel
265 .boundaryField()[
patchi()]
269 volatileSpecie !=
"none"
297 alphatWallBoilingWallFunctionFvPatchScalarField::calcBoiling
299 const boilingLiquidProperties& props,
310 if (!useLiquidTemperatureWallFunction_)
323 log(props.nutw.E()*250)
333 log(props.nutw.E()*
max(props.yPlus, scalar(11)))
339 Tl = Tw - (TyPlus250/TyPlus)*(Tw - props.Tc);
344 departureDiameterModel_->dDeparture
356 departureFrequencyModel_->fDeparture
368 nucleationSiteDensity =
369 nucleationSiteModel_->nucleationSiteDensity
386 *
max(props.Tsat - Tl, scalar(0))
387 /(props.rhoVapourw*props.L)
392 wetFraction_*4.8*
exp(
min(-Ja/80,
log(vGreat)))
397 min(
pi*
sqr(dDeparture)*nucleationSiteDensity*Al/4, scalar(1))
402 min(
pi*
sqr(dDeparture)*nucleationSiteDensity*Al/4, scalar(5))
405 if (props.volatileSpecie !=
"none" && !props.phase.pure())
409 .Y(props.volatileSpecie)
410 .boundaryField()[patch().index()];
417 dmdtf = (1.0/6.0)*A2E*dDeparture*props.rhoVapourw*fDeparture*props.AbyV;
422 2*props.kappaByCp*props.Cpw*fDeparture
426 /
max(fDeparture, small)
427 /(
pi*props.kappaByCp/props.rhoLiquidw)
432 qQuenching = A2*hQ*
max(Tw - Tl, scalar(0));
435 qEvaporative = dmdtf*props.L/props.AbyV;
440 patch().deltaCoeffs()*
max(Tw - props.Tc, small*props.Tc)
442 return A1*props.alphatConv*props.Cpw*gradTw + qQuenching_ + qEvaporative_;
447 alphatWallBoilingWallFunctionFvPatchScalarField::calcBoiling
449 const boilingLiquidProperties& props,
455 scalarField nucleationSiteDensity(nucleationSiteDensity_);
467 nucleationSiteDensity,
476 alphatWallBoilingWallFunctionFvPatchScalarField::evaluateBoiling
478 const boilingLiquidProperties& props,
489 nucleationSiteDensity_,
498 alphatWallBoilingWallFunctionFvPatchScalarField::getTemperaturePatchField
500 const boilingLiquidProperties& props,
506 isFixed.setSize(patch().size());
507 h.setSize(patch().size());
508 hTaPlusQa.setSize(patch().size());
511 props.phase.thermo().
T().boundaryField()[patch().index()];
513 if (isA<fixedValueFvPatchScalarField>(Tw))
517 hTaPlusQa = rootVGreat*Tw;
519 else if (isA<zeroGradientFvPatchScalarField>(Tw))
525 else if (isA<fixedGradientFvPatchScalarField>(Tw))
527 const fixedGradientFvPatchScalarField& Twm =
528 refCast<const fixedGradientFvPatchScalarField>(Tw);
532 hTaPlusQa = (*this)*props.Cpw*Twm.gradient();
534 else if (isA<mixedFvPatchScalarField>(Tw))
536 const mixedFvPatchScalarField& Twm =
537 refCast<const mixedFvPatchScalarField>(Tw);
539 isFixed =
pos(Twm.valueFraction() - 1 + rootSmall);
542 /
max(1 - Twm.valueFraction(), rootVSmall)
543 *(*this)*props.Cpw*patch().deltaCoeffs();
546 + (*this)*props.Cpw*Twm.refGrad();
551 <<
"Temperature boundary condition type not recognised"
561 alphatWallBoilingWallFunctionFvPatchScalarField::
562 alphatWallBoilingWallFunctionFvPatchScalarField
569 fixedValueFvPatchScalarField(
p, iF,
dict),
572 phaseType_(phaseTypeNames_.
read(
dict.lookup(
"phaseType"))),
573 useLiquidTemperatureWallFunction_
575 dict.lookupOrDefault<
Switch>(
"useLiquidTemperatureWallFunction", true)
577 tolerance_(
dict.lookupOrDefault<scalar>(
"tolerance", rootSmall)),
579 Prt_(
dict.lookupOrDefault<scalar>(
"Prt",
dimless, 0.85)),
580 tau_(
dict.lookupOrDefault<scalar>(
"bubbleWaitingTimeRatio",
dimless, 0.8)),
582 partitioningModel_(nullptr),
583 nucleationSiteModel_(nullptr),
584 departureDiameterModel_(nullptr),
585 departureFrequencyModel_(nullptr),
587 wetFraction_(
p.size(), 0),
588 dDeparture_(
p.size(), 1
e-5),
589 fDeparture_(
p.size(), 0),
590 nucleationSiteDensity_(
p.size(), 0),
591 qQuenching_(
p.size(), 0),
592 qEvaporative_(
p.size(), 0),
599 dict.subDict(
"partitioningModel")
604 nucleationSiteModel_ =
607 dict.subDict(
"nucleationSiteModel")
609 departureDiameterModel_ =
612 dict.subDictBackwardsCompatible
614 {
"departureDiameterModel",
"departureDiamModel"}
617 departureFrequencyModel_ =
620 dict.subDictBackwardsCompatible
622 {
"departureFrequencyModel",
"departureFreqModel"}
628 auto readFieldBackwardsCompatible = [&
p]
638 if (
dict.found(keywords[i]))
647 readFieldBackwardsCompatible
651 {
"wetFraction",
"wallLiquidFraction"},
657 readFieldBackwardsCompatible
665 readFieldBackwardsCompatible
669 {
"fDeparture",
"depFrequency"},
673 readFieldBackwardsCompatible
677 {
"nucleationSiteDensity",
"nucSiteDensity"},
678 nucleationSiteDensity_
681 readFieldBackwardsCompatible
689 readFieldBackwardsCompatible
697 readFieldBackwardsCompatible
717 fixedValueFvPatchScalarField(psf,
p, iF, mapper),
720 phaseType_(psf.phaseType_),
721 useLiquidTemperatureWallFunction_(psf.useLiquidTemperatureWallFunction_),
722 tolerance_(psf.tolerance_),
727 partitioningModel_(psf.partitioningModel_, false),
728 nucleationSiteModel_(psf.nucleationSiteModel_, false),
729 departureDiameterModel_(psf.departureDiameterModel_, false),
730 departureFrequencyModel_(psf.departureFrequencyModel_, false),
732 wetFraction_(mapper(psf.wetFraction_)),
733 dDeparture_(mapper(psf.dDeparture_)),
734 fDeparture_(mapper(psf.fDeparture_)),
735 nucleationSiteDensity_(mapper(psf.nucleationSiteDensity_)),
736 qQuenching_(mapper(psf.qQuenching_)),
737 qEvaporative_(mapper(psf.qEvaporative_)),
738 dmdtf_(mapper(psf.dmdtf_))
749 fixedValueFvPatchScalarField(psf, iF),
752 phaseType_(psf.phaseType_),
753 useLiquidTemperatureWallFunction_(psf.useLiquidTemperatureWallFunction_),
754 tolerance_(psf.tolerance_),
759 partitioningModel_(psf.partitioningModel_, false),
760 nucleationSiteModel_(psf.nucleationSiteModel_, false),
761 departureDiameterModel_(psf.departureDiameterModel_, false),
762 departureFrequencyModel_(psf.departureFrequencyModel_, false),
764 wetFraction_(psf.wetFraction_),
765 dDeparture_(psf.dDeparture_),
766 fDeparture_(psf.fDeparture_),
767 nucleationSiteDensity_(psf.nucleationSiteDensity_),
768 qQuenching_(psf.qQuenching_),
769 qEvaporative_(psf.qEvaporative_),
782 fixedValueFvPatchScalarField::map(ptf, mapper);
785 refCast<const alphatWallBoilingWallFunctionFvPatchScalarField>(ptf);
787 mapper(wetFraction_, tiptf.wetFraction_);
788 mapper(dDeparture_, tiptf.dDeparture_);
789 mapper(fDeparture_, tiptf.fDeparture_);
790 mapper(nucleationSiteDensity_, tiptf.nucleationSiteDensity_);
791 mapper(qQuenching_, tiptf.qQuenching_);
792 mapper(qEvaporative_, tiptf.qEvaporative_);
793 mapper(dmdtf_, tiptf.dmdtf_);
802 fixedValueFvPatchScalarField::reset(ptf);
805 refCast<const alphatWallBoilingWallFunctionFvPatchScalarField>(ptf);
807 wetFraction_.
reset(tiptf.wetFraction_);
808 dDeparture_.
reset(tiptf.dDeparture_);
809 fDeparture_.
reset(tiptf.fDeparture_);
810 nucleationSiteDensity_.
reset(tiptf.nucleationSiteDensity_);
811 qQuenching_.
reset(tiptf.qQuenching_);
812 qEvaporative_.
reset(tiptf.qEvaporative_);
813 dmdtf_.
reset(tiptf.dmdtf_);
841 wetFraction_ = partitioningModel_->wetFraction(props.
otherAlphaw);
872 Info<<
"Saturation model for interface "
874 <<
" not found. Wall boiling disabled." <<
endl;
885 wetFraction_ = partitioningModel_->wetFraction(props.
alphaw);
891 getTemperaturePatchField
902 return calcBoiling(props, Tw) - TwpfHTaPlusQa + TwpfH*Tw;
920 Twpf + (Twpf - props.
Tsat),
925 gMax((1 - TwpfIsFixed)*isBoiling*(Tw1 - Tw0)/(Tw0 + Tw1));
926 for (;
e > tolerance_;
e /= 2)
930 Tw0 =
pos(rM)*Tw0 +
neg0(rM)*TwM;
931 Tw1 =
pos(rM)*TwM +
neg0(rM)*Tw1;
935 TwpfIsFixed*Twpf + (1 - TwpfIsFixed)*(Tw0 + Tw1)/2
942 patch().deltaCoeffs()*
max(Tw - props.
Tc, small*props.
Tc)
949 isBoiling*q/props.
Cpw/gradTw/
max(props.
alphaw, rootSmall)
958 fixedValueFvPatchScalarField::updateCoeffs();
972 "useLiquidTemperatureWallFunction",
973 useLiquidTemperatureWallFunction_
979 writeEntry(os,
"bubbleWaitingTimeRatio", tau_);
984 partitioningModel_->write(os);
991 nucleationSiteModel_->write(os);
996 departureDiameterModel_->write(os);
1001 departureFrequencyModel_->write(os);
1012 writeEntry(os,
"nucleationSiteDensity", nucleationSiteDensity_);
1014 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.
virtual void map(const fvPatchScalarField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
static const NamedEnum< phaseType, 3 > phaseTypeNames_
Heat source type names.
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 field mapping.
Base-class for fluid thermodynamic properties.
Abstract base class for fluid thermophysical transport models RAS, LES and laminar.
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.
Unit conversion structure. Contains the associated dimensions and the multiplier with which to conver...
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.
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimPower
const dimensionSet dimless
const dimensionSet dimLength
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)
const HashTable< unitConversion > & units()
Get the table of unit conversions.
const dimensionSet dimTime
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensionedScalar sqrt(const dimensionedScalar &ds)
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)
const dimensionSet dimArea
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.
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)
const unitConversion unitFraction
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.