Go to the documentation of this file.
36 #ifndef chemkinReader_H
37 #define chemkinReader_H
52 #include <FlexLexer.h>
228 string& str =
const_cast<string&
>(
s);
232 return atof(str.c_str());
242 if (elementName.size() == 2)
244 elementName[1] = tolower(elementName[1]);
246 else if (elementName[0] ==
'E')
262 const char* reationRateName,
266 template<
class ReactionRateType>
272 const ReactionRateType& rr
275 template<
template<
class,
class>
class PressureDependencyType>
286 const scalar Afactor0,
287 const scalar AfactorInf,
334 const bool newFormat =
false
const scalar RR
Universal gas constant (default in [J/(kmol K)])
@ unknownReactionRateType
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Abstract class for reading chemistry.
string & replaceAll(const string &oldStr, const string &newStr, size_type start=0)
Replace all occurences of sub-string oldStr with newStr.
@ powerSeriesReactionRateType
HashTable< label > elementIndices_
Element indices.
A class for handling words, derived from string.
const HashPtrTable< gasHThermoPhysics > & speciesThermo() const
Table of the thermodynamic data given in the CHEMKIN file.
A class for handling file names.
HashTable< int > reactionKeywordTable_
Table of reaction type keywords.
void checkCoeffs(const scalarList &reactionCoeffs, const char *reationRateName, const label nCoeffs) const
void read(const fileName &CHEMKINFileName, const fileName &thermoFileName, const fileName &transportFileName)
scalar stringToScalar(const string &s)
bool operator==(const specieElement &se) const
reactionKeyword
Currently supported reaction types.
chemkinReader(const chemkinReader &)
Disallow default bitwise copy construct.
const HashTable< List< specieElement > > & specieComposition() const
Table of species composition.
@ nonEquilibriumReversible
void addReactionType(const reactionType rType, DynamicList< gasHReaction::specieCoeffs > &lhs, DynamicList< gasHReaction::specieCoeffs > &rhs, const ReactionRateType &rr)
void finishElements(labelList ¤tAtoms)
const wordList & elementNames() const
List of elements.
HashTable< label > specieIndices_
Specie indices.
const ReactionList< gasHThermoPhysics > & reactions() const
List of the reactions.
@ radiationActivatedReactionType
Switch newFormat_
Flag to indicate that file is in new format.
static const char * fallOffFunctionNames[4]
List of templated reactions.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
DynamicList< word > specieNames_
List of species.
A wordList with hashed indices for faster lookup by name.
@ chemicallyActivatedBimolecularReactionType
static const char * reactionTypeNames[4]
const HashTable< phase > & speciePhase() const
Specie phase.
const HashTable< scalar > & isotopeAtomicWts() const
Isotope molecular weights.
int lex()
Flex lexer to read the CHEMKIN III file.
void addReaction(DynamicList< gasHReaction::specieCoeffs > &lhs, DynamicList< gasHReaction::specieCoeffs > &rhs, const scalarList &thirdBodyEfficiencies, const reactionType rType, const reactionRateType rrType, const fallOffFunctionType fofType, const scalarList &ArrheniusReactionCoeffs, HashTable< scalarList > &reactionCoeffsTable, const scalar RR)
TypeName("chemkinReader")
Runtime type information.
const speciesTable & species() const
Table of species.
@ speciesTempReactionType
@ chemicallyActivatedBimolecular
scalar stringToScalar(const char *cstr)
scalar molecularWeight(const List< specieElement > &specieComposition) const
A list of keyword definitions, which are a keyword followed by any number of values (e....
friend Ostream & operator<<(Ostream &os, const specieElement &se)
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))
static const fileName null
An empty fileName.
void correctElementName(word &elementName)
void initReactionKeywordTable()
ReactionList< gasHThermoPhysics > reactions_
List of the reactions.
bool operator!=(const specieElement &se) const
speciesTable & speciesTable_
Table of species.
void operator=(const chemkinReader &)
Disallow default bitwise assignment.
@ unknownFallOffFunctionType
@ nonEquilibriumReversibleReactionType
A HashTable specialization for hashing pointers.
scalar imbalanceTol_
Tolerance for element imbalance in a reaction.
@ LandauTellerReactionType
HashTable< List< specieElement > > specieComposition_
Table of species composition.
void addPressureDependentReaction(const reactionType rType, const fallOffFunctionType fofType, DynamicList< gasHReaction::specieCoeffs > &lhs, DynamicList< gasHReaction::specieCoeffs > &rhs, const scalarList &thirdBodyEfficiencies, const scalarList &k0Coeffs, const scalarList &kInfCoeffs, const HashTable< scalarList > &reactionCoeffsTable, const scalar Afactor0, const scalar AfactorInf, const scalar RR)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
HashPtrTable< gasHThermoPhysics > speciesThermo_
Table of the thermodynamic data given in the CHEMKIN file.
DynamicList< word > elementNames_
List of elements.
@ unimolecularFallOffReactionType
dictionary transportDict_
Transport properties dictionary.
HashTable< scalar > isotopeAtomicWts_
Isotope molecular weights.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
HashTable< phase > speciePhase_
Specie phase.
const HashTable< label > & elementIndices() const
Element indices.
Type definitions for reactions.
virtual ~chemkinReader()
Destructor.
static const char * reactionRateTypeNames[8]
@ reverseLandauTellerReactionType