50 void Foam::fv::phaseSurfaceCondensation::readCoeffs(
const dictionary&
dict)
54 const dictionary& diffusiveMassTransferDict =
55 dict.subDict(
"diffusiveMassTransfer");
57 checkBlendedInterfacialModelsDict<blendedSidedDiffusiveMassTransferModel>
60 diffusiveMassTransferDict
63 const phaseInterface interface(vapour_, solid_);
65 diffusiveMassTransferModel_.reset
71 blendingDict<blendedSidedDiffusiveMassTransferModel>
74 diffusiveMassTransferDict
79 saturationModelPtr_.reset
89 dict.lookupOrDefault<
bool>(
"specieSemiImplicit",
false);
93 void Foam::fv::phaseSurfaceCondensation::correctMDot()
const
103 const rhoThermo& solidThermo = solid_.thermo();
106 const fluidMulticomponentThermo& vapourThermo =
107 fluidMulticomponentThermos(
true,
false)[0];
110 const label speciei = specieis()[0];
112 const Pair<tmp<volScalarField>> Hs =
113 solver_.heatTransfer.Hs(vapour_, solid_);
118 (solidH*solidT + vapourH*vapourT + q_)
119 /
max(solidH + vapourH, rootVSmallH)
124 saturationModelPtr_->pSat(Tsurface)
129 const fluidThermophysicalTransportModel& ttmVapour =
139 vapour_.Y(species()[0])/vapourThermo.Wi(speciei)*vapourThermo.W()
149 -
f*freeSurf*vapourThermo.Wi(speciei)/vapourThermo.W()()
150 *diffusiveMassTransferModel_->KinThe(vapour_)()
151 *ttmVapour.D(vapour_.Y(species()[0]))()
152 *
log(
max(1 - xc, scalar(0.001))/
max(1 - xw, scalar(0.001)));
153 mDot_.max(scalar(0));
155 infoField(
"mDot", mDot_);
157 if (specieSemiImplicit_)
162 *diffusiveMassTransferModel_->KinThe(vapour_)()
163 *ttmVapour.D(vapour_.Y(species()[0]))()
164 /(1 -
min(xc, scalar(0.999)))*
pos(xc - xw);
183 const word& modelType,
194 readSpecie(coeffs(modelType,
dict), false)
197 fluid_(solver_.fluid),
198 liquid_(fluid_.phases()[phaseNames().
second()]),
199 vapour_(fluid_.phases()[phaseNames().
first()]),
200 solid_(fluid_.phases()[
dict.
lookup(
"phase")]),
201 diffusiveMassTransferModel_(nullptr),
202 saturationModelPtr_(nullptr),
203 pressureEquationIndex_(-1),
204 specieSemiImplicit_(false),
256 || fieldName == solid_.thermo().he().name();
268 name() +
":Lfraction",
300 && (&
rho == &liquid_.rho() || &
rho == &vapour_.rho())
301 && &eqn.
psi() == &solver_.p_rgh
306 if (pressureEquationIndex_ % 2 == 0) correctMDot();
307 pressureEquationIndex_ ++;
325 if (&heOrYi == &vapour_.thermo().he() || &heOrYi == &solid_.thermo().he())
327 const scalar
sign = &heOrYi == &solid_.thermo().he() ? -1 : +1;
333 if (&heOrYi == &solid_.thermo().he())
338 const label i = this->index(phaseNames(),
alpha.group());
341 if (!specieSemiImplicit_ || i != 0)
349 fluidMulticomponentThermos(
true,
false)[0];
354 if (
thermo.containsSpecie(specieName))
357 if (!species().
found(specieName))
return;
376 pressureEquationIndex_ = 0;
387 readCoeffs(coeffs(
dict));
Macros for easy insertion into run-time selection tables.
static tmp< DimensionedField< Type, GeoMesh, PrimitiveField > > New(const word &name, const GeoMesh &mesh, const dimensionSet &, const PrimitiveField< Type > &)
Return a temporary field constructed from name, mesh,.
Generic GeometricField class.
DimensionedField< Type, GeoMesh, PrimitiveField > Internal
Type of the internal field from which this GeometricField is derived.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static word member(const word &name)
Return member (name without the extension)
static autoPtr< blendedSidedDiffusiveMassTransferModel > New(const UPtrList< const dictionary > &subDicts, const phaseInterface &interface, const dictionary &blendingDict)
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Base-class for multi-component fluid thermodynamic properties.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
const fvSolution & solution() const
Return the fvSolution.
Finite volume model abstract base class.
static const dictionary & coeffs(const word &modelType, const dictionary &)
Return the coefficients sub-dictionary for a given model type.
virtual void addSup(fvMatrix< scalar > &eqn) const
Add a source term to a field-less proxy equation.
virtual bool addsSupToField(const word &fieldName) const
Return true if the fvModel adds a source term to the given.
Base class for phase change models.
void reReadSpecie(const dictionary &dict) const
Re-read the names of the transferring specie.
virtual bool read(const dictionary &dict)
Read source dictionary.
void addSup(const volScalarField &alpha, const volScalarField &rho, const volScalarField &heOrYi, fvMatrix< scalar > &eqn) const
Override the energy equation to add the phase change heat, or.
Model for mass diffusion limited condensation on the surface of a third (solid) phase.
virtual tmp< DimensionedField< scalar, fvMesh > > Lfraction() const
Return the fraction of the latent heat that is transferred into.
virtual void correct()
Correct the fvModel.
virtual tmp< DimensionedField< scalar, fvMesh > > mDotDy() const
Return the derivative of mass transfer rate.
virtual tmp< DimensionedField< scalar, fvMesh > > mDot() const
Return the mass transfer rate.
virtual bool read(const dictionary &dict)
Read source dictionary.
phaseSurfaceCondensation(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
void addSup(const volScalarField &alpha, const volScalarField &rho, fvMatrix< scalar > &eqn) const
Override the pressure equation to add the mass transfer rate.
virtual bool addsSupToField(const word &fieldName) const
Return true if the fvModel adds a source term to the given.
static const dimensionSet dimK
Coefficient dimensions.
const Type & lookupType(const word &group=word::null) const
Lookup and return the object of the given Type.
static autoPtr< saturationPressureModel > New(const word &name, const dictionary &dict)
Select with name within a dictionary.
scalar fieldRelaxationFactor(const word &name) const
Return the relaxation factor for the given field.
Abstract base class for run-time selectable region solvers.
A class for managing temporary objects.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const VolField< Type > &)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
dimensionedScalar pos(const dimensionedScalar &ds)
const dimensionSet & dimless
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
dimensionedScalar sign(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
UPtrList< const dictionary > modelSubDicts(const dictionary &dict, const wordHashSet &ignoreKeys=wordHashSet())
const dimensionSet & dimVolume
labelList second(const UList< labelPair > &p)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
dimensionedScalar log(const dimensionedScalar &ds)
labelList first(const UList< labelPair > &p)
const dimensionSet & dimTime
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
const dimensionSet & dimDensity
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet & dimEnergy
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
fluidMulticomponentThermo & thermo