43 namespace regionModels
45 namespace surfaceFilmModels
82 surfaceFilmRegionModel& film,
86 phaseChangeModel(typeName, film,
dict),
92 film.regionMesh().time().constant(),
93 film.regionMesh().thisDb()
95 coeffDict_.
get<scalar>(
"Wwax")
101 typeName +
":Wsolvent",
102 film.regionMesh().time().constant(),
103 film.regionMesh().thisDb()
105 coeffDict_.
get<scalar>(
"Wsolvent")
111 typeName +
":Ysolvent0",
112 film.regionMesh().time().constant(),
113 film.regionMesh().thisDb(),
122 typeName +
":Ysolvent",
123 film.regionMesh().time().
timeName(),
124 film.regionMesh().thisDb(),
130 deltaMin_(coeffDict_.
get<scalar>(
"deltaMin")),
131 L_(coeffDict_.
get<scalar>(
"L")),
132 TbFactor_(coeffDict_.getOrDefault<scalar>(
"TbFactor", 1.1)),
133 YInfZero_(coeffDict_.getOrDefault(
"YInfZero", false)),
136 Function1<scalar>::
New(
"activityCoeff", coeffDict_, &film.regionMesh())
149 template<
class YInfType>
168 const label vapId =
thermo.carrierId(filmThermo.
name());
185 const scalar Wvap =
thermo.carrier().W(vapId);
194 typeName +
":evapRateCoeff",
209 typeName +
":evapRateInf",
220 bool filmPresent =
false;
228 const scalar Ysolvent =
Ysolvent_[celli];
231 const scalar Xsolvent
233 Ysolvent*Wsolvent/((1 - Ysolvent)*Wwax + Ysolvent*Wsolvent)
237 const scalar rhoInfc = rhoInf[celli];
240 const scalar pc = pInf[celli];
243 const scalar Tb = filmThermo.
Tb(pc);
248 const scalar pPartialCoeff
253 scalar XsCoeff = pPartialCoeff/pc;
256 scalar Xs = XsCoeff*Xsolvent;
261 <<
"Solvent vapour pressure > ambient pressure" 271 XsCoeff/(XsCoeff*Xsolvent*Wsolvent + (1 - Xs)*Wvap)
275 const scalar muInfc = muInf[celli];
278 const scalar
Re = rhoInfc*
mag(dU[celli])*
L_/muInfc;
281 const scalar Dab = filmThermo.
D(pc, Tloc);
284 const scalar Sc = muInfc/(rhoInfc*(Dab + ROOTVSMALL));
287 const scalar
Sh = this->
Sh(Re, Sc);
290 evapRateCoeff[celli] = rhoInfc*
Sh*Dab/(
L_ + ROOTVSMALL);
298 *evapRateCoeff[celli]*(YsCoeff*Ysolvent - YInf[celli]),
303 if (dm > limMass[celli])
305 evapRateCoeff[celli] *= limMass[celli]/dm;
308 evapRateInf[celli] = evapRateCoeff[celli]*YInf[celli];
309 evapRateCoeff[celli] *= YsCoeff;
364 dt*magSf*rhoInf*(evapRateCoeff*
Ysolvent_ + evapRateInf)
393 const thermoSingleLayer&
film = filmType<thermoSingleLayer>();
394 const label vapId =
film.thermo().carrierId(
film.filmThermo().
name());
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
volScalarField Ysolvent_
Solvent mass-fraction.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
void clamp_range(const dimensioned< MinMax< Type >> &range)
Clamp field values (in-place) to the specified range.
const Type & value() const noexcept
Return const reference to value.
fvMatrix< scalar > fvScalarMatrix
virtual const word & name() const =0
Return the specie name.
virtual ~waxSolventEvaporation()
Destructor.
virtual const volVectorField & Us() const =0
Return the film surface velocity [m/s].
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual const volScalarField & hs() const =0
Return the film surface temperature [J/kg].
Base class for film thermo models.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
autoPtr< Function1< scalar > > activityCoeff_
Activity coefficient as a function of solvent mole fraction.
uniformDimensionedScalarField Wwax_
Molecular weight of wax [kg/kmol].
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Ignore writing from objectRegistry::writeObject()
const Time & time() const
Return the top-level database.
const scalar deltaMin_
Minimum film height for model to be active.
virtual const volScalarField & rho() const =0
Return the film density [kg/m3].
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
Macros for easy insertion into run-time selection tables.
waxSolventEvaporation(const waxSolventEvaporation &)=delete
No copy construct.
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
const scalar TbFactor_
Boiling temperature factor.
#define forAll(list, i)
Loop across all elements in list.
const scalar L_
Length scale [m].
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar cbrt(const dimensionedScalar &ds)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Calculate the matrix for the first temporal derivative.
virtual const volScalarField & delta() const =0
Return the film thickness [m].
const fvMesh & regionMesh() const
Return the region mesh database.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
const word & name() const
Name function is needed to disambiguate those inherited from regIOobject and dictionary.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
virtual scalar D(const scalar p, const scalar T) const =0
Return diffusivity [m2/s].
virtual scalar Tb(const scalar p) const =0
Return boiling temperature [K].
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Calculate the divergence of the given field.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
uniformDimensionedScalarField Wsolvent_
Molecular weight of liquid [kg/kmol].
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const dimensionSet dimDensity
scalarField Re(const UList< complex > &cmplx)
Extract real component.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Calculate the matrix for the divergence of the given field and flux.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
scalar Sh(const scalar Re, const scalar Sc) const
Return Sherwood number as a function of Reynolds and Schmidt numbers.
uniformDimensionedScalarField Ysolvent0_
Initial solvent mass-fraction.
Defines the attributes of an object for which implicit objectRegistry management is supported...
defineTypeNameAndDebug(kinematicSingleLayer, 0)
void correctModel(const scalar dt, scalarField &availableMass, scalarField &dMass, scalarField &dEnergy, const YInfType &YInf)
Do not request registration (bool: false)
bool YInfZero_
Switch to treat YInf as zero.
Calculate the finiteVolume matrix for implicit and explicit sources.
virtual scalar pv(const scalar p, const scalar T) const =0
Return vapour pressure [Pa].
Thermodynamic form of single-cell layer surface film model.
const dimensionSet & dimensions() const noexcept
Return dimensions.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity
virtual const volScalarField & T() const =0
Return the film mean temperature [K].