43 namespace regionModels
45 namespace surfaceFilmModels
82 surfaceFilmRegionModel& film,
86 phaseChangeModel(typeName, film,
dict),
91 IOobject::scopedName(typeName,
"Wwax"),
92 film.regionMesh().time().constant(),
93 film.regionMesh().thisDb(),
98 coeffDict_.
get<scalar>(
"Wwax")
104 IOobject::scopedName(typeName,
"Wsolvent"),
105 film.regionMesh().time().constant(),
106 film.regionMesh().thisDb(),
111 coeffDict_.
get<scalar>(
"Wsolvent")
117 IOobject::scopedName(typeName,
"Ysolvent0"),
118 film.regionMesh().time().constant(),
119 film.regionMesh().thisDb(),
129 IOobject::scopedName(typeName,
"Ysolvent"),
130 film.regionMesh().time().
timeName(),
131 film.regionMesh().thisDb(),
138 deltaMin_(coeffDict_.
get<scalar>(
"deltaMin")),
139 L_(coeffDict_.
get<scalar>(
"L")),
140 TbFactor_(coeffDict_.getOrDefault<scalar>(
"TbFactor", 1.1)),
141 YInfZero_(coeffDict_.getOrDefault(
"YInfZero", false)),
144 Function1<scalar>::
New(
"activityCoeff", coeffDict_, &film.regionMesh())
157 template<
class YInfType>
176 const label vapId =
thermo.carrierId(filmThermo.
name());
193 const scalar Wvap =
thermo.carrier().W(vapId);
204 auto& evapRateCoeff = tevapRateCoeff.ref();
212 auto& evapRateInf = tevapRateInf.ref();
214 bool filmPresent =
false;
222 const scalar Ysolvent =
Ysolvent_[celli];
225 const scalar Xsolvent
227 Ysolvent*Wsolvent/((1 - Ysolvent)*Wwax + Ysolvent*Wsolvent)
231 const scalar rhoInfc = rhoInf[celli];
234 const scalar pc = pInf[celli];
237 const scalar Tb = filmThermo.
Tb(pc);
242 const scalar pPartialCoeff
247 scalar XsCoeff = pPartialCoeff/pc;
250 scalar Xs = XsCoeff*Xsolvent;
255 <<
"Solvent vapour pressure > ambient pressure" 265 XsCoeff/(XsCoeff*Xsolvent*Wsolvent + (1 - Xs)*Wvap)
269 const scalar muInfc = muInf[celli];
272 const scalar
Re = rhoInfc*
mag(dU[celli])*
L_/muInfc;
275 const scalar Dab = filmThermo.
D(pc, Tloc);
278 const scalar Sc = muInfc/(rhoInfc*(Dab + ROOTVSMALL));
281 const scalar
Sh = this->
Sh(Re, Sc);
284 evapRateCoeff[celli] = rhoInfc*
Sh*Dab/(
L_ + ROOTVSMALL);
292 *evapRateCoeff[celli]*(YsCoeff*Ysolvent - YInf[celli]),
297 if (dm > limMass[celli])
299 evapRateCoeff[celli] *= limMass[celli]/dm;
302 evapRateInf[celli] = evapRateCoeff[celli]*YInf[celli];
303 evapRateCoeff[celli] *= YsCoeff;
358 dt*magSf*rhoInf*(evapRateCoeff*
Ysolvent_ + evapRateInf)
387 const thermoSingleLayer&
film = filmType<thermoSingleLayer>();
388 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.
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.
const scalar TbFactor_
Boiling temperature factor.
#define forAll(list, i)
Loop across all elements in list.
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
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.
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.
static tmp< DimensionedField< Type, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField)
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, copy of internal field...
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)
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].