36 #ifndef chemkinReader_H
37 #define chemkinReader_H
57 #include <FlexLexer.h>
108 static int yyBufSize;
117 thirdBodyReactionType,
118 unimolecularFallOffReactionType,
119 chemicallyActivatedBimolecularReactionType,
122 LandauTellerReactionType,
123 reverseLandauTellerReactionType,
125 powerSeriesReactionRateType,
126 radiationActivatedReactionType,
127 speciesTempReactionType,
128 energyLossReactionType,
129 plasmaMomentumTransfer,
130 collisionCrossSection,
131 nonEquilibriumReversibleReactionType,
132 duplicateReactionType,
143 nonEquilibriumReversible,
147 static const char* reactionTypeNames[4];
149 enum reactionRateType
154 chemicallyActivatedBimolecular,
158 unknownReactionRateType
161 static const char* reactionRateTypeNames[8];
163 enum fallOffFunctionType
168 unknownFallOffFunctionType
171 static const char* fallOffFunctionNames[4];
174 void initReactionKeywordTable();
178 DynamicList<word> elementNames_;
181 HashTable<label> elementIndices_;
184 HashTable<scalar> isotopeAtomicWts_;
187 DynamicList<word> specieNames_;
190 HashTable<label> specieIndices_;
196 HashTable<phase> speciePhase_;
199 HashPtrTable<thermoPhysics> speciesThermo_;
202 mutable PtrList<thermoPhysics> speciesThermoList_;
208 ReactionList<thermoPhysics> reactions_;
211 dictionary transportDict_;
217 scalar imbalanceTol_;
225 inline scalar stringToScalar(
const string&
s)
227 string& str =
const_cast<string&
>(
s);
228 str.replaceAll(
" ",
"");
229 str.replaceAll(
"D",
"e");
230 str.replaceAll(
"d",
"e");
231 return atof(str.c_str());
234 inline scalar stringToScalar(
const char* cstr)
236 return stringToScalar(
string(cstr));
239 inline void correctElementName(word& elementName)
241 if (elementName.size() == 2)
243 elementName[1] = tolower(elementName[1]);
245 else if (elementName[0] ==
'E')
251 scalar molecularWeight
256 void finishElements(
labelList& currentAtoms);
261 const char* reactionRateName,
265 template<
class ReactionRateType>
268 const reactionType rType,
269 DynamicList<specieCoeffs>& lhs,
270 DynamicList<specieCoeffs>& rhs,
271 const ReactionRateType& rr
274 template<
template<
class,
class>
class PressureDependencyType>
275 void addPressureDependentReaction
277 const reactionType rType,
278 const fallOffFunctionType fofType,
279 DynamicList<specieCoeffs>& lhs,
280 DynamicList<specieCoeffs>& rhs,
284 const HashTable<scalarList>& reactionCoeffsTable,
285 const scalar Afactor0,
286 const scalar AfactorInf,
292 DynamicList<specieCoeffs>& lhs,
293 DynamicList<specieCoeffs>& rhs,
295 const reactionType rType,
296 const reactionRateType rrType,
297 const fallOffFunctionType fofType,
299 HashTable<scalarList>& reactionCoeffsTable,
306 const fileName& CHEMKINFileName,
307 const fileName& thermoFileName,
308 const fileName& transportFileName
312 chemkinReader(
const chemkinReader&) =
delete;
315 void operator=(
const chemkinReader&) =
delete;
328 const bool newFormat =
false
342 return elementNames_;
348 return elementIndices_;
354 return isotopeAtomicWts_;
360 return speciesTable_;
366 return speciesComposition_;
378 return speciesThermo_;
384 speciesThermoList_.resize(speciesTable_.size());
386 forAll(speciesTable_, speciei)
388 if (speciesThermoList_.set(speciei))
continue;
391 speciesThermo_.find(speciesTable_[speciei]);
393 speciesThermoList_.set(speciei, iter()->
clone());
396 return speciesThermoList_;
#define forAll(list, i)
Loop across all elements in list.
A HashTable specialisation for hashing pointers.
An STL-conforming const_iterator.
An STL-conforming hash table.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
List of templated reactions.
const ReactionList< thermoPhysics > & reactions() const
List of the reactions.
const wordList & elementNames() const
List of elements.
const HashTable< label > & elementIndices() const
Element indices.
sutherlandTransport< species::thermo< janafThermo< perfectGas< specie > >, sensibleEnthalpy > > thermoPhysics
const HashPtrTable< thermoPhysics > & speciesThermo() const
Table of the thermodynamic data given in the CHEMKIN file.
const speciesCompositionTable & specieComposition() const
Table of species composition.
const speciesTable & species() const
Table of species.
const PtrList< thermoPhysics > & speciesThermoList() const
List of the thermodynamic data given in the CHEMKIN file.
virtual ~chemkinReader()
Destructor.
const HashTable< scalar > & isotopeAtomicWts() const
Isotope molecular weights.
const HashTable< phase > & speciePhase() const
Specie phase.
A class for handling file names.
static const fileName null
An empty fileName.
A wordList with hashed indices for faster lookup by name.
Enthalpy based thermodynamics package using JANAF tables:
Perfect gas equation of state:
Thermodynamics mapping class to expose the sensible enthalpy functions.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Transport package using Sutherland's formula for viscosity:
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.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar RR
Universal gas constant: default SI units: [J/kmol/K].
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
List< scalar > scalarList
A List of scalars.
hashedWordList speciesTable
A table of species as a hashedWordList.
HashTable< List< specieElement > > speciesCompositionTable
Basic run-time type information using word as the type's name. Used to enhance the standard RTTI to c...