32 template<
class ThermoType>
35 const dictionary& dict,
45 template<
class ThermoType>
48 if (!chemDict_.found(
"elements"))
50 Info<<
" elements not defined in " << chemDict_.name() <<
endl;
55 label currentElementIndex(0);
57 DynamicList<word> elementNames_;
58 HashTable<label> elementIndices_;
62 if (!elementIndices_.found(
e[ei]))
64 elementIndices_.insert(
e[ei], currentElementIndex++);
65 elementNames_.append(
e[ei]);
70 <<
"element " <<
e[ei] <<
" already in table." <<
endl;
78 if (thermoDict_.subDict(speciesTable_[si]).isDict(
"elements"))
80 dictionary currentElements
82 thermoDict_.subDict(speciesTable_[si]).subDict(
"elements")
85 wordList currentElementsName(currentElements.toc());
86 List<specieElement> currentComposition(currentElementsName.size());
88 forAll(currentElementsName, eni)
90 currentComposition[eni].name() = currentElementsName[eni];
92 currentComposition[eni].nAtoms() =
93 currentElements.lookupOrDefault
95 currentElementsName[eni],
101 speciesCompositionTable::iterator specieCompositionIter
103 speciesComposition_.find(speciesTable_[si])
106 if (specieCompositionIter != speciesComposition_.end())
108 speciesComposition_.erase(specieCompositionIter);
111 speciesComposition_.insert(speciesTable_[si], currentComposition);
116 <<
"Specie " << speciesTable_[si]
117 <<
" does not contain element description." 126 template<
class ThermoType>
149 speciesTable_(setSpecies(chemDict_, species)),
150 speciesThermo_(thermoDict_),
151 reactions_(speciesTable_, speciesThermo_, chemDict_)
153 readSpeciesComposition();
157 template<
class ThermoType>
179 speciesTable_(setSpecies(chemDict_, species)),
180 speciesThermo_(thermoDict_),
181 reactions_(speciesTable_, speciesThermo_, chemDict_)
183 readSpeciesComposition();
#define forAll(list, i)
Loop across all elements in list.
string expand(const string &, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Expand occurences of variables according to the mapping.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
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...
Ostream & endl(Ostream &os)
Add newline and flush stream.
hashedWordList speciesTable
A table of species as a hashedWordList.
Macros for easy insertion into run-time selection tables.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar e
Elementary charge.
Chemistry reader for OpenFOAM format.
List< word > wordList
A List of words.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A wordList with hashed indices for faster lookup by name.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
Abstract class for reading chemistry.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.