Loading...
Searching...
No Matches
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>
54
55/*---------------------------------------------------------------------------*\
56 Class chemistryTabulationMethod Declaration
57\*---------------------------------------------------------------------------*/
58
59template<class CompType, class ThermoType>
61{
63protected:
64
65 const dictionary& dict_;
66
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");
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
124
125 inline bool active()
126 {
127 return active_;
128 }
129
130 inline bool log()
131 {
132 return active_ && log_;
133 }
134
135 inline bool variableTimeStep()
136 {
137 return chemistry_.variableTimeStep();
138 }
139
140 inline scalar tolerance() const
141 {
142 return tolerance_;
143 }
144
145 virtual label size() = 0;
146
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;
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// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition Switch.H:81
Extends StandardChemistryModel by adding the TDAC method.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
declareRunTimeSelectionTable(autoPtr, chemistryTabulationMethod, dictionary,(const dictionary &dict, TDACChemistryModel< CompType, ThermoType > &chemistry),(dict, chemistry))
TDACChemistryModel< psiReactionThermo, constGasHThermoPhysics > & chemistry_
chemistryTabulationMethod(const dictionary &dict, TDACChemistryModel< CompType, ThermoType > &chemistry)
Construct from components.
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
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
BasicChemistryModel< psiReactionThermo > & chemistry
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
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:68