42#ifndef chemkinReader_H
43#define chemkinReader_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;
308 const bool newFormat =
false
324 return elementNames_;
330 return elementIndices_;
336 return isotopeAtomicWts_;
342 return speciesTable_;
348 return speciesComposition_;
360 return speciesThermo_;
A HashTable similar to std::unordered_map.
List of templated reactions.
Abstract class for reading chemistry.
TypeName("chemkinReader")
Runtime type information.
const ReactionTable< gasHThermoPhysics > & speciesThermo() const
Table of the thermodynamic data given in the CHEMKIN file.
const HashTable< label > & elementIndices() const
Element indices.
virtual ~chemkinReader()=default
Destructor.
const HashTable< phase > & speciePhase() const
Specie phase.
const HashTable< scalar > & isotopeAtomicWts() const
Isotope molecular weights.
const wordList & elementNames() const
List of elements.
const ReactionList< gasHThermoPhysics > & reactions() const
List of the reactions.
const speciesTable & species() const
Table of species.
const speciesCompositionTable & specieComposition() const
Table of species composition.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
const dictionary & thermoDict
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
const scalar RR
Universal gas constant: default in [J/(kmol K)].
List< label > labelList
A List of labels.
List< scalar > scalarList
A List of scalars.
hashedWordList speciesTable
A table of species as a hashedWordList.
HashTable< List< specieElement > > speciesCompositionTable
Type definitions for reactions.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.