Go to the documentation of this file.
32 template<
class CloudType>
41 template<
class CloudType>
50 thermo_(owner.thermo()),
53 this->coeffDict().lookup(
"phases"),
54 thermo_.carrier().species(),
55 thermo_.liquids().components(),
56 thermo_.solids().components()
61 template<
class CloudType>
69 phaseProps_(cm.phaseProps_)
75 template<
class CloudType>
82 template<
class CloudType>
89 template<
class CloudType>
93 return thermo_.carrier();
97 template<
class CloudType>
101 return thermo_.liquids();
105 template<
class CloudType>
109 return thermo_.solids();
113 template<
class CloudType>
121 template<
class CloudType>
124 return phaseProps_.size();
128 template<
class CloudType>
132 if (phaseProps_.size() == 1)
134 return phaseProps_[0].names();
138 return phaseProps_.phaseTypes();
143 template<
class CloudType>
146 return phaseProps_.stateLabels();
150 template<
class CloudType>
154 return phaseProps_[
phasei].names();
158 template<
class CloudType>
161 const word& cmptName,
162 const bool allowNotFound
165 label
id = thermo_.carrierId(cmptName);
167 if (
id < 0 && !allowNotFound)
170 <<
"Unable to determine global id for requested component "
171 << cmptName <<
". Available components are " <<
nl
172 << thermo_.carrier().species()
180 template<
class CloudType>
184 const word& cmptName,
185 const bool allowNotFound
188 label
id = phaseProps_[
phasei].id(cmptName);
190 if (
id < 0 && !allowNotFound)
193 <<
"Unable to determine local id for component " << cmptName
201 template<
class CloudType>
206 const bool allowNotFound
209 label cid = phaseProps_[
phasei].carrierIds()[id];
211 if (cid < 0 && !allowNotFound)
214 <<
"Unable to determine global carrier id for phase "
215 <<
phasei <<
" with local id " <<
id
223 template<
class CloudType>
229 return phaseProps_[
phasei].Y();
233 template<
class CloudType>
243 switch (props.
phase())
245 case phaseProperties::GAS:
250 X[i] =
Y[i]/thermo_.carrier().W(cid);
255 case phaseProperties::LIQUID:
259 X[i] =
Y[i]/thermo_.liquids().properties()[i].W();
267 <<
"Only possible to convert gas and liquid mass fractions"
277 template<
class CloudType>
287 scalar HMixture = 0.0;
288 switch (props.
phase())
290 case phaseProperties::GAS:
295 HMixture +=
Y[i]*thermo_.carrier().Ha(cid,
p,
T);
299 case phaseProperties::LIQUID:
303 HMixture +=
Y[i]*thermo_.liquids().properties()[i].h(
p,
T);
307 case phaseProperties::SOLID:
314 thermo_.solids().properties()[i].Hf()
315 + thermo_.solids().properties()[i].Cp()*
T
331 template<
class CloudType>
341 scalar HsMixture = 0.0;
342 switch (props.
phase())
344 case phaseProperties::GAS:
349 HsMixture +=
Y[i]*thermo_.carrier().Hs(cid,
p,
T);
353 case phaseProperties::LIQUID:
360 thermo_.liquids().properties()[i].h(
p,
T)
361 - thermo_.liquids().properties()[i].h(
p, 298.15)
366 case phaseProperties::SOLID:
370 HsMixture +=
Y[i]*thermo_.solids().properties()[i].Cp()*
T;
377 <<
"Unknown phase enumeration"
386 template<
class CloudType>
396 scalar HcMixture = 0.0;
397 switch (props.
phase())
399 case phaseProperties::GAS:
404 HcMixture +=
Y[i]*thermo_.carrier().Hc(cid);
408 case phaseProperties::LIQUID:
413 Y[i]*thermo_.liquids().properties()[i].h(
p, 298.15);
417 case phaseProperties::SOLID:
421 HcMixture +=
Y[i]*thermo_.solids().properties()[i].Hf();
428 <<
"Unknown phase enumeration"
437 template<
class CloudType>
447 scalar CpMixture = 0.0;
448 switch (props.
phase())
450 case phaseProperties::GAS:
455 CpMixture +=
Y[i]*thermo_.carrier().Cp(cid,
p,
T);
459 case phaseProperties::LIQUID:
463 CpMixture +=
Y[i]*thermo_.liquids().properties()[i].Cp(
p,
T);
467 case phaseProperties::SOLID:
471 CpMixture +=
Y[i]*thermo_.solids().properties()[i].Cp();
478 <<
"Unknown phase enumeration"
487 template<
class CloudType>
497 scalar LMixture = 0.0;
498 switch (props.
phase())
500 case phaseProperties::GAS:
505 <<
"No support for gaseous components" <<
endl;
509 case phaseProperties::LIQUID:
513 LMixture +=
Y[i]*thermo_.liquids().properties()[i].hl(
p,
T);
517 case phaseProperties::SOLID:
522 <<
"No support for solid components" <<
endl;
529 <<
"Unknown phase enumeration"
int debug
Static debugging option.
virtual scalar Cp(const label phaseI, const scalarField &Y, const scalar p, const scalar T) const
Return specific heat capacity for the phase phaseI.
A class for handling words, derived from Foam::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...
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
A class for managing temporary objects.
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.
#define forAll(list, i)
Loop across all elements in list.
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.
Templated reacting parcel composition model class Consists of carrier species (via thermo package),...
const phasePropertiesList & phaseProps() const
Return the list of phase properties.
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.
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 a number of values (eg,...
CompositionModel(CloudType &owner)
Construct null from owner.
errorManip< error > abort(error &err)
PtrList< volScalarField > & Y
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.
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.
#define WarningInFunction
Report a warning using Foam::Warning.