30 template<
class ThermoType>
34 const dictionary& thermoDict
37 PtrList<ThermoType> specieThermos(species_.size());
44 new ThermoType(species_[i], 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))
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 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Specialisation of basicMixture for a mixture consisting of a number for molecular species.
void correctMassFractions()
Scale the mass fractions to sum to 1.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Mesh data needed to do the Finite Volume discretisation.
Foam::multicomponentMixture.
const List< specieElement > & specieComposition(const label speciei) const
Return composition based on index.
void read(const dictionary &)
Read dictionary.
multicomponentMixture(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
A class for handling words, derived from string.
List< word > wordList
A List of words.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.