chemistryModel.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) 2011-2026 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::chemistryModel
26 
27 Description
28  Base class for chemistry models
29 
30 SourceFiles
31  chemistryModelI.H
32  chemistryModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef chemistryModel_H
37 #define chemistryModel_H
38 
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class chemistryModel Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class chemistryModel
51 :
52  public IOdictionary
53 {
54 protected:
55 
56  // Protected data
57 
58  //- Reference to the mesh
59  const fvMesh& mesh_;
60 
61  //- Reference to the thermo
63 
64  //- Chemistry activation switch
66 
67  //- Initial chemical time step
68  const scalar deltaTChemIni_;
69 
70  //- Maximum chemical time step
71  const scalar deltaTChemMax_;
72 
73  //- Latest estimation of integration step
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("chemistryModel");
81 
82 
83  //- Declare run-time constructor selection tables
85  (
86  autoPtr,
88  thermo,
90  (thermo)
91  );
92 
93 
94  // Constructors
95 
96  //- Construct from thermo
98 
99  //- Disallow default bitwise copy construction
100  chemistryModel(const chemistryModel&) = delete;
101 
102 
103  // Selectors
104 
105  //- Select based on fluid reaction thermo
107  (
109  );
110 
111 
112  //- Destructor
113  virtual ~chemistryModel();
114 
115 
116  // Member Functions
117 
118  //- Return const access to the mesh
119  inline const fvMesh& mesh() const;
120 
121  //- Return const access to the thermo
122  inline const fluidMulticomponentThermo& thermo() const;
123 
124  //- Chemistry activation switch
125  inline Switch chemistry() const;
126 
127  //- The number of species
128  virtual label nSpecie() const = 0;
129 
130  //- The number of reactions
131  virtual label nReaction() const = 0;
132 
133  //- Return the latest estimation of integration step
134  inline const volScalarField::Internal& deltaTChem() const;
135 
136  //- Return reaction rates of the species [kg/m^3/s]
137  virtual const PtrList<volScalarField::Internal>& RR() const = 0;
138 
139  //- Return the name of reactioni
140  virtual inline const word& reactionName
141  (
142  const label reactioni
143  ) const = 0;
144 
145  //- Return the rate of reactioni [kmol/m^3/s]
147  (
148  const label reactioni
149  ) const = 0;
150 
151  //- Return reaction rates of the species in reactioni [kg/m^3/s]
153  (
154  const label reactioni
155  ) const = 0;
156 
157  //- Calculates the reaction rates
158  virtual void calculate() = 0;
159 
160  //- Solve the reaction system for the given time step
161  // and return the characteristic time
162  virtual scalar solve(const scalar deltaT) = 0;
163 
164  //- Solve the reaction system for the given time step
165  // and return the characteristic time
166  virtual scalar solve(const scalarField& deltaT) = 0;
167 
168  //- Return the chemical time scale
169  virtual tmp<volScalarField> tc() const = 0;
170 
171  //- Return the heat release rate [kg/m/s^3]
172  virtual tmp<volScalarField> Qdot() const = 0;
173 
174 
175  // Member Operators
176 
177  //- Disallow default bitwise assignment
178  void operator=(const chemistryModel&) = delete;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #include "chemistryModelI.H"
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Base class for chemistry models.
virtual tmp< volScalarField > tc() const =0
Return the chemical time scale.
const fluidMulticomponentThermo & thermo() const
Return const access to the thermo.
TypeName("chemistryModel")
Runtime type information.
virtual tmp< volScalarField > Qdot() const =0
Return the heat release rate [kg/m/s^3].
declareRunTimeSelectionTable(autoPtr, chemistryModel, thermo,(const fluidMulticomponentThermo &thermo),(thermo))
Declare run-time constructor selection tables.
const fvMesh & mesh_
Reference to the mesh.
virtual void calculate()=0
Calculates the reaction rates.
virtual label nSpecie() const =0
The number of species.
virtual PtrList< volScalarField::Internal > specieReactionRR(const label reactioni) const =0
Return reaction rates of the species in reactioni [kg/m^3/s].
virtual const word & reactionName(const label reactioni) const =0
Return the name of reactioni.
const fluidMulticomponentThermo & thermo_
Reference to the thermo.
const volScalarField::Internal & deltaTChem() const
Return the latest estimation of integration step.
virtual scalar solve(const scalar deltaT)=0
Solve the reaction system for the given time step.
const scalar deltaTChemIni_
Initial chemical time step.
void operator=(const chemistryModel &)=delete
Disallow default bitwise assignment.
Switch chemistry_
Chemistry activation switch.
chemistryModel(const fluidMulticomponentThermo &thermo)
Construct from thermo.
static autoPtr< chemistryModel > New(const fluidMulticomponentThermo &thermo)
Select based on fluid reaction thermo.
virtual const PtrList< volScalarField::Internal > & RR() const =0
Return reaction rates of the species [kg/m^3/s].
virtual tmp< volScalarField::Internal > reactionRR(const label reactioni) const =0
Return the rate of reactioni [kmol/m^3/s].
virtual label nReaction() const =0
The number of reactions.
virtual ~chemistryModel()
Destructor.
const fvMesh & mesh() const
Return const access to the mesh.
const scalar deltaTChemMax_
Maximum chemical time step.
Switch chemistry() const
Chemistry activation switch.
volScalarField::Internal deltaTChem_
Latest estimation of integration step.
Base-class for multi-component fluid thermodynamic properties.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
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