147 .patchInternalField()
186 void Foam::fv::wallCondensation::readCoeffs(
const dictionary&
dict)
190 saturationModelPtr_.reset
194 "saturationPressure",
199 Prt_ =
dict.lookupOrDefault<scalar>(
"Prt",
dimless, 0.85);
201 Sct_ =
dict.lookupOrDefault<scalar>(
"Sct",
dimless, 0.7);
203 specieSemiImplicit_ =
204 dict.lookupOrDefault<
bool>(
"specieSemiImplicit",
false);
208 void Foam::fv::wallCondensation::correctMDot()
const
215 if (!isPatchActive(
patchi))
continue;
220 mDot_[faceCells[i]] = scalar(0);
221 mDotDy_[faceCells[i]] = scalar(0);
229 if (!isPatchActive(
patchi))
continue;
232 wallCondensationPhaseChangeRateFvPatchScalarField& mDot =
238 const properties props(*
this,
patchi);
240 const fluidMulticomponentThermo&
thermo =
241 fluidMulticomponentThermos(
true,
false)[0];
243 const label speciei = specieis()[0];
248 props.ttmVapour.D(vapour_.Y(species()[0]),
patchi)
249 + Prt_/Sct_*props.alphatConvVapour
255 .
Y(species()[0]).boundaryField()[
patchi].patchInternalField()
266 *props.patch().deltaCoeffs()
267 *
log(
max(1 - xc, scalar(0.001))/
max(1 - xw, scalar(0.001)));
269 if (specieSemiImplicit_)
275 *props.patch().deltaCoeffs()
276 /
max(1 - xc, scalar(0.001))*
pos(xc - xw);
284 mDot.condensing_ =
pos(mDot);
285 mDot =
max(mDot, scalar(0));
289 props.patch().deltaCoeffs()
290 *
min(props.TwVapour - props.TcVapour, -rootSmall*props.TcVapour)
297 q/props.CpVapour/gradT/
max(props.alphaVapour, rootSmall)
300 mDot.alphatVapour_ = props.alphatConvVapour + alphatCondensingVapour;
301 mDot.alphatLiquid_ = props.alphatConvLiquid;
314 mDot_[faceCells[i]] += mDot[i];
315 mDotDy_[faceCells[i]] += mDotDy[i];
328 const word& modelType,
339 readSpecie(coeffs(modelType,
dict), true)
341 liquid_(phases().
second()),
342 vapour_(phases().
first()),
351 saturationModelPtr_(nullptr),
352 pressureEquationIndex_(-1),
353 specieSemiImplicit_(false),
396 return mDotPfRef(
patchi).condensing_;
408 mDotPfRef(
patchi).alphatVapour_,
409 mDotPfRef(
patchi).alphatLiquid_
421 name() +
":Lfraction",
431 return mDot_.internalField();
438 return mDotDy_.internalField();
445 if (!isPatchActive(
patchi))
449 <<
" is not a condensation phase change wall" <<
exit(
FatalError);
453 refCast<const wallCondensationPhaseChangeRateFvPatchScalarField>
455 mDot_.boundaryField()[
patchi]
463 if (!isPatchActive(
patchi))
467 <<
" is not a condensation phase change wall" <<
exit(
FatalError);
471 refCast<wallCondensationPhaseChangeRateFvPatchScalarField>
473 mDot_.boundaryFieldRef()[
patchi]
489 && (&
rho == &liquid_.rho() || &
rho == &vapour_.rho())
490 && &eqn.
psi() == &p_rgh_
495 if (pressureEquationIndex_ % 2 == 0) correctMDot();
496 pressureEquationIndex_ ++;
512 const label i = this->index(phaseNames(),
alpha.group());
514 if (!specieSemiImplicit_ || i != 1)
522 fluidMulticomponentThermos(
true,
false)[0];
527 if (
thermo.containsSpecie(specieName))
530 if (!species().
found(specieName))
return;
549 pressureEquationIndex_ = 0;
560 readCoeffs(coeffs(
dict));
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.
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.
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)
An ordered pair of two objects of type <Type> with first() and second() elements.
This boundary condition provides a thermal wall function for turbulent thermal diffusivity (usuallyal...
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.
Abstract base class for fluid thermophysical transport models RAS, LES and laminar.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
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.
const fvMesh & mesh() const
Return const access to the mesh database.
const word & name() const
Return const access to the source name.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual void addSup(fvMatrix< scalar > &eqn) const
Add a source term to a field-less proxy equation.
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 wall condensation between two phases on the surface of a number of w...
wallCondensation(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
const wallCondensationPhaseChangeRateFvPatchScalarField & mDotPf(const label patchi) const
Return the mass transfer rate for the given patch.
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 const scalarField & active(const label) const
Return a mask indicating whether phase change is occurring.
virtual bool read(const dictionary &dict)
Read source dictionary.
void addSup(const volScalarField &alpha, const volScalarField &rho, const volScalarField &heOrYi, fvMatrix< scalar > &eqn) const
Use phaseChange's source functions.
wallCondensationPhaseChangeRateFvPatchScalarField & mDotPfRef(const label patchi) const
Return the mass transfer rate for the given patch.
Base class for fvModels that represent phase change at a wall.
const Pair< const volScalarField & > & alphats() const
Access the turbulent thermal diffusivities.
static autoPtr< saturationPressureModel > New(const word &name, const dictionary &dict)
Select with name within a dictionary.
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...
This boundary condition is used for the phase change rate field of the wall condensation fvModel....
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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 > &)
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
labelList second(const UList< labelPair > &p)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
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.
UList< label > labelUList
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
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.
faceListList boundary(nPatches)
PtrList< volScalarField > & Y
fluidMulticomponentThermo & thermo
const scalarField pSat
Saturation pressure.
compressible::alphatJayatillekeWallFunctionFvPatchScalarField alphatJayatillekeWallFunction
Typedef to shorten the name of the Jayatilleke wall function.
const label patchi
Patch index.
const scalarField & CpVapour
Vapour heat capacity.
const scalarField alphatConvVapour
Phase convective turbulent thermal diffusivity.
const wallCondensation & model
Wall function field.
const scalarField TcVapour
Cell temperature.
const scalarField alphatConvLiquid
Liquid convective turbulent thermal diffusivity.
const fluidThermophysicalTransportModel & ttmVapour
Vapour thermophysical transport model.
const fluidThermophysicalTransportModel & ttmLiquid
Liquid thermophysical transport model.
const scalarField TwVapour
Patch temperature.
const scalarField & alphaVapour
Vapour volume fraction.
const scalarField & alphaLiquid
Liquid volume fraction.
properties(const wallCondensation &model, const label patchi)
Constructor.
const fvPatch & patch() const
Patch.
const scalarField AbyV
Patch area by neighbouring cell volume ratio.
const scalarField L
Latent heat.