42 #ifndef chemkinReader_H
43 #define chemkinReader_H
54 #include <FlexLexer.h>
95 thirdBodyReactionType,
96 unimolecularFallOffReactionType,
97 chemicallyActivatedBimolecularReactionType,
100 LandauTellerReactionType,
101 reverseLandauTellerReactionType,
103 powerSeriesReactionRateType,
104 radiationActivatedReactionType,
105 speciesTempReactionType,
106 energyLossReactionType,
107 plasmaMomentumTransfer,
108 collisionCrossSection,
109 nonEquilibriumReversibleReactionType,
110 duplicateReactionType,
121 nonEquilibriumReversible,
125 static const char* reactionTypeNames[4];
127 enum reactionRateType
132 chemicallyActivatedBimolecular,
136 unknownReactionRateType
139 static const char* reactionRateTypeNames[8];
141 enum fallOffFunctionType
146 unknownFallOffFunctionType
149 static const char* fallOffFunctionNames[4];
152 void initReactionKeywordTable();
156 DynamicList<word> elementNames_;
159 HashTable<label> elementIndices_;
162 HashTable<scalar> isotopeAtomicWts_;
165 DynamicList<word> specieNames_;
168 HashTable<label> specieIndices_;
174 HashTable<phase> speciePhase_;
177 ReactionTable<gasHThermoPhysics> speciesThermo_;
183 ReactionList<gasHThermoPhysics> reactions_;
186 dictionary transportDict_;
192 scalar imbalanceTol_;
200 inline scalar stringToScalar(
const string&
s)
202 string& str =
const_cast<string&
>(
s);
203 str.replaceAll(
" ",
"");
204 str.replaceAll(
"D",
"e");
205 str.replaceAll(
"d",
"e");
206 return atof(str.c_str());
209 inline scalar stringToScalar(
const char* cstr)
211 return stringToScalar(
string(cstr));
214 inline void correctElementName(word& elementName)
216 if (elementName.size() == 2)
218 elementName[1] = tolower(elementName[1]);
220 else if (elementName[0] ==
'E')
226 scalar molecularWeight
231 void finishElements(
labelList& currentAtoms);
236 const char* reationRateName,
240 template<
class ReactionRateType>
243 const reactionType rType,
244 DynamicList<gasHReaction::specieCoeffs>& lhs,
245 DynamicList<gasHReaction::specieCoeffs>& rhs,
246 const ReactionRateType& rr
249 template<
template<
class,
class>
class PressureDependencyType>
250 void addPressureDependentReaction
252 const reactionType rType,
253 const fallOffFunctionType fofType,
254 DynamicList<gasHReaction::specieCoeffs>& lhs,
255 DynamicList<gasHReaction::specieCoeffs>& rhs,
259 const HashTable<scalarList>& reactionCoeffsTable,
260 const scalar Afactor0,
261 const scalar AfactorInf,
267 DynamicList<gasHReaction::specieCoeffs>& lhs,
268 DynamicList<gasHReaction::specieCoeffs>& rhs,
270 const reactionType rType,
271 const reactionRateType rrType,
272 const fallOffFunctionType fofType,
274 HashTable<scalarList>& reactionCoeffsTable,
281 const fileName& CHEMKINFileName,
282 const fileName& thermoFileName,
283 const fileName& transportFileName
287 chemkinReader(
const chemkinReader&) =
delete;
290 void operator=(
const chemkinReader&) =
delete;
305 const fileName& CHEMKINFileName,
306 const fileName& transportFileName,
308 const bool newFormat =
false
324 return elementNames_;
330 return elementIndices_;
336 return isotopeAtomicWts_;
342 return speciesTable_;
348 return speciesComposition_;
360 return speciesThermo_;