35template<
class ThermoType>
38 const dictionary&
dict,
48template<
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_)
78 const dictionary* elemsDict =
79 thermoDict_.subDict(specieName).findDict(
"elements");
84 <<
"Specie " << specieName
85 <<
" does not contain \"elements\" description."
86 <<
exit(FatalIOError);
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);
114template<
class ThermoType>
127 fileName(reactionsFileName).expand()
137 speciesTable_(setSpecies(chemDict_, species)),
138 speciesThermo_(thermoDict_),
139 reactions_(speciesTable_, speciesThermo_, chemDict_)
141 readSpeciesComposition();
145template<
class ThermoType>
167 speciesTable_(setSpecies(chemDict_, species)),
168 speciesThermo_(thermoDict_),
169 reactions_(speciesTable_, speciesThermo_, chemDict_)
171 readSpeciesComposition();
Macros for easy insertion into run-time selection tables.
Input from file stream, using an ISstream.
Abstract class for reading chemistry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
Chemistry reader for OpenFOAM format.
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
const dictionary & thermoDict
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
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))
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
List< word > wordList
A List of words.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.