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>
67 phaseProps_(cm.phaseProps_)
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().Wi(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" 276 template<
class CloudType>
286 scalar HMixture = 0.0;
287 switch (props.
phase())
289 case phaseProperties::GAS:
294 HMixture += Y[i]*thermo_.carrier().Ha(cid, p, T);
298 case phaseProperties::LIQUID:
302 HMixture += Y[i]*thermo_.liquids().properties()[i].h(p, T);
306 case phaseProperties::SOLID:
313 thermo_.solids().properties()[i].Hf()
314 + thermo_.solids().properties()[i].Cp()*
T 330 template<
class CloudType>
340 scalar HsMixture = 0.0;
341 switch (props.
phase())
343 case phaseProperties::GAS:
348 HsMixture += Y[i]*thermo_.carrier().Hs(cid, p, T);
352 case phaseProperties::LIQUID:
359 thermo_.liquids().properties()[i].h(p, T)
360 - thermo_.liquids().properties()[i].h(p, 298.15)
365 case phaseProperties::SOLID:
369 HsMixture += Y[i]*thermo_.solids().properties()[i].Cp()*
T;
376 <<
"Unknown phase enumeration" 385 template<
class CloudType>
395 scalar HcMixture = 0.0;
396 switch (props.
phase())
398 case phaseProperties::GAS:
403 HcMixture += Y[i]*thermo_.carrier().Hf(cid);
407 case phaseProperties::LIQUID:
412 Y[i]*thermo_.liquids().properties()[i].h(p, 298.15);
416 case phaseProperties::SOLID:
420 HcMixture += Y[i]*thermo_.solids().properties()[i].Hf();
427 <<
"Unknown phase enumeration" 436 template<
class CloudType>
446 scalar CpMixture = 0.0;
447 switch (props.
phase())
449 case phaseProperties::GAS:
454 CpMixture += Y[i]*thermo_.carrier().Cp(cid, p, T);
458 case phaseProperties::LIQUID:
462 CpMixture += Y[i]*thermo_.liquids().properties()[i].Cp(p, T);
466 case phaseProperties::SOLID:
470 CpMixture += Y[i]*thermo_.solids().properties()[i].Cp();
477 <<
"Unknown phase enumeration" 486 template<
class CloudType>
496 scalar LMixture = 0.0;
497 switch (props.
phase())
499 case phaseProperties::GAS:
504 <<
"No support for gaseous components" <<
endl;
508 case phaseProperties::LIQUID:
512 LMixture += Y[i]*thermo_.liquids().properties()[i].hl(p, T);
516 case phaseProperties::SOLID:
521 <<
"No support for solid components" <<
endl;
528 <<
"Unknown phase enumeration" virtual scalar L(const label phaseI, const scalarField &Y, const scalar p, const scalar T) const
Return latent heat for the phase phaseI.
#define forAll(list, i)
Loop across all elements in list.
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 SLGThermo & thermo() const
Return the thermo database.
const phasePropertiesList & phaseProps() const
Return the list of phase properties.
CompositionModel(CloudType &owner)
Construct null from owner.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Helper class to manage multi-specie phase properties.
void size(const label)
Override size to be inconsistent with allocated storage.
const scalarField & Y0(const label phaseI) const
Return the list of phase phaseI mass fractions.
Ostream & endl(Ostream &os)
Add newline and flush stream.
scalarField X(const label phaseI, const scalarField &Y) const
Return the list of phase phaseI volume fractions fractions.
virtual scalar Hs(const label phaseI, const scalarField &Y, const scalar p, const scalar T) const
Return sensible enthalpy for the phase phaseI.
label localToCarrierId(const label phaseI, const label id, const bool allowNotFound=false) const
Return carrier id of component given local id.
virtual scalar H(const label phaseI, const scalarField &Y, const scalar p, const scalar T) const
Return total enthalpy for the phase phaseI.
Base class for cloud sub-models.
rhoReactionThermo & thermo
virtual scalar Cp(const label phaseI, const scalarField &Y, const scalar p, const scalar T) const
Return specific heat capacity for the phase phaseI.
Specialization of basicMixture for a mixture consisting of a number for molecular species...
const wordList & phaseTypes() const
Return the list of phase type names.
A class for handling words, derived from string.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
errorManip< error > abort(error &err)
const labelList & carrierIds() const
Return const access to the map to the carrier ids.
phaseType phase() const
Return const access to the phase type.
Simple container for a list of phase properties.
label nPhase() const
Return the number of phases.
#define WarningInFunction
Report a warning using Foam::Warning.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
virtual ~CompositionModel()
Destructor.
label localId(const label phaseI, const word &cmptName, const bool allowNotFound=false) const
Return local id of component cmptName in phase phaseI.
const wordList & stateLabels() const
Return the list of state labels (s), (l), (g) etc.
Templated reacting parcel composition model class Consists of carrier species (via thermo package)...
virtual scalar Hc(const label phaseI, const scalarField &Y, const scalar p, const scalar T) const
Return chemical enthalpy for the phase phaseI.
Templated base class for dsmc cloud.
const basicSpecieMixture & carrier() const
Return the carrier components (wrapper function)
const wordList & componentNames(const label phaseI) const
Return the list of component names for phaseI.
label carrierId(const word &cmptName, const bool allowNotFound=false) const
Return global id of component cmptName in carrier thermo.
const liquidMixtureProperties & liquids() const
Return the global (additional) liquids.
const solidMixtureProperties & solids() const
Return the global (additional) solids.