35 template<
class ThermoType>
38 const dictionary&
dict,
48 template<
class ThermoType>
53 if (!chemDict_.readIfPresent(
"elements", elems))
55 Info<<
" elements not defined in " << chemDict_.name() <<
endl;
59 DynamicList<word> elementNames_;
60 HashTable<label> elementIndices_;
62 for (
const word& elemName : elems)
64 if (elementIndices_.insert(elemName, elementNames_.size()))
66 elementNames_.append(elemName);
71 <<
"element " << elemName <<
" already in table." <<
endl;
76 for (
const word& specieName : speciesTable_)
79 thermoDict_.subDict(specieName).findDict(
"elements");
84 <<
"Specie " << specieName
85 <<
" does not contain \"elements\" description." 89 wordList elemNames(elemsDict->toc());
90 List<specieElement> currentComposition(elemNames.size());
94 currentComposition[eni].name() = elemNames[eni];
96 currentComposition[eni].nAtoms() =
97 elemsDict->getOrDefault<label>
106 speciesComposition_.erase(specieName);
107 speciesComposition_.set(specieName, currentComposition);
114 template<
class ThermoType>
137 speciesTable_(setSpecies(chemDict_, species)),
138 speciesThermo_(thermoDict_),
139 reactions_(speciesTable_, speciesThermo_, chemDict_)
141 readSpeciesComposition();
145 template<
class ThermoType>
167 speciesTable_(setSpecies(chemDict_, species)),
168 speciesThermo_(thermoDict_),
169 reactions_(speciesTable_, speciesThermo_, chemDict_)
171 readSpeciesComposition();
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
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 a number of values (eg...
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.
#define forAll(list, i)
Loop across all elements in list.
Chemistry reader for OpenFOAM format.
const dictionary & thermoDict
Input from file stream as an ISstream, normally using std::ifstream for the actual input...
List< word > wordList
List of word.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
messageStream Info
Information stream (stdout output on master, null elsewhere)
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
Abstract class for reading chemistry.
string expand(const std::string &s, const HashTable< string > &mapping, const char sigil='$')
Expand occurrences of variables according to the mapping and return the expanded string.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...