chemistryReader.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::chemistryReader
29 
30 Group
31  grpReactionThermophysicalChemistryReaders
32 
33 Description
34  Abstract class for reading chemistry
35 
36 SourceFiles
37  chemistryReader.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef chemistryReader_H
42 #define chemistryReader_H
43 
44 #include "typeInfo.H"
45 #include "specieElement.H"
46 #include "Reaction.H"
47 #include "ReactionList.H"
48 #include "runTimeSelectionTables.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
56 
57 /*---------------------------------------------------------------------------*\
58  Class chemistryReader Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<class ThermoType>
62 class chemistryReader
63 {
64 public:
65 
66  //- Runtime type information
67  TypeName("chemistryReader");
68 
69  //- The type of thermo package the reader was instantiated for
70  typedef ThermoType thermoType;
71 
72 
73  // Constructors
74 
75  //- Default construct
77  {}
78 
79 
80  // Declare run-time constructor selection table
81 
83  (
84  autoPtr,
86  dictionary,
87  (
88  const dictionary& thermoDict,
90  ),
92  );
93 
94 
95  // Selectors
96 
97  //- Select constructed from dictionary
99  (
100  const dictionary& thermoDict,
102  );
103 
104 
105  //- Destructor
106  virtual ~chemistryReader() = default;
107 
108 
109  // Member Functions
110 
111  //- Return access to the list of species
112  virtual const speciesTable& species() const = 0;
113 
114  //- Table of species composition
115  virtual const speciesCompositionTable& specieComposition() const = 0;
116 
117  //- Return access to the thermo packages
118  virtual const ReactionTable<ThermoType>& speciesThermo() const = 0;
119 
120  //- Return access to the list of reactions
121  virtual const ReactionList<ThermoType>& reactions() const = 0;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #ifdef NoRepository
132  #include "chemistryReader.C"
133 #endif
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 
139 #define makeChemistryReader(Thermo) \
140  defineTemplateTypeNameAndDebug(chemistryReader<Thermo>, 0); \
141  defineTemplateRunTimeSelectionTable(chemistryReader<Thermo>, dictionary)
142 
143 
144 #define makeChemistryReaderType(Reader, Thermo) \
145  defineNamedTemplateTypeNameAndDebug(Reader<Thermo>, 0); \
146  chemistryReader<Thermo>::adddictionaryConstructorToTable<Reader<Thermo>> \
147  add##Reader##Thermo##ConstructorToTable_
148 
149 
150 // for non-templated chemistry readers
151 #define addChemistryReaderType(Reader, Thermo) \
152  defineTypeNameAndDebug(Reader, 0); \
153  chemistryReader<Thermo>::adddictionaryConstructorToTable<Reader> \
154  add##Reader##Thermo##ConstructorToTable_
155 
156 
157 // for templated chemistry readers
158 #define addTemplateChemistryReaderType(Reader, Thermo) \
159  defineNamedTemplateTypeNameAndDebug(Reader, 0); \
160  chemistryReader<Thermo>::adddictionaryConstructorToTable<Reader> \
161  add##Reader##Thermo##ConstructorToTable_
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
ReactionList.H
chemistryReader.C
Foam::chemistryReader
Abstract class for reading chemistry.
Definition: chemistryReader.H:61
typeInfo.H
Foam::chemistryReader::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, chemistryReader, dictionary,(const dictionary &thermoDict, speciesTable &species),(thermoDict, species))
Foam::chemistryReader::thermoType
ThermoType thermoType
The type of thermo package the reader was instantiated for.
Definition: chemistryReader.H:69
Foam::speciesCompositionTable
HashTable< List< specieElement > > speciesCompositionTable
Definition: chemistryReader.H:54
specieElement.H
Foam::ReactionList
List of templated reactions.
Definition: ReactionList.H:56
Foam::hashedWordList
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Definition: hashedWordList.H:54
Foam::chemistryReader::~chemistryReader
virtual ~chemistryReader()=default
Destructor.
Foam::chemistryReader::species
virtual const speciesTable & species() const =0
Return access to the list of species.
Foam::chemistryReader::New
static autoPtr< chemistryReader > New(const dictionary &thermoDict, speciesTable &species)
Select constructed from dictionary.
Definition: chemistryReader.C:36
Foam::chemistryReader::reactions
virtual const ReactionList< ThermoType > & reactions() const =0
Return access to the list of reactions.
Foam::chemistryReader::specieComposition
virtual const speciesCompositionTable & specieComposition() const =0
Table of species composition.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Reaction.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::chemistryReader::TypeName
TypeName("chemistryReader")
Runtime type information.
Foam::HashTable
A HashTable similar to std::unordered_map.
Definition: HashTable.H:105
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::chemistryReader::chemistryReader
chemistryReader()
Default construct.
Definition: chemistryReader.H:75
thermoDict
const dictionary & thermoDict
Definition: EEqn.H:16
Foam::HashPtrTable< ThermoType >
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::chemistryReader::speciesThermo
virtual const ReactionTable< ThermoType > & speciesThermo() const =0
Return access to the thermo packages.