chemistryTabulationMethod.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::chemistryTabulationMethod
26 
27 Description
28  An abstract class for chemistry tabulation.
29 
30 SourceFiles
31  chemistryTabulationMethod.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef chemistryTabulationMethod_H
36 #define chemistryTabulationMethod_H
37 
38 #include "IOdictionary.H"
39 #include "scalarField.H"
40 #include "runTimeSelectionTables.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 class odeChemistryModel;
50 
51 /*---------------------------------------------------------------------------*\
52  Class chemistryTabulationMethod Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57 public:
58 
59  //- Runtime type information
60  TypeName("chemistryTabulationMethod");
61 
62 
63  // Declare runtime constructor selection table
65  (
66  autoPtr,
68  dictionary,
69  (
70  const dictionary& dict,
72  ),
73  (dict, chemistry)
74  );
75 
76 
77  // Constructors
78 
79  //- Construct from components
81  (
82  const dictionary& dict,
84  );
85 
86 
87  // Selectors
88 
90  (
91  const IOdictionary& dict,
93  );
94 
95 
96  //- Destructor
98 
99 
100  // Member Functions
101 
102  //- Return true if the tabulation method tabulates
103  // otherwise return false
104  virtual bool tabulates() = 0;
105 
106  // Retrieve function: (only virtual here)
107  // Try to retrieve a stored point close enough (according to tolerance)
108  // to a stored point. If successful, it returns true and store the
109  // results in RphiQ, i.e. the result of the integration of phiQ
110  virtual bool retrieve
111  (
112  const scalarField& phiQ,
113  scalarField& RphiQ
114  ) = 0;
115 
116  // Add function: (only virtual here)
117  // Add information to the tabulation algorithm. Give the reference for
118  // future retrieve (phiQ) and the corresponding result (RphiQ).
119  virtual label add
120  (
121  const scalarField& phiQ,
122  const scalarField& RphiQ,
123  const label nActive,
124  const label li,
125  const scalar deltaT
126  ) = 0;
127 
128  // Update function: (only virtual here)
129  // The underlying structure of the tabulation is updated/cleaned
130  // to increase the performance of the retrieve
131  virtual bool update() = 0;
132 
133  virtual void reset() = 0;
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
An abstract class for chemistry tabulation.
declareRunTimeSelectionTable(autoPtr, chemistryTabulationMethod, dictionary,(const dictionary &dict, const odeChemistryModel &chemistry),(dict, chemistry))
TypeName("chemistryTabulationMethod")
Runtime type information.
virtual bool tabulates()=0
Return true if the tabulation method tabulates.
virtual bool retrieve(const scalarField &phiQ, scalarField &RphiQ)=0
chemistryTabulationMethod(const dictionary &dict, const odeChemistryModel &chemistry)
Construct from components.
static autoPtr< chemistryTabulationMethod > New(const IOdictionary &dict, const odeChemistryModel &chemistry)
virtual label add(const scalarField &phiQ, const scalarField &RphiQ, const label nActive, const label li, const scalar deltaT)=0
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Extends base chemistry model adding an ODESystem and the reduction maps needed for tabulation.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Macros to ease declaration of run-time selection tables.
dictionary dict
basicChemistryModel & chemistry