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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::chemistryReader
29
30Group
31 grpReactionThermophysicalChemistryReaders
32
33Description
34 Abstract class for reading chemistry
35
36SourceFiles
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"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
56
57/*---------------------------------------------------------------------------*\
58 Class chemistryReader Declaration
59\*---------------------------------------------------------------------------*/
60
61template<class ThermoType>
63{
64public:
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
83 (
84 autoPtr,
87 (
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
139#define makeChemistryReader(Thermo) \
140 defineTemplateTypeNameAndDebug(chemistryReader<Thermo>, 0); \
141 defineTemplateRunTimeSelectionTable(chemistryReader<Thermo>, dictionary)
142
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// ************************************************************************* //
A HashTable similar to std::unordered_map.
Definition: HashTable.H:123
List of templated reactions.
Definition: ReactionList.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Abstract class for reading chemistry.
virtual ~chemistryReader()=default
Destructor.
ThermoType thermoType
The type of thermo package the reader was instantiated for.
TypeName("chemistryReader")
Runtime type information.
virtual const speciesCompositionTable & specieComposition() const =0
Table of species composition.
virtual const speciesTable & species() const =0
Return access to the list of species.
virtual const ReactionList< ThermoType > & reactions() const =0
Return access to the list of reactions.
virtual const ReactionTable< ThermoType > & speciesThermo() const =0
Return access to the thermo packages.
declareRunTimeSelectionTable(autoPtr, chemistryReader, dictionary,(const dictionary &thermoDict, speciesTable &species),(thermoDict, species))
static autoPtr< chemistryReader > New(const dictionary &thermoDict, speciesTable &species)
Select constructed from dictionary.
chemistryReader()
Default construct.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
const dictionary & thermoDict
Definition: EEqn.H:16
Namespace for OpenFOAM.
HashTable< List< specieElement > > speciesCompositionTable
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73