30 template<
class ThermoType>
34 const dictionary& thermoDict
37 PtrList<ThermoType> specieThermos(species_.size());
44 new ThermoType(thermoDict.subDict(species_[i]))
52 template<
class ThermoType>
56 const dictionary& thermoDict,
66 if (thermoDict.subDict(species[si]).isDict(
"elements"))
68 dictionary currentElements
70 thermoDict.subDict(species[si]).subDict(
"elements")
73 wordList currentElementsName(currentElements.toc());
74 List<specieElement> currentComposition(currentElementsName.size());
76 forAll(currentElementsName, eni)
78 currentComposition[eni].name() = currentElementsName[eni];
80 currentComposition[eni].nAtoms() =
81 currentElements.lookupOrDefault
83 currentElementsName[eni],
89 speciesCompositionTable::iterator specieCompositionIter
91 speciesComposition_.find(species[si])
94 if (specieCompositionIter != speciesComposition_.end())
96 speciesComposition_.erase(specieCompositionIter);
99 speciesComposition_.insert(species[si], currentComposition);
103 return speciesComposition_;
107 template<
class ThermoType>
118 if (
mag(
max(
Yt).value()) < rootVSmall)
121 <<
"Sum of mass fractions is zero for species " << this->species()
134 template<
class ThermoType>
139 const word& phaseName
145 thermoDict.
lookup(
"species"),
149 specieThermos_(readSpeciesData(thermoDict)),
150 speciesComposition_(readSpeciesComposition(thermoDict, species())),
151 mixture_(
"mixture", specieThermos_[0]),
152 mixtureVol_(
"volMixture", specieThermos_[0])
154 correctMassFractions();
160 template<
class ThermoType>
166 mixture_ = Y_[0][celli]*specieThermos_[0];
170 mixture_ += Y_[
n][celli]*specieThermos_[
n];
177 template<
class ThermoType>
184 mixture_ = Y_[0].boundaryField()[
patchi][facei]*specieThermos_[0];
188 mixture_ += Y_[
n].boundaryField()[
patchi][facei]*specieThermos_[
n];
195 template<
class ThermoType>
206 rhoInv += Y_[i][celli]/specieThermos_[i].rho(p, T);
210 Y_[0][celli]/specieThermos_[0].rho(p, T)/rhoInv*specieThermos_[0];
215 Y_[
n][celli]/specieThermos_[
n].rho(p, T)/rhoInv*specieThermos_[
n];
222 template<
class ThermoType>
236 Y_[i].boundaryField()[
patchi][facei]/specieThermos_[i].rho(p, T);
240 Y_[0].boundaryField()[
patchi][facei]/specieThermos_[0].rho(p, T)/rhoInv
246 Y_[
n].boundaryField()[
patchi][facei]/specieThermos_[
n].rho(p,T)
247 / rhoInv*specieThermos_[
n];
254 template<
class ThermoType>
262 specieThermos_[i] = ThermoType(thermoDict.
subDict(species_[i]));
#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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Specialization of basicMixture for a mixture consisting of a number for molecular species...
hashedWordList speciesTable
A table of species as a hashedWordList.
const ThermoType & patchFaceVolMixture(const scalar p, const scalar T, const label patchi, const label facei) const
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
A class for handling words, derived from string.
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Foam::multiComponentMixture.
HashTable< List< specieElement > > speciesCompositionTable
List< word > wordList
A List of words.
const ThermoType & cellMixture(const label celli) const
Mesh data needed to do the Finite Volume discretisation.
multiComponentMixture(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
dimensioned< scalar > mag(const dimensioned< Type > &)
const ThermoType & cellVolMixture(const scalar p, const scalar T, const label celli) const
void read(const dictionary &)
Read dictionary.
volScalarField Yt(0.0 *Y[0])
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.