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
59 List<List<specieElement>> specieCompositions(species_.size());
65 if (thermoDict.subDict(species_[i]).isDict(
"elements"))
67 const dictionary& elements =
68 thermoDict.subDict(species_[i]).subDict(
"elements");
70 const wordList elementsNames(elements.toc());
72 specieCompositions[i].
resize(elementsNames.size());
76 specieCompositions[i][eni].name() = elementsNames[eni];
77 specieCompositions[i][eni].nAtoms() =
78 elements.lookupOrDefault(elementsNames[eni], 0);
83 return specieCompositions;
89 template<
class ThermoType>
100 thermoDict.
lookup(
"species"),
104 specieThermos_(readSpeciesData(thermoDict)),
105 specieCompositions_(readSpeciesComposition(thermoDict))
107 correctMassFractions();
113 template<
class ThermoType>
119 specieThermos_ = readSpeciesData(thermoDict);
120 specieCompositions_ = readSpeciesComposition(thermoDict);
124 template<
class ThermoType>
131 if (specieCompositions_[speciei].empty())
134 refCast<const dictionary>(*this)
135 .subDict(species_[speciei])
136 .subDict(
"elements");
139 return specieCompositions_[speciei];
#define forAll(list, i)
Loop across all elements in list.
A list of keyword definitions, which are a keyword followed by any number of values (e...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void resize(const label)
Alias for setSize(const label)
Specialisation of basicMixture for a mixture consisting of a number for molecular species...
A class for handling words, derived from string.
Foam::multiComponentMixture.
List< word > wordList
A List of words.
Mesh data needed to do the Finite Volume discretisation.
const List< specieElement > & specieComposition(const label speciei) const
Return composition based on index.
multiComponentMixture(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
void read(const dictionary &)
Read dictionary.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.