36 #ifndef chemkinReader_H
37 #define chemkinReader_H
51 #include <FlexLexer.h>
111 static int yyBufSize;
120 thirdBodyReactionType,
121 unimolecularFallOffReactionType,
122 chemicallyActivatedBimolecularReactionType,
125 LandauTellerReactionType,
126 reverseLandauTellerReactionType,
128 powerSeriesReactionRateType,
129 radiationActivatedReactionType,
130 speciesTempReactionType,
131 energyLossReactionType,
132 plasmaMomentumTransfer,
133 collisionCrossSection,
134 nonEquilibriumReversibleReactionType,
135 duplicateReactionType,
146 nonEquilibriumReversible,
150 static const char* reactionTypeNames[4];
152 enum reactionRateType
157 chemicallyActivatedBimolecular,
161 unknownReactionRateType
164 static const char* reactionRateTypeNames[8];
166 enum fallOffFunctionType
171 unknownFallOffFunctionType
174 static const char* fallOffFunctionNames[4];
177 void initReactionKeywordTable();
181 DynamicList<word> elementNames_;
184 HashTable<label> elementIndices_;
187 HashTable<scalar> isotopeAtomicWts_;
190 DynamicList<word> specieNames_;
193 HashTable<label> specieIndices_;
196 speciesTable speciesTable_;
199 HashTable<phase> speciePhase_;
202 HashPtrTable<gasThermoPhysics> speciesThermo_;
205 HashTable<List<specieElement> > specieComposition_;
208 SLPtrList<gasReaction> reactions_;
216 inline scalar stringToScalar(
const string& s)
218 string& str =
const_cast<string&
>(s);
219 str.replaceAll(
" ",
"");
220 str.replaceAll(
"D",
"e");
221 str.replaceAll(
"d",
"e");
222 return atof(str.c_str());
225 inline scalar stringToScalar(
const char* cstr)
227 return stringToScalar(
string(cstr));
230 inline void correctElementName(word& elementName)
232 if (elementName.size() == 2)
234 elementName[1] = tolower(elementName[1]);
236 else if(elementName[0] ==
'E')
242 scalar molecularWeight
247 void finishElements(
labelList& currentAtoms);
252 const char* reationRateName,
256 template<
class ReactionRateType>
259 const reactionType rType,
260 DynamicList<gasReaction::specieCoeffs>& lhs,
261 DynamicList<gasReaction::specieCoeffs>& rhs,
262 const ReactionRateType& rr
265 template<
template<
class,
class>
class PressureDependencyType>
266 void addPressureDependentReaction
268 const reactionType rType,
269 const fallOffFunctionType fofType,
270 DynamicList<gasReaction::specieCoeffs>& lhs,
271 DynamicList<gasReaction::specieCoeffs>& rhs,
275 const HashTable<scalarList>& reactionCoeffsTable,
276 const scalar Afactor0,
277 const scalar AfactorInf,
283 DynamicList<gasReaction::specieCoeffs>& lhs,
284 DynamicList<gasReaction::specieCoeffs>& rhs,
286 const reactionType rType,
287 const reactionRateType rrType,
288 const fallOffFunctionType fofType,
290 HashTable<scalarList>& reactionCoeffsTable,
297 const fileName& CHEMKINFileName,
298 const fileName& thermoFileName
303 chemkinReader(
const chemkinReader&);
306 void operator=(
const chemkinReader&);
320 const fileName& chemkinFile,
325 chemkinReader(
const dictionary& thermoDict);
339 return elementNames_;
345 return elementIndices_;
351 return isotopeAtomicWts_;
357 return speciesTable_;
369 return speciesThermo_;
375 return specieComposition_;