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_;
358 const ReactionTable<gasHThermoPhysics>&
speciesThermo()
const 360 return speciesThermo_;
const ReactionTable< gasHThermoPhysics > & speciesThermo() const
Table of the thermodynamic data given in the CHEMKIN file.
TypeName("chemkinReader")
Runtime type information.
static const fileName null
An empty fileName.
Type definitions for reactions.
const ReactionList< gasHThermoPhysics > & reactions() const
List of the reactions.
hashedWordList speciesTable
A table of species as a hashedWordList.
const HashTable< phase > & speciePhase() const
Specie phase.
const HashTable< scalar > & isotopeAtomicWts() const
Isotope molecular weights.
List< scalar > scalarList
A List of scalars.
const wordList & elementNames() const
List of elements.
const dictionary & thermoDict
const HashTable< label > & elementIndices() const
Element indices.
List of templated reactions.
List< word > wordList
A List of words.
const scalar RR
Universal gas constant: default in [J/(kmol K)].
const speciesCompositionTable & specieComposition() const
Table of species composition.
HashTable< List< specieElement > > speciesCompositionTable
List< label > labelList
A List of labels.
virtual ~chemkinReader()=default
Destructor.
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))
Abstract class for reading chemistry.
const speciesTable & species() const
Table of species.