39 Foam::enthalpySorptionFvPatchScalarField::enthalpyModelType
41 Foam::enthalpySorptionFvPatchScalarField::enthalpyModelTypeNames
43 { enthalpyModelType::estimated,
"estimated" },
44 { enthalpyModelType::calculated,
"calculated" }
53 const DimensionedField<scalar, volMesh>& iF
56 zeroGradientFvPatchScalarField(
p, iF),
57 enthalpyModel_(enthalpyModelType::estimated),
59 enthalpyMassLoadPtr_(nullptr),
76 zeroGradientFvPatchScalarField(
p, iF,
dict),
77 enthalpyModel_(enthalpyModelTypeNames.
get(
"enthalpyModel",
dict)),
78 includeHs_(
dict.getOrDefault<bool>(
"includeHs", true)),
79 enthalpyMassLoadPtr_(nullptr),
83 pName_(
dict.getOrDefault<
word>(
"p",
"p")),
84 TName_(
dict.getOrDefault<
word>(
"T",
"T")),
92 switch (enthalpyModel_)
94 case enthalpyModelType::calculated:
96 enthalpyMassLoadPtr_ =
100 case enthalpyModelType::estimated:
106 if (
dict.found(
"value"))
122 const enthalpySorptionFvPatchScalarField& ptf,
124 const DimensionedField<scalar, volMesh>& iF,
125 const fvPatchFieldMapper& mapper
128 zeroGradientFvPatchScalarField(ptf,
p, iF, mapper),
129 enthalpyModel_(ptf.enthalpyModel_),
130 includeHs_(ptf.includeHs_),
131 enthalpyMassLoadPtr_(ptf.enthalpyMassLoadPtr_.clone()),
134 speciesName_(ptf.speciesName_),
137 dhdt_(ptf.dhdt_, mapper)
146 zeroGradientFvPatchScalarField(ptf),
147 enthalpyModel_(ptf.enthalpyModel_),
148 includeHs_(ptf.includeHs_),
149 enthalpyMassLoadPtr_(ptf.enthalpyMassLoadPtr_.clone()),
152 speciesName_(ptf.speciesName_),
165 zeroGradientFvPatchScalarField(ptf, iF),
166 enthalpyModel_(ptf.enthalpyModel_),
167 includeHs_(ptf.includeHs_),
168 enthalpyMassLoadPtr_(ptf.enthalpyMassLoadPtr_.clone()),
171 speciesName_(ptf.speciesName_),
185 zeroGradientFvPatchScalarField::autoMap(m);
197 zeroGradientFvPatchScalarField::rmap(ptf, addr);
199 const auto& tiptf = refCast<const enthalpySorptionFvPatchScalarField>(ptf);
201 dhdt_.rmap(tiptf.dhdt_, addr);
209 refCast<const speciesSorptionFvPatchScalarField>
240 const label speciesId =
241 thermo.composition().species()[speciesName_];
247 hsp[facei] =
composition.
Hs(speciesId, pp[facei], Tp[facei]);
255 Info<<
" Patch enthalpy rate min/max [J/m3/sec]: " 271 refCast<const speciesSorptionFvPatchScalarField>
279 switch (enthalpyModel_)
281 case enthalpyModelType::estimated:
286 case enthalpyModelType::calculated:
289 tmp<scalarField> tmassb = Yp.mass();
294 const scalar mfacei = massb[facei];
296 dhdt_[facei] = enthalpyMassLoadPtr_->value(mfacei);
306 Info<<
" Enthalpy change min/max [J/kg]: " 310 zeroGradientFvPatchScalarField::updateCoeffs();
318 os.
writeEntry(
"enthalpyModel", enthalpyModelTypeNames[enthalpyModel_]);
320 if (enthalpyMassLoadPtr_)
322 enthalpyMassLoadPtr_->writeData(
os);
335 writeEntry(
"value",
os);
346 enthalpySorptionFvPatchScalarField
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
word dictName() const
The local dictionary name (final part of scoped name)
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
This is a temperature boundary condition which works in conjunction with the speciesSorption conditio...
Type gMin(const FieldField< Field, Type > &f)
basicSpecieMixture & composition
enthalpySorptionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
friend Ostream & operator(Ostream &, const fvPatchField< scalar > &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
virtual void write(Ostream &) const
Write.
Specialization of basicMultiComponentMixture for a mixture consisting of a number for molecular speci...
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
fvPatchField< scalar > fvPatchScalarField
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch fields.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
virtual void write(Ostream &) const
Write.
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
OBJstream os(runTime.globalPath()/outputName)
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
virtual scalar Hs(const label speciei, const scalar p, const scalar T) const =0
Sensible enthalpy [J/kg].
virtual void operator=(const UList< Type > &)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
A class for managing temporary objects.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
virtual tmp< scalarField > patchSource() const
Source of cells next to the patch.
static constexpr const zero Zero
Global zero (0)