Go to the documentation of this file.
30 template<
class CloudType>
39 template<
class CloudType>
48 thermo_(owner.thermo()),
51 this->coeffDict().
lookup(
"phases"),
52 thermo_.carrier().species(),
53 thermo_.liquids().components(),
54 thermo_.solids().components()
59 template<
class CloudType>
73 template<
class CloudType>
80 template<
class CloudType>
87 template<
class CloudType>
91 return thermo_.carrier();
95 template<
class CloudType>
99 return thermo_.liquids();
103 template<
class CloudType>
107 return thermo_.solids();
111 template<
class CloudType>
119 template<
class CloudType>
122 return phaseProps_.size();
126 template<
class CloudType>
130 if (phaseProps_.size() == 1)
132 return phaseProps_[0].names();
136 return phaseProps_.phaseTypes();
141 template<
class CloudType>
144 return phaseProps_.stateLabels();
148 template<
class CloudType>
152 return phaseProps_[
phasei].names();
156 template<
class CloudType>
159 const word& cmptName,
160 const bool allowNotFound
163 label id = thermo_.carrierId(cmptName);
165 if (
id < 0 && !allowNotFound)
168 <<
"Unable to determine global id for requested component "
169 << cmptName <<
". Available components are " <<
nl
170 << thermo_.carrier().species()
178 template<
class CloudType>
182 const word& cmptName,
183 const bool allowNotFound
188 if (
id < 0 && !allowNotFound)
191 <<
"Unable to determine local id for component " << cmptName
199 template<
class CloudType>
204 const bool allowNotFound
209 if (cid < 0 && !allowNotFound)
212 <<
"Unable to determine global carrier id for phase "
213 <<
phasei <<
" with local id " <<
id
221 template<
class CloudType>
227 return phaseProps_[
phasei].Y();
231 template<
class CloudType>
241 switch (props.
phase())
243 case phaseProperties::GAS:
248 X[i] =
Y[i]/thermo_.carrier().W(cid);
253 case phaseProperties::LIQUID:
257 X[i] =
Y[i]/thermo_.liquids().properties()[i].W();
265 <<
"Only possible to convert gas and liquid mass fractions"
275 template<
class CloudType>
285 scalar HMixture = 0.0;
286 switch (props.
phase())
288 case phaseProperties::GAS:
293 HMixture +=
Y[i]*thermo_.carrier().Ha(cid,
p,
T);
297 case phaseProperties::LIQUID:
301 HMixture +=
Y[i]*thermo_.liquids().properties()[i].h(
p,
T);
305 case phaseProperties::SOLID:
312 thermo_.solids().properties()[i].Hf()
313 + thermo_.solids().properties()[i].Cp()*
T
329 template<
class CloudType>
339 scalar HsMixture = 0.0;
340 switch (props.
phase())
342 case phaseProperties::GAS:
347 HsMixture +=
Y[i]*thermo_.carrier().Hs(cid,
p,
T);
351 case phaseProperties::LIQUID:
358 thermo_.liquids().properties()[i].h(
p,
T)
359 - thermo_.liquids().properties()[i].h(
p, 298.15)
364 case phaseProperties::SOLID:
368 HsMixture +=
Y[i]*thermo_.solids().properties()[i].Cp()*
T;
375 <<
"Unknown phase enumeration"
384 template<
class CloudType>
394 scalar HcMixture = 0.0;
395 switch (props.
phase())
397 case phaseProperties::GAS:
402 HcMixture +=
Y[i]*thermo_.carrier().Hc(cid);
406 case phaseProperties::LIQUID:
411 Y[i]*thermo_.liquids().properties()[i].h(
p, 298.15);
415 case phaseProperties::SOLID:
419 HcMixture +=
Y[i]*thermo_.solids().properties()[i].Hf();
426 <<
"Unknown phase enumeration"
435 template<
class CloudType>
445 scalar CpMixture = 0.0;
446 switch (props.
phase())
448 case phaseProperties::GAS:
453 CpMixture +=
Y[i]*thermo_.carrier().Cp(cid,
p,
T);
457 case phaseProperties::LIQUID:
461 CpMixture +=
Y[i]*thermo_.liquids().properties()[i].Cp(
p,
T);
465 case phaseProperties::SOLID:
469 CpMixture +=
Y[i]*thermo_.solids().properties()[i].Cp();
476 <<
"Unknown phase enumeration"
485 template<
class CloudType>
495 scalar LMixture = 0.0;
496 switch (props.
phase())
498 case phaseProperties::GAS:
503 <<
"No support for gaseous components" <<
endl;
507 case phaseProperties::LIQUID:
511 LMixture +=
Y[i]*thermo_.liquids().properties()[i].hl(
p,
T);
515 case phaseProperties::SOLID:
520 <<
"No support for solid components" <<
endl;
527 <<
"Unknown phase enumeration"
virtual scalar Cp(const label phaseI, const scalarField &Y, const scalar p, const scalar T) const
Return specific heat caoacity for the phase phaseI.
A class for handling words, derived from string.
virtual scalar H(const label phaseI, const scalarField &Y, const scalar p, const scalar T) const
Return total enthalpy for the phase phaseI.
Specialization of basicMultiComponentMixture for a mixture consisting of a number for molecular speci...
#define forAll(list, i)
Loop across all elements in list.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
A class for managing temporary objects.
const SLGThermo & thermo_
Reference to the thermo database.
label localId(const label phaseI, const word &cmptName, const bool allowNotFound=false) const
Return local id of component cmptName in phase phaseI.
label localToCarrierId(const label phaseI, const label id, const bool allowNotFound=false) const
Return carrier id of component given local id.
Helper class to manage multi-specie phase properties.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Base class for cloud sub-models.
Simple container for a list of phase properties.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual scalar Hs(const label phaseI, const scalarField &Y, const scalar p, const scalar T) const
Return sensible enthalpy for the phase phaseI.
const labelList & carrierIds() const
Return const access to the map to the carrier ids.
virtual scalar Hc(const label phaseI, const scalarField &Y, const scalar p, const scalar T) const
Return chemical enthalpy for the phase phaseI.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const phasePropertiesList & phaseProps() const
Return the list of phase properties.
Pre-declare SubField and related Field type.
const scalarField & Y0(const label phaseI) const
Return the list of phase phaseI mass fractions.
tmp< scalarField > X(const label phaseI, const scalarField &Y) const
Return the list of phase phaseI volume fractions fractions.
phasePropertiesList phaseProps_
List of phase properties.
Templated base class for dsmc cloud.
const liquidMixtureProperties & liquids() const
Return the global (additional) liquids.
const basicSpecieMixture & carrier() const
Return the carrier components (wrapper function)
A list of keyword definitions, which are a keyword followed by any number of values (e....
CompositionModel(CloudType &owner)
Construct null from owner.
errorManip< error > abort(error &err)
const wordList & componentNames(const label phaseI) const
Return the list of component names for phaseI.
const solidMixtureProperties & solids() const
Return the global (additional) solids.
label nPhase() const
Return the number of phases.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const SLGThermo & thermo() const
Return the thermo database.
virtual ~CompositionModel()
Destructor.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const wordList & phaseTypes() const
Return the list of phase type names.
label carrierId(const word &cmptName, const bool allowNotFound=false) const
Return global id of component cmptName in carrier thermo.
virtual scalar L(const label phaseI, const scalarField &Y, const scalar p, const scalar T) const
Return latent heat for the phase phaseI.
phaseType phase() const
Return const access to the phase type.
const wordList & stateLabels() const
Return the list of state labels (s), (l), (g) etc.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
#define WarningInFunction
Report a warning using Foam::Warning.
PtrList< volScalarField > & Y
stressControl lookup("compactNormalStress") >> compactNormalStress