Go to the documentation of this file.
50 "condensationAndEvaporation"
87 if (Tsat > 295 && Tsat < 373)
89 return 51104 + 2044*Tsat;
101 const word& fieldName,
114 mesh.time().timeName(),
124 tField.
ptr()->store();
144 mixedFvPatchScalarField(
p, iF),
146 mode_(mtConstantMass),
150 muName_(
"thermo:mu"),
157 mass_(patch().size(), 0.0),
159 myKDelta_(patch().size(), 0.0),
160 dmHfg_(patch().size(), 0.0),
161 mpCpTp_(patch().size(), 0.0),
165 cp_(patch().size(), 0.0),
166 thickness_(patch().size(), 0.0),
167 rho_(patch().size(), 0.0)
169 this->refValue() = 0.0;
170 this->refGrad() = 0.0;
171 this->valueFraction() = 1.0;
184 mixedFvPatchScalarField(psf,
p, iF, mapper),
197 mass_(psf.
mass_, mapper),
200 dmHfg_(psf.
dmHfg_, mapper),
205 cp_(psf.
cp_, mapper),
207 rho_(psf.
rho_, mapper)
219 mixedFvPatchScalarField(
p, iF),
221 mode_(mtCondensationAndEvaporation),
222 pName_(
dict.lookupOrDefault<
word>(
"p",
"p")),
223 UName_(
dict.lookupOrDefault<
word>(
"U",
"U")),
224 rhoName_(
dict.lookupOrDefault<
word>(
"rho",
"rho")),
225 muName_(
dict.lookupOrDefault<
word>(
"mu",
"thermo:mu")),
226 TnbrName_(
dict.lookupOrDefault<
word>(
"Tnbr",
"T")),
227 QrNbrName_(
dict.lookupOrDefault<
word>(
"QrNbr",
"none")),
228 QrName_(
dict.lookupOrDefault<
word>(
"Qr",
"none")),
229 specieName_(
dict.lookupOrDefault<
word>(
"specieName",
"none")),
232 mass_(patch().size(), 0.0),
234 myKDelta_(patch().size(), 0.0),
235 dmHfg_(patch().size(), 0.0),
236 mpCpTp_(patch().size(), 0.0),
240 cp_(patch().size(), 0.0),
241 thickness_(patch().size(), 0.0),
242 rho_(patch().size(), 0.0)
244 if (!isA<mappedPatchBase>(this->patch().patch()))
247 <<
"\n patch type '" <<
p.type()
248 <<
"' not type '" << mappedPatchBase::typeName <<
"'"
249 <<
"\n for patch " <<
p.name()
257 if (
dict.found(
"mode"))
259 mode_ = massModeTypeNames_.read(
dict.lookup(
"mode"));
277 case mtCondensationAndEvaporation:
282 liquidDict_ =
dict.subDict(
"liquid");
286 if (
dict.found(
"thickness"))
297 thickness_[i]*liquid_->rho(pf, Tp[i])*magSf[i];
307 <<
"Did not find mode " << mode_
308 <<
" on patch " << patch().name()
310 <<
"Please set 'mode' to one of "
311 << massModeTypeNames_.sortedToc()
319 if (
dict.found(
"refValue"))
331 valueFraction() = 1.0;
343 mixedFvPatchScalarField(psf, iF),
377 mixedFvPatchScalarField::autoMap(m);
382 myKDelta_.autoMap(m);
386 thickness_.autoMap(m);
398 mixedFvPatchScalarField::rmap(ptf, addr);
401 refCast<const humidityTemperatureCoupledMixedFvPatchScalarField>
408 mass_.rmap(tiptf.
mass_, addr);
410 dmHfg_.rmap(tiptf.
dmHfg_, addr);
411 mpCpTp_.rmap(tiptf.
mpCpTp_, addr);
412 cp_.rmap(tiptf.
cp_, addr);
414 rho_.rmap(tiptf.
rho_, addr);
428 refCast<const mappedPatchBase>(patch().patch());
436 refCast<const fvMesh>(nbrMesh).boundary()[nbrPatchI];
449 scalarField nbrIntFld(nbrField.patchInternalField());
475 const scalar dt =
mesh.time().deltaTValue();
518 const scalar Tf = Tp[faceI];
519 const scalar Tint = Tin[faceI];
521 const scalar pf = pp[faceI];
523 const scalar muf = mup[faceI];
524 const scalar
rhof = rhop[faceI];
525 const scalar nuf = muf/
rhof;
527 const scalar Mv =
liquid_->W();
532 hfg[faceI] =
liquid_->hl(pf, Tf);
535 const scalar invMwmean =
536 Yi[faceI]/Mv + (1.0 - Yi[faceI])/
Mcomp_;
537 const scalar Xv = Yi[faceI]/invMwmean/Mv;
541 scalar Tdew = -GREAT;
547 scalar TintDeg = Tint - 273;
549 b*(
log(
RH) + (
c*TintDeg)/(
b + TintDeg))
550 /(
c -
log(
RH) - ((
c*TintDeg)/(
b + TintDeg))) + 273;
566 1.0/((1.0/
myKDelta_[faceI]) + (1.0/htc[faceI]));
569 const scalar q = (Tint - Tf)*htcTotal*magSf[faceI];
572 dm[faceI] = q/hfg[faceI]/magSf[faceI];
574 mass_[faceI] += q/hfg[faceI]*dt;
577 const scalar Dab =
liquid_->D(pf, Tf);
579 -
min(dm[faceI]/Dab/
rhof, Yi[faceI]*myDelta[faceI]);
584 &&
mass_[faceI] > 0.0
591 const scalar Dab =
liquid_->D(pf, Tf);
593 const scalar Sc = nuf/Dab;
594 const scalar
Sh = this->
Sh(Re, Sc);
599 const scalar hm = Dab*
Sh/
L_;
601 const scalar Yinf =
max(Yi[faceI], 0.0);
604 dm[faceI] = -
rhof*hm*
max((Ys - Yinf), 0.0)/(1.0 - Ys);
607 Yvp[faceI] = -dm[faceI]/Dab/
rhof;
610 mass_[faceI] += dm[faceI]*magSf[faceI]*dt;
614 else if (Tf > Tdew && Tf <
Tvap_ &&
mass_[faceI] > 0.0)
618 else if (
mass_[faceI] == 0.0)
623 liquidRho[faceI] =
liquid_->rho(pf, Tf);
637 refCast<const fvMesh>(
mesh)
641 pDelta =
mass_/liquidRho/magSf;
667 mpCpTpNbr = nbrField.
mpCpTp();
670 dmHfgNbr = nbrField.
dmHfg();
697 refValue() = (KDeltaNbr*nbrIntFld + mpCpdt*Tp)/
alpha;
699 mixedFvPatchScalarField::updateCoeffs();
706 scalar Qdm =
gSum(dm);
709 scalar QtSolid =
gSum(KDeltaNbr*(Tp - nbrIntFld)*magSf);
712 << patch().name() <<
':'
714 << nbrMesh.
name() <<
':'
715 << nbrPatch.
name() <<
':'
717 <<
" Total mass flux [Kg/s] : " << Qdm <<
nl
718 <<
" Total mass on the wall [Kg] : " << QMass <<
nl
719 <<
" Total heat (>0 leaving the wall to the fluid) [W] : "
721 <<
" Total heat (>0 leaving the wall to the solid) [W] : "
723 <<
" wall temperature "
724 <<
" min:" <<
gMin(*
this)
725 <<
" max:" <<
gMax(*
this)
739 writeEntryIfDifferent<word>(os,
"p",
"p", pName_);
740 writeEntryIfDifferent<word>(os,
"U",
"U", UName_);
741 writeEntryIfDifferent<word>(os,
"rho",
"rho", rhoName_);
742 writeEntryIfDifferent<word>(os,
"mu",
"thermo:mu", muName_);
743 writeEntryIfDifferent<word>(os,
"Tnbr",
"T", TnbrName_);
744 writeEntryIfDifferent<word>(os,
"QrNbr",
"none", QrNbrName_);
745 writeEntryIfDifferent<word>(os,
"Qr",
"none", QrName_);
752 writeEntryIfDifferent<word>(os,
"specieName",
"none", specieName_);
760 mass_.writeEntry(
"mass", os);
762 if (mode_ == mtConstantMass)
764 cp_.writeEntry(
"cp", os);
765 rho_.writeEntry(
"rho", os);
768 thickness_.writeEntry(
"thickness", os);
771 liquidDict_.write(os);
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
const scalarField mpCpTp() const
Return mpCpTp.
scalarField mass_
Mass accumulated on faces.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static const NamedEnum< massTransferMode, 4 > massModeTypeNames_
const word QrName_
Name of the radiative heat flux field.
scalarField cp_
Cp field for inert mode.
const word pName_
Name of the pressure field.
A class for handling words, derived from string.
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
#define forAll(list, i)
Loop across all elements in list.
scalarField myKDelta_
Cache myDelta.
A class for managing temporary objects.
@ mtCondensationAndEvaporation
Type gAverage(const FieldField< Field, Type > &f)
volScalarField & thicknessField(const word &, const fvMesh &)
Lookup (or create) thickness field for output.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
rDeltaT dimensionedInternalField()
scalar Sh(const scalar Re, const scalar Sc) const
Calculation of Sh.
const polyPatch & samplePolyPatch() const
Get the patch on the region.
scalarField Re(const UList< complex > &cf)
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
scalarField thickness_
Thickness field for inert mode.
Common functions for use in temperature coupled boundaries.
const word UName_
Name of the velocity field.
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
scalar Mcomp_
Average molecular weight for the carrier mixture in the gas phase.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Type gSum(const FieldField< Field, Type > &f)
virtual void write(Ostream &) const
Write.
dimensioned< scalar > mag(const dimensioned< Type > &)
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
bool cp(const fileName &src, const fileName &dst)
Copy, recursively if necessary, the source to the destination.
virtual Field< Type > & gradient()
Return gradient at boundary.
scalarField mpCpTp_
Thermal inertia.
Mesh consisting of general polyhedral cells.
const word & name() const
Return name.
CGAL::Exact_predicates_exact_constructions_kernel K
scalarField dmHfg_
Phase change energy.
const polyMesh & sampleMesh() const
Get the region mesh.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
volScalarField RH(IOobject("RH", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar("RH", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0))
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Pre-declare SubField and related Field type.
const word rhoName_
Name of the density field.
const scalarField dmHfg() const
Return dmHfg.
humidityTemperatureCoupledMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
volScalarField Qr(IOobject("Qr", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE), mesh, dimensionedScalar("Qr", dimMass/pow3(dimTime), 0.0))
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
const word & name() const
Return name.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const dimensionedScalar & pSat
const word QrNbrName_
Name of the radiative heat flux in the neighbout region.
A list of keyword definitions, which are a keyword followed by any number of values (e....
dimensionedScalar log(const dimensionedScalar &ds)
Macros for easy insertion into run-time selection tables.
Generic dimensioned Type class.
Mesh data needed to do the Finite Volume discretisation.
T * ptr() const
Return tmp pointer for reuse.
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
To & refCast(From &r)
Reference type cast template function.
scalar Tvap_
Vaporization temperature.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const word muName_
Name of the dynamic viscosity field.
GeometricField< vector, fvPatchField, volMesh > volVectorField
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const word specieName_
Name of the species on which the mass transfered (default H2O)
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
scalar L_
Characteristic length scale.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar sqrt(const dimensionedScalar &ds)
volScalarField scalarField(fieldObject, mesh)
scalarField rho_
Density field for inert mode.
massTransferMode mode_
Operating mode.
const scalarField & deltaCoeffs() const
Return the face - cell distance coeffient.
tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
const word TnbrName_
Name of temperature field on the neighbour region.
const GeometricField::PatchFieldType & lookupPatchField(const word &name, const GeometricField *=NULL, const Type *=NULL) const
Lookup and return the patchField of the named field from the.
const dimensionedScalar c
Speed of light in a vacuum.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Type gMin(const FieldField< Field, Type > &f)
massTransferMode
Modes of mass transfer.
autoPtr< liquidProperties > liquid_
Liquid properties.
dimensionedScalar cbrt(const dimensionedScalar &ds)
This boundary condition supplies a fixed gradient condition, such that the patch values are calculate...
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))
void write(Ostream &) const
Write.
Generic GeometricField class.
scalar htcCondensation(const scalar TSat, const scalar Re) const
Calculation of htc from the condensed surface.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
label index() const
Return the index of this patch in the boundaryMesh.
const scalarField myKDelta() const
Return myKDelta.
dictionary liquidDict_
Liquid dictionary.
Type gMax(const FieldField< Field, Type > &f)
Initialise the NamedEnum HashTable from the static list of names.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...