Data Structures | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
chemkinReader Class Reference

Foam::chemkinReader. More...

Inheritance diagram for chemkinReader:
Inheritance graph
[legend]
Collaboration diagram for chemkinReader:
Collaboration graph
[legend]

Data Structures

struct  specieElement
 species element More...
 

Public Types

enum  phase { solid, liquid, gas }
 
- Public Types inherited from chemistryReader< gasHThermoPhysics >
typedef gasHThermoPhysics thermoType
 The type of thermo package the reader was instantiated for. More...
 

Public Member Functions

 TypeName ("chemkinReader")
 Runtime type information. More...
 
 chemkinReader (speciesTable &species, const fileName &CHEMKINFileName, const fileName &transportFileName, const fileName &thermoFileName=fileName::null, const bool newFormat=false)
 Construct from CHEMKIN III file name. More...
 
 chemkinReader (const dictionary &thermoDict, speciesTable &species)
 Construct by getting the CHEMKIN III file name from dictionary. More...
 
virtual ~chemkinReader ()
 Destructor. More...
 
const wordListelementNames () const
 List of elements. More...
 
const HashTable< label > & elementIndices () const
 Element indices. More...
 
const HashTable< scalar > & isotopeAtomicWts () const
 Isotope molecular weights. More...
 
const speciesTablespecies () const
 Table of species. More...
 
const HashTable< phase > & speciePhase () const
 Specie phase. More...
 
const HashPtrTable< gasHThermoPhysics > & speciesThermo () const
 Table of the thermodynamic data given in the CHEMKIN file. More...
 
const HashTable< List< specieElement > > & specieComposition () const
 Table of species composition. More...
 
const ReactionList< gasHThermoPhysics > & reactions () const
 List of the reactions. More...
 
- Public Member Functions inherited from chemistryReader< gasHThermoPhysics >
 chemistryReader ()
 Construct null. More...
 
 TypeName ("chemistryReader")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, chemistryReader, dictionary,(const dictionary &thermoDict, speciesTable &species),(thermoDict, species))
 
virtual ~chemistryReader ()
 Destructor. More...
 
virtual const speciesTablespecies () const=0
 Return access to the list of species. More...
 
virtual const HashPtrTable< gasHThermoPhysics > & speciesThermo () const=0
 Return access to the thermo packages. More...
 
virtual const ReactionList< gasHThermoPhysics > & reactions () const=0
 Return access to the list of reactions. More...
 

Private Types

enum  reactionKeyword {
  thirdBodyReactionType, unimolecularFallOffReactionType, chemicallyActivatedBimolecularReactionType, TroeReactionType,
  SRIReactionType, LandauTellerReactionType, reverseLandauTellerReactionType, JanevReactionType,
  powerSeriesReactionRateType, radiationActivatedReactionType, speciesTempReactionType, energyLossReactionType,
  plasmaMomentumTransfer, collisionCrossSection, nonEquilibriumReversibleReactionType, duplicateReactionType,
  speciesOrderForward, speciesOrderReverse, UnitsOfReaction, end
}
 Currently supported reaction types. More...
 
enum  reactionType { irreversible, reversible, nonEquilibriumReversible, unknownReactionType }
 
enum  reactionRateType {
  Arrhenius, thirdBodyArrhenius, unimolecularFallOff, chemicallyActivatedBimolecular,
  LandauTeller, Janev, powerSeries, unknownReactionRateType
}
 
enum  fallOffFunctionType { Lindemann, Troe, SRI, unknownFallOffFunctionType }
 

Private Member Functions

void initReactionKeywordTable ()
 
int lex ()
 Flex lexer to read the CHEMKIN III file. More...
 
scalar stringToScalar (const string &s)
 
scalar stringToScalar (const char *cstr)
 
void correctElementName (word &elementName)
 
scalar molecularWeight (const List< specieElement > &specieComposition) const
 
void finishElements (labelList &currentAtoms)
 
void checkCoeffs (const scalarList &reactionCoeffs, const char *reationRateName, const label nCoeffs) const
 
template<class ReactionRateType >
void addReactionType (const reactionType rType, DynamicList< gasHReaction::specieCoeffs > &lhs, DynamicList< gasHReaction::specieCoeffs > &rhs, const ReactionRateType &rr)
 
template<template< class, class > class PressureDependencyType>
void addPressureDependentReaction (const reactionType rType, const fallOffFunctionType fofType, DynamicList< gasHReaction::specieCoeffs > &lhs, DynamicList< gasHReaction::specieCoeffs > &rhs, const scalarList &thirdBodyEfficiencies, const scalarList &k0Coeffs, const scalarList &kInfCoeffs, const HashTable< scalarList > &reactionCoeffsTable, const scalar Afactor0, const scalar AfactorInf, const scalar RR)
 
void addReaction (DynamicList< gasHReaction::specieCoeffs > &lhs, DynamicList< gasHReaction::specieCoeffs > &rhs, const scalarList &thirdBodyEfficiencies, const reactionType rType, const reactionRateType rrType, const fallOffFunctionType fofType, const scalarList &ArrheniusReactionCoeffs, HashTable< scalarList > &reactionCoeffsTable, const scalar RR)
 
void read (const fileName &CHEMKINFileName, const fileName &thermoFileName, const fileName &transportFileName)
 
 chemkinReader (const chemkinReader &)
 Disallow default bitwise copy construct. More...
 
void operator= (const chemkinReader &)
 Disallow default bitwise assignment. More...
 

Private Attributes

label lineNo_
 
HashTable< int > reactionKeywordTable_
 Table of reaction type keywords. More...
 
DynamicList< wordelementNames_
 List of elements. More...
 
HashTable< labelelementIndices_
 Element indices. More...
 
HashTable< scalar > isotopeAtomicWts_
 Isotope molecular weights. More...
 
DynamicList< wordspecieNames_
 List of species. More...
 
HashTable< labelspecieIndices_
 Specie indices. More...
 
speciesTablespeciesTable_
 Table of species. More...
 
HashTable< phasespeciePhase_
 Specie phase. More...
 
HashPtrTable< gasHThermoPhysicsspeciesThermo_
 Table of the thermodynamic data given in the CHEMKIN file. More...
 
HashTable< List< specieElement > > specieComposition_
 Table of species composition. More...
 
ReactionList< gasHThermoPhysicsreactions_
 List of the reactions. More...
 
dictionary transportDict_
 Transport properties dictionary. More...
 
Switch newFormat_
 Flag to indicate that file is in new format. More...
 
scalar imbalanceTol_
 Tolerance for element imbalance in a reaction. More...
 

Static Private Attributes

static int yyBufSize
 
static const char * reactionTypeNames [4]
 
static const char * reactionRateTypeNames [8]
 
static const char * fallOffFunctionNames [4]
 

Additional Inherited Members

- Static Public Member Functions inherited from chemistryReader< gasHThermoPhysics >
static autoPtr< chemistryReaderNew (const dictionary &thermoDict, speciesTable &species)
 Select constructed from dictionary. More...
 

Detailed Description

Foam::chemkinReader.

Source files

Definition at line 62 of file chemkinReader.H.

Member Enumeration Documentation

◆ phase

enum phase
Enumerator
solid 
liquid 
gas 

Definition at line 72 of file chemkinReader.H.

◆ reactionKeyword

enum reactionKeyword
private

Currently supported reaction types.

Enumerator
thirdBodyReactionType 
unimolecularFallOffReactionType 
chemicallyActivatedBimolecularReactionType 
TroeReactionType 
SRIReactionType 
LandauTellerReactionType 
reverseLandauTellerReactionType 
JanevReactionType 
powerSeriesReactionRateType 
radiationActivatedReactionType 
speciesTempReactionType 
energyLossReactionType 
plasmaMomentumTransfer 
collisionCrossSection 
nonEquilibriumReversibleReactionType 
duplicateReactionType 
speciesOrderForward 
speciesOrderReverse 
UnitsOfReaction 
end 

Definition at line 118 of file chemkinReader.H.

◆ reactionType

enum reactionType
private
Enumerator
irreversible 
reversible 
nonEquilibriumReversible 
unknownReactionType 

Definition at line 142 of file chemkinReader.H.

◆ reactionRateType

enum reactionRateType
private
Enumerator
Arrhenius 
thirdBodyArrhenius 
unimolecularFallOff 
chemicallyActivatedBimolecular 
LandauTeller 
Janev 
powerSeries 
unknownReactionRateType 

Definition at line 152 of file chemkinReader.H.

◆ fallOffFunctionType

enum fallOffFunctionType
private
Enumerator
Lindemann 
Troe 
SRI 
unknownFallOffFunctionType 

Definition at line 166 of file chemkinReader.H.

Constructor & Destructor Documentation

◆ chemkinReader() [1/3]

chemkinReader ( const chemkinReader )
private

Disallow default bitwise copy construct.

◆ chemkinReader() [2/3]

chemkinReader ( speciesTable species,
const fileName CHEMKINFileName,
const fileName transportFileName,
const fileName thermoFileName = fileName::null,
const bool  newFormat = false 
)

Construct from CHEMKIN III file name.

Definition at line 829 of file chemkinReader.C.

References Foam::read().

Here is the call graph for this function:

◆ chemkinReader() [3/3]

chemkinReader ( const dictionary thermoDict,
speciesTable species 
)

Construct by getting the CHEMKIN III file name from dictionary.

Definition at line 849 of file chemkinReader.C.

References Foam::endl(), string::expand(), dictionary::found(), Foam::Info, fileName::isAbsolute(), dictionary::lookup(), dictionaryName::name(), fileName::null, fileName::path(), and Foam::read().

Here is the call graph for this function:

◆ ~chemkinReader()

virtual ~chemkinReader ( )
inlinevirtual

Destructor.

Definition at line 341 of file chemkinReader.H.

Member Function Documentation

◆ initReactionKeywordTable()

void initReactionKeywordTable ( )
private

◆ lex()

int lex ( )
private

Flex lexer to read the CHEMKIN III file.

◆ stringToScalar() [1/2]

scalar stringToScalar ( const string s)
inlineprivate

Definition at line 225 of file chemkinReader.H.

References string::replaceAll(), and s().

Referenced by chemkinReader::stringToScalar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stringToScalar() [2/2]

scalar stringToScalar ( const char *  cstr)
inlineprivate

Definition at line 234 of file chemkinReader.H.

References chemkinReader::stringToScalar().

Here is the call graph for this function:

◆ correctElementName()

void correctElementName ( word elementName)
inlineprivate

Definition at line 239 of file chemkinReader.H.

◆ molecularWeight()

Foam::scalar molecularWeight ( const List< specieElement > &  specieComposition) const
private

Definition at line 114 of file chemkinReader.C.

References Foam::atomicWeights, Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, HashTable::found(), and Foam::nl.

Here is the call graph for this function:

◆ finishElements()

void finishElements ( labelList currentAtoms)
private

◆ checkCoeffs()

void checkCoeffs ( const scalarList reactionCoeffs,
const char *  reationRateName,
const label  nCoeffs 
) const
private

Definition at line 148 of file chemkinReader.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and List::size().

Here is the call graph for this function:

◆ addReactionType()

void addReactionType ( const reactionType  rType,
DynamicList< gasHReaction::specieCoeffs > &  lhs,
DynamicList< gasHReaction::specieCoeffs > &  rhs,
const ReactionRateType &  rr 
)
private

Definition at line 169 of file chemkinReader.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and DynamicList::shrink().

Here is the call graph for this function:

◆ addPressureDependentReaction()

void addPressureDependentReaction ( const reactionType  rType,
const fallOffFunctionType  fofType,
DynamicList< gasHReaction::specieCoeffs > &  lhs,
DynamicList< gasHReaction::specieCoeffs > &  rhs,
const scalarList thirdBodyEfficiencies,
const scalarList k0Coeffs,
const scalarList kInfCoeffs,
const HashTable< scalarList > &  reactionCoeffsTable,
const scalar  Afactor0,
const scalar  AfactorInf,
const scalar  RR 
)
private

Definition at line 240 of file chemkinReader.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, Foam::constant::thermodynamic::RR, List::setSize(), and List::size().

Here is the call graph for this function:

◆ addReaction()

void addReaction ( DynamicList< gasHReaction::specieCoeffs > &  lhs,
DynamicList< gasHReaction::specieCoeffs > &  rhs,
const scalarList thirdBodyEfficiencies,
const reactionType  rType,
const reactionRateType  rrType,
const fallOffFunctionType  fofType,
const scalarList ArrheniusReactionCoeffs,
HashTable< scalarList > &  reactionCoeffsTable,
const scalar  RR 
)
private

◆ read()

void read ( const fileName CHEMKINFileName,
const fileName thermoFileName,
const fileName transportFileName 
)
private

Definition at line 775 of file chemkinReader.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and fileName::null.

Here is the call graph for this function:

◆ operator=()

void operator= ( const chemkinReader )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "chemkinReader"  )

Runtime type information.

◆ elementNames()

const wordList& elementNames ( ) const
inline

List of elements.

Definition at line 348 of file chemkinReader.H.

References chemkinReader::elementNames_.

◆ elementIndices()

const HashTable<label>& elementIndices ( ) const
inline

Element indices.

Definition at line 354 of file chemkinReader.H.

References chemkinReader::elementIndices_.

◆ isotopeAtomicWts()

const HashTable<scalar>& isotopeAtomicWts ( ) const
inline

Isotope molecular weights.

Definition at line 360 of file chemkinReader.H.

References chemkinReader::isotopeAtomicWts_.

◆ species()

const speciesTable& species ( ) const
inline

Table of species.

Definition at line 366 of file chemkinReader.H.

References chemkinReader::speciesTable_.

◆ speciePhase()

const HashTable<phase>& speciePhase ( ) const
inline

Specie phase.

Definition at line 372 of file chemkinReader.H.

References chemkinReader::speciePhase_.

◆ speciesThermo()

const HashPtrTable<gasHThermoPhysics>& speciesThermo ( ) const
inline

Table of the thermodynamic data given in the CHEMKIN file.

Definition at line 378 of file chemkinReader.H.

References chemkinReader::speciesThermo_.

◆ specieComposition()

const HashTable<List<specieElement> >& specieComposition ( ) const
inline

Table of species composition.

Definition at line 384 of file chemkinReader.H.

References chemkinReader::specieComposition_.

◆ reactions()

const ReactionList<gasHThermoPhysics>& reactions ( ) const
inline

List of the reactions.

Definition at line 390 of file chemkinReader.H.

References chemkinReader::reactions_.

Field Documentation

◆ yyBufSize

int yyBufSize
staticprivate

Definition at line 111 of file chemkinReader.H.

◆ lineNo_

label lineNo_
private

Definition at line 112 of file chemkinReader.H.

◆ reactionKeywordTable_

HashTable<int> reactionKeywordTable_
private

Table of reaction type keywords.

Definition at line 115 of file chemkinReader.H.

Referenced by chemkinReader::initReactionKeywordTable().

◆ reactionTypeNames

const char * reactionTypeNames
staticprivate
Initial value:
=
{
"irreversible",
"reversible",
"nonEquilibriumReversible",
"unknownReactionType"
}

Definition at line 150 of file chemkinReader.H.

◆ reactionRateTypeNames

const char * reactionRateTypeNames
staticprivate
Initial value:
=
{
"Arrhenius",
"thirdBodyArrhenius",
"unimolecularFallOff",
"chemicallyActivatedBimolecular",
"LandauTeller",
"Janev",
"powerSeries",
"unknownReactionRateType"
}

Definition at line 164 of file chemkinReader.H.

◆ fallOffFunctionNames

const char * fallOffFunctionNames
staticprivate
Initial value:
=
{
"Lindemann",
"Troe",
"SRI",
"unknownFallOffFunctionType"
}

Definition at line 174 of file chemkinReader.H.

◆ elementNames_

DynamicList<word> elementNames_
private

List of elements.

Definition at line 181 of file chemkinReader.H.

Referenced by chemkinReader::elementNames().

◆ elementIndices_

HashTable<label> elementIndices_
private

Element indices.

Definition at line 184 of file chemkinReader.H.

Referenced by chemkinReader::elementIndices().

◆ isotopeAtomicWts_

HashTable<scalar> isotopeAtomicWts_
private

Isotope molecular weights.

Definition at line 187 of file chemkinReader.H.

Referenced by chemkinReader::isotopeAtomicWts().

◆ specieNames_

DynamicList<word> specieNames_
private

List of species.

Definition at line 190 of file chemkinReader.H.

◆ specieIndices_

HashTable<label> specieIndices_
private

Specie indices.

Definition at line 193 of file chemkinReader.H.

◆ speciesTable_

speciesTable& speciesTable_
private

Table of species.

Definition at line 196 of file chemkinReader.H.

Referenced by chemkinReader::species().

◆ speciePhase_

HashTable<phase> speciePhase_
private

Specie phase.

Definition at line 199 of file chemkinReader.H.

Referenced by chemkinReader::speciePhase().

◆ speciesThermo_

HashPtrTable<gasHThermoPhysics> speciesThermo_
private

Table of the thermodynamic data given in the CHEMKIN file.

Definition at line 202 of file chemkinReader.H.

Referenced by chemkinReader::speciesThermo().

◆ specieComposition_

HashTable<List<specieElement> > specieComposition_
private

Table of species composition.

Definition at line 205 of file chemkinReader.H.

Referenced by chemkinReader::specieComposition().

◆ reactions_

ReactionList<gasHThermoPhysics> reactions_
private

List of the reactions.

Definition at line 208 of file chemkinReader.H.

Referenced by chemkinReader::reactions().

◆ transportDict_

dictionary transportDict_
private

Transport properties dictionary.

Definition at line 211 of file chemkinReader.H.

◆ newFormat_

Switch newFormat_
private

Flag to indicate that file is in new format.

Definition at line 214 of file chemkinReader.H.

◆ imbalanceTol_

scalar imbalanceTol_
private

Tolerance for element imbalance in a reaction.

Definition at line 217 of file chemkinReader.H.


The documentation for this class was generated from the following files: