All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
combustionModel.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-2021 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::combustionModel
26 
27 Description
28  Base class for combustion models
29 
30 SourceFiles
31  combustionModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef combustionModel_H
36 #define combustionModel_H
37 
38 #include "IOdictionary.H"
40 #include "fluidReactionThermo.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class combustionModel Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class combustionModel
52 :
53  public IOdictionary
54 {
55  // Private Member Functions
56 
57  //- Construct the base IO object
58  IOobject createIOobject
59  (
60  const fluidReactionThermo& thermo,
61  const word& combustionProperties
62  ) const;
63 
64 
65 protected:
66 
67  // Protected data
68 
69  //- Reference to the mesh database
70  const fvMesh& mesh_;
71 
72  //- Reference to the thermo
74 
75  //- Reference to the turbulence model
77 
78  //- Dictionary of the model
80 
81  //- Model type
82  const word modelType_;
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("combustionModel");
89 
90  //- Default combustionProperties dictionary name
91  static const word combustionPropertiesName;
92 
93 
94  //- Declare run-time constructor selection tables
96  (
97  autoPtr,
99  dictionary,
100  (
101  const word& modelType,
102  const fluidReactionThermo& thermo,
104  const word& combustionProperties
105  ),
106  (modelType, thermo, turb, combustionProperties)
107  );
108 
109 
110  // Constructors
111 
112  //- Construct from components
114  (
115  const word& modelType,
116  const fluidReactionThermo& thermo,
118  const word& combustionProperties = combustionPropertiesName
119  );
120 
121  //- Disallow default bitwise copy construction
122  combustionModel(const combustionModel&) = delete;
123 
124 
125  // Selectors
126 
127  //- Select using thermo and turbulence
129  (
130  const fluidReactionThermo& thermo,
132  const word& combustionProperties = combustionPropertiesName
133  );
134 
135 
136  //- Destructor
137  virtual ~combustionModel();
138 
139 
140  // Member Functions
141 
142  //- Return const access to the mesh database
143  inline const fvMesh& mesh() const;
144 
145  //- Return const access to the thermo
146  inline const fluidReactionThermo& thermo() const;
147 
148  //- Return access to turbulence
149  inline const compressibleMomentumTransportModel& turbulence() const;
150 
151  //- Return const access to rho
152  inline const volScalarField& rho() const;
153 
154  //- Return const access to phi
155  inline tmp<surfaceScalarField> phi() const;
156 
157  //- Return const dictionary of the model
158  inline const dictionary& coeffs() const;
159 
160  //- Correct combustion rate
161  virtual void correct() = 0;
162 
163  //- Fuel consumption rate matrix, i.e. source term for fuel equation
164  virtual tmp<fvScalarMatrix> R(volScalarField& Y) const = 0;
165 
166  //- Heat release rate [kg/m/s^3]
167  virtual tmp<volScalarField> Qdot() const = 0;
168 
169  //- Update properties from given dictionary
170  virtual bool read();
171 
172 
173  // Member Operators
174 
175  //- Disallow default bitwise assignment
176  void operator=(const combustionModel&) = delete;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #include "combustionModelI.H"
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
void operator=(const combustionModel &)=delete
Disallow default bitwise assignment.
const fvMesh & mesh_
Reference to the mesh database.
combustionModel(const word &modelType, const fluidReactionThermo &thermo, const compressibleMomentumTransportModel &turb, const word &combustionProperties=combustionPropertiesName)
Construct from components.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const fvMesh & mesh() const
Return const access to the mesh database.
virtual void correct()=0
Correct combustion rate.
Base-class for multi-component fluid thermodynamic properties.
virtual tmp< fvScalarMatrix > R(volScalarField &Y) const =0
Fuel consumption rate matrix, i.e. source term for fuel equation.
declareRunTimeSelectionTable(autoPtr, combustionModel, dictionary,(const word &modelType, const fluidReactionThermo &thermo, const compressibleMomentumTransportModel &turb, const word &combustionProperties),(modelType, thermo, turb, combustionProperties))
Declare run-time constructor selection tables.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
const dictionary & coeffs() const
Return const dictionary of the model.
const volScalarField & rho() const
Return const access to rho.
virtual tmp< volScalarField > Qdot() const =0
Heat release rate [kg/m/s^3].
static autoPtr< combustionModel > New(const fluidReactionThermo &thermo, const compressibleMomentumTransportModel &turb, const word &combustionProperties=combustionPropertiesName)
Select using thermo and turbulence.
A class for handling words, derived from string.
Definition: word.H:59
const compressibleMomentumTransportModel & turbulence() const
Return access to turbulence.
virtual ~combustionModel()
Destructor.
dictionary coeffs_
Dictionary of the model.
const fluidReactionThermo & thermo_
Reference to the thermo.
virtual bool read()
Update properties from given dictionary.
Base class for combustion models.
const word modelType_
Model type.
tmp< surfaceScalarField > phi() const
Return const access to phi.
PtrList< volScalarField > & Y
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const compressibleMomentumTransportModel & turb_
Reference to the turbulence model.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Abstract base class for turbulence models (RAS, LES and laminar).
TypeName("combustionModel")
Runtime type information.
Namespace for OpenFOAM.
static const word combustionPropertiesName
Default combustionProperties dictionary name.
const fluidReactionThermo & thermo() const
Return const access to the thermo.