41 #ifndef chemkinReader_H
42 #define chemkinReader_H
55 #include <FlexLexer.h>
97 thirdBodyReactionType,
98 unimolecularFallOffReactionType,
99 chemicallyActivatedBimolecularReactionType,
102 LandauTellerReactionType,
103 reverseLandauTellerReactionType,
105 powerSeriesReactionRateType,
106 radiationActivatedReactionType,
107 speciesTempReactionType,
108 energyLossReactionType,
109 plasmaMomentumTransfer,
110 collisionCrossSection,
111 nonEquilibriumReversibleReactionType,
112 duplicateReactionType,
123 nonEquilibriumReversible,
127 static const char* reactionTypeNames[4];
129 enum reactionRateType
134 chemicallyActivatedBimolecular,
138 unknownReactionRateType
141 static const char* reactionRateTypeNames[8];
143 enum fallOffFunctionType
148 unknownFallOffFunctionType
151 static const char* fallOffFunctionNames[4];
154 void initReactionKeywordTable();
158 DynamicList<word> elementNames_;
161 HashTable<label> elementIndices_;
164 HashTable<scalar> isotopeAtomicWts_;
167 DynamicList<word> specieNames_;
170 HashTable<label> specieIndices_;
176 HashTable<phase> speciePhase_;
179 HashPtrTable<gasHThermoPhysics> speciesThermo_;
185 ReactionList<gasHThermoPhysics> reactions_;
188 dictionary transportDict_;
194 scalar imbalanceTol_;
202 inline scalar stringToScalar(
const string&
s)
204 string& str =
const_cast<string&
>(
s);
205 str.replaceAll(
" ",
"");
206 str.replaceAll(
"D",
"e");
207 str.replaceAll(
"d",
"e");
208 return atof(str.c_str());
211 inline scalar stringToScalar(
const char* cstr)
213 return stringToScalar(
string(cstr));
216 inline void correctElementName(word& elementName)
218 if (elementName.size() == 2)
220 elementName[1] = tolower(elementName[1]);
222 else if (elementName[0] ==
'E')
228 scalar molecularWeight
233 void finishElements(
labelList& currentAtoms);
238 const char* reationRateName,
242 template<
class ReactionRateType>
245 const reactionType rType,
246 DynamicList<gasHReaction::specieCoeffs>& lhs,
247 DynamicList<gasHReaction::specieCoeffs>& rhs,
248 const ReactionRateType& rr
251 template<
template<
class,
class>
class PressureDependencyType>
252 void addPressureDependentReaction
254 const reactionType rType,
255 const fallOffFunctionType fofType,
256 DynamicList<gasHReaction::specieCoeffs>& lhs,
257 DynamicList<gasHReaction::specieCoeffs>& rhs,
261 const HashTable<scalarList>& reactionCoeffsTable,
262 const scalar Afactor0,
263 const scalar AfactorInf,
269 DynamicList<gasHReaction::specieCoeffs>& lhs,
270 DynamicList<gasHReaction::specieCoeffs>& rhs,
272 const reactionType rType,
273 const reactionRateType rrType,
274 const fallOffFunctionType fofType,
276 HashTable<scalarList>& reactionCoeffsTable,
283 const fileName& CHEMKINFileName,
284 const fileName& thermoFileName,
285 const fileName& transportFileName
289 chemkinReader(
const chemkinReader&) =
delete;
292 void operator=(
const chemkinReader&) =
delete;
307 const fileName& CHEMKINFileName,
308 const fileName& transportFileName,
310 const bool newFormat =
false
326 return elementNames_;
332 return elementIndices_;
338 return isotopeAtomicWts_;
344 return speciesTable_;
350 return speciesComposition_;
362 return speciesThermo_;