33template<
class CloudType>
42template<
class CloudType>
54 this->coeffDict().
lookup(
"phases"),
55 thermo_.carrier().species(),
56 thermo_.liquids().components(),
57 thermo_.solids().components()
62template<
class CloudType>
70 phaseProps_(cm.phaseProps_)
76template<
class CloudType>
83template<
class CloudType>
90template<
class CloudType>
94 return thermo_.carrier();
98template<
class CloudType>
102 return thermo_.liquids();
106template<
class CloudType>
110 return thermo_.solids();
114template<
class CloudType>
122template<
class CloudType>
125 return phaseProps_.size();
129template<
class CloudType>
133 if (phaseProps_.size() == 1)
135 return phaseProps_[0].names();
139 return phaseProps_.phaseTypes();
144template<
class CloudType>
147 return phaseProps_.stateLabels();
151template<
class CloudType>
155 return phaseProps_[
phasei].names();
159template<
class CloudType>
162 const word& cmptName,
163 const bool allowNotFound
166 label
id = thermo_.carrierId(cmptName);
168 if (
id < 0 && !allowNotFound)
171 <<
"Unable to determine global id for requested component "
172 << cmptName <<
". Available components are " <<
nl
173 << thermo_.carrier().species()
181template<
class CloudType>
185 const word& cmptName,
186 const bool allowNotFound
189 label
id = phaseProps_[
phasei].id(cmptName);
191 if (
id < 0 && !allowNotFound)
194 <<
"Unable to determine local id for component " << cmptName
202template<
class CloudType>
207 const bool allowNotFound
210 label cid = phaseProps_[
phasei].carrierIds()[id];
212 if (cid < 0 && !allowNotFound)
215 <<
"Unable to determine global carrier id for phase "
216 <<
phasei <<
" with local id " <<
id
224template<
class CloudType>
230 return phaseProps_[
phasei].Y();
234template<
class CloudType>
244 switch (props.
phase())
251 X[i] =
Y[i]/thermo_.carrier().W(cid);
260 X[i] =
Y[i]/thermo_.liquids().properties()[i].W();
269 X[i] =
Y[i]/thermo_.solids().properties()[i].W();
276 tmp<scalarField> tfld = X/(WInv + ROOTVSMALL);
281template<
class CloudType>
291 scalar HMixture = 0.0;
292 switch (props.
phase())
299 HMixture +=
Y[i]*thermo_.carrier().Ha(cid,
p,
T);
307 HMixture +=
Y[i]*thermo_.liquids().properties()[i].h(
p,
T);
318 thermo_.solids().properties()[i].Hf()
319 + thermo_.solids().properties()[i].Cp()*
T
335template<
class CloudType>
345 scalar HsMixture = 0.0;
346 switch (props.
phase())
353 HsMixture +=
Y[i]*thermo_.carrier().Hs(cid,
p,
T);
364 thermo_.liquids().properties()[i].h(
p,
T)
365 - thermo_.liquids().properties()[i].h(
p, 298.15)
374 HsMixture +=
Y[i]*thermo_.solids().properties()[i].Cp()*
T;
381 <<
"Unknown phase enumeration"
390template<
class CloudType>
400 scalar HcMixture = 0.0;
401 switch (props.
phase())
408 HcMixture +=
Y[i]*thermo_.carrier().Hc(cid);
417 Y[i]*thermo_.liquids().properties()[i].h(
p, 298.15);
425 HcMixture +=
Y[i]*thermo_.solids().properties()[i].Hf();
432 <<
"Unknown phase enumeration"
441template<
class CloudType>
451 scalar CpMixture = 0.0;
452 switch (props.
phase())
459 CpMixture +=
Y[i]*thermo_.carrier().Cp(cid,
p,
T);
467 CpMixture +=
Y[i]*thermo_.liquids().properties()[i].Cp(
p,
T);
475 CpMixture +=
Y[i]*thermo_.solids().properties()[i].Cp();
482 <<
"Unknown phase enumeration"
491template<
class CloudType>
501 scalar LMixture = 0.0;
502 switch (props.
phase())
509 <<
"No support for gaseous components" <<
endl;
517 LMixture +=
Y[i]*thermo_.liquids().properties()[i].hl(
p,
T);
526 <<
"No support for solid components" <<
endl;
533 <<
"Unknown phase enumeration"
542template<
class CloudType>
554 const auto& carrier = this->carrier();
561 label cid = phaseProps_[idGas()].carrierIds()[i];
562 Xgas[i] = YMix[idGas()]*Ygas[i]/carrier.W(cid);
569 Xliq[i] = YMix[idLiquid()]*Yliq[i]/
thermo.liquids().properties()[i].W();
576 Xsol[i] = YMix[idSolid()]*Ysol[i]/
thermo.solids().properties()[i].W();
580 Xgas /= (WInv + ROOTVSMALL);
581 Xliq /= (WInv + ROOTVSMALL);
582 Xsol /= (WInv + ROOTVSMALL);
588 label cid = phaseProps_[idGas()].carrierIds()[i];
589 rho += Xgas[i]*carrier.rho(cid,
p,
T);
593 rho += Xliq[i]*
thermo.liquids().properties()[i].rho(
p,
T);
597 rho += Xsol[i]*
thermo.solids().properties()[i].rho();
Base class for cloud sub-models.
Templated reacting parcel composition model class Consists of carrier species (via thermo package),...
const liquidMixtureProperties & liquids() const
Return the global (additional) liquids.
const wordList & stateLabels() const
Return the list of state labels (s), (l), (g) etc.
const phasePropertiesList & phaseProps() const
Return the list of phase properties.
const basicSpecieMixture & carrier() const
Return the carrier components (wrapper function)
const SLGThermo & thermo() const
Return the thermo database.
virtual ~CompositionModel()
Destructor.
label nPhase() const
Return the number of phases.
label localToCarrierId(const label phaseI, const label id, const bool allowNotFound=false) const
Return carrier id of component given local id.
virtual scalar Hs(const label phaseI, const scalarField &Y, const scalar p, const scalar T) const
Return sensible enthalpy for the phase phaseI.
const solidMixtureProperties & solids() const
Return the global (additional) solids.
label localId(const label phaseI, const word &cmptName, const bool allowNotFound=false) const
Return local id of component cmptName in phase phaseI.
label carrierId(const word &cmptName, const bool allowNotFound=false) const
Return global id of component cmptName in carrier thermo.
const scalarField & Y0(const label phaseI) const
Return the list of phase phaseI mass fractions.
const wordList & phaseTypes() const
Return the list of phase type names.
Templated base class for dsmc cloud.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
void size(const label n)
Older name for setAddressableSize.
Specialization of basicMultiComponentMixture for a mixture consisting of a number for molecular speci...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
scalar Hc() const
Chemical enthalpy [J/kg].
tmp< GeometricField< Type, faPatchField, areaMesh > > H() const
Return the H operation source.
static const char *const componentNames[]
Simple container for a list of phase properties.
Helper class to manage multi-specie phase properties.
const labelList & carrierIds() const
Return const access to the map to the carrier ids.
phaseType phase() const
Return const access to the phase type.
Lookup type of boundary radiation properties.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
PtrList< volScalarField > & Y
const volScalarField & Cp
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
const vector L(dict.get< vector >("L"))