chemistryTabulationMethod.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) 2016-2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::chemistryTabulationMethod
28
29Description
30 An abstract class for chemistry tabulation.
31
32SourceFiles
33 chemistryTabulationMethod.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef chemistryTabulationMethod_H
38#define chemistryTabulationMethod_H
39
40#include "IOdictionary.H"
41#include "scalarField.H"
42#include "Switch.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52template<class CompType, class ThermoType>
53class TDACChemistryModel;
54
55/*---------------------------------------------------------------------------*\
56 Class chemistryTabulationMethod Declaration
57\*---------------------------------------------------------------------------*/
58
59template<class CompType, class ThermoType>
61{
62
63protected:
65 const dictionary& dict_;
68
69 //- Is tabulation active?
71
72 //- Switch to select performance logging
77 scalar tolerance_;
78
79
80public:
81
82 //- Runtime type information
83 TypeName("chemistryTabulationMethod");
84
85
86 // Declare runtime constructor selection table
88 (
89 autoPtr,
92 (
93 const dictionary& dict,
95 ),
97 );
98
99
100 // Constructors
101
102 //- Construct from components
104 (
105 const dictionary& dict,
107 );
108
109
110 // Selectors
111
113 (
114 const IOdictionary& dict,
116 );
117
118
119 //- Destructor
121
122
123 // Member Functions
125 inline bool active()
126 {
127 return active_;
128 }
130 inline bool log()
131 {
132 return active_ && log_;
133 }
135 inline bool variableTimeStep()
136 {
138 }
140 inline scalar tolerance() const
141 {
142 return tolerance_;
143 }
145 virtual label size() = 0;
147 virtual void writePerformance() = 0;
148
149 // Retrieve function: (only virtual here)
150 // Try to retrieve a stored point close enough (according to tolerance)
151 // to a stored point. If successful, it returns true and store the
152 // results in RphiQ, i.e. the result of the integration of phiQ
153 virtual bool retrieve
154 (
155 const scalarField& phiQ,
156 scalarField& RphiQ
157 ) = 0;
158
159 // Add function: (only virtual here)
160 // Add information to the tabulation algorithm. Give the reference for
161 // future retrieve (phiQ) and the corresponding result (RphiQ).
162 virtual label add
163 (
164 const scalarField& phiQ,
165 const scalarField& RphiQ,
166 const scalar rho,
167 const scalar deltaT
168 ) = 0;
169
170 // Update function: (only virtual here)
171 // The underlying structure of the tabulation is updated/cleaned
172 // to increase the performance of the retrieve
173 virtual bool update() = 0;
174};
175
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179} // End namespace Foam
180
181// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182
183#ifdef NoRepository
186#endif
187
188// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189
190#endif
191
192// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
Extends StandardChemistryModel by adding the TDAC method.
bool variableTimeStep() const
Return true if the time-step is variable and/or non-uniform.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
An abstract class for chemistry tabulation.
Switch active_
Is tabulation active?
declareRunTimeSelectionTable(autoPtr, chemistryTabulationMethod, dictionary,(const dictionary &dict, TDACChemistryModel< CompType, ThermoType > &chemistry),(dict, chemistry))
TDACChemistryModel< CompType, ThermoType > & chemistry_
TypeName("chemistryTabulationMethod")
Runtime type information.
virtual bool retrieve(const scalarField &phiQ, scalarField &RphiQ)=0
static autoPtr< chemistryTabulationMethod > New(const IOdictionary &dict, TDACChemistryModel< CompType, ThermoType > &chemistry)
virtual label add(const scalarField &phiQ, const scalarField &RphiQ, const scalar rho, const scalar deltaT)=0
virtual void writePerformance()=0
Switch log_
Switch to select performance logging.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
BasicChemistryModel< psiReactionThermo > & chemistry
Namespace for OpenFOAM.
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)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73