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-2018 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 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class combustionModel Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class combustionModel
51 :
52  public IOdictionary
53 {
54  // Private Member Functions
55 
56  //- Disallow copy construct
58 
59  //- Disallow default bitwise assignment
60  void operator=(const combustionModel&);
61 
62  //- Construct the base IO object
63  IOobject createIOobject
64  (
66  const word& combustionProperties
67  ) const;
68 
69 
70 protected:
71 
72  // Protected data
73 
74  //- Reference to the mesh database
75  const fvMesh& mesh_;
76 
77  //- Reference to the turbulence model
79 
80  //- Active
82 
83  //- Dictionary of the model
85 
86  //- Model type
87  const word modelType_;
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("combustionModel");
94 
95  //- Default combustionProperties dictionary name
96  static const word combustionPropertiesName;
97 
98 
99  // Constructors
100 
101  //- Construct from components
103  (
104  const word& modelType,
105  basicThermo& thermo,
106  const compressibleTurbulenceModel& turb,
107  const word& combustionProperties=combustionPropertiesName
108  );
109 
110 
111  // Selectors
112 
113  //- Generic New for each of the related chemistry model
114  template<class CombustionModel>
116  (
117  typename CombustionModel::reactionThermo& thermo,
118  const compressibleTurbulenceModel& turb,
119  const word& combustionProperties
120  );
121 
122 
123  //- Destructor
124  virtual ~combustionModel();
125 
126 
127  // Member Functions
128 
129  //- Return const access to the mesh database
130  inline const fvMesh& mesh() const;
131 
132  //- Return access to turbulence
133  inline const compressibleTurbulenceModel& turbulence() const;
134 
135  //- Return const access to rho
136  inline const volScalarField& rho() const;
137 
138  //- Return const access to phi
139  inline tmp<surfaceScalarField> phi() const;
140 
141  //- Is combustion active?
142  inline const Switch& active() const;
143 
144  //- Return const dictionary of the model
145  inline const dictionary& coeffs() const;
146 
147  //- Correct combustion rate
148  virtual void correct() = 0;
149 
150  //- Fuel consumption rate matrix, i.e. source term for fuel equation
151  virtual tmp<fvScalarMatrix> R(volScalarField& Y) const = 0;
152 
153  //- Heat release rate [kg/m/s3]
154  virtual tmp<volScalarField> Qdot() const = 0;
155 
156  //- Update properties from given dictionary
157  virtual bool read();
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #include "combustionModelI.H"
168 
169 #ifdef NoRepository
170  #include "combustionModelTemplates.C"
171 #endif
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
const fvMesh & mesh_
Reference to the mesh database.
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:52
const compressibleTurbulenceModel & turbulence() const
Return access to turbulence.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
const fvMesh & mesh() const
Return const access to the mesh database.
virtual void correct()=0
Correct combustion rate.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none.
Definition: Switch.H:60
virtual tmp< fvScalarMatrix > R(volScalarField &Y) const =0
Fuel consumption rate matrix, i.e. source term for fuel equation.
const Switch & active() const
Is combustion active?
rhoReactionThermo & thermo
Definition: createFields.H:28
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:52
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/s3].
ReactionThermo reactionThermo
Thermo type.
A class for handling words, derived from string.
Definition: word.H:59
const compressibleTurbulenceModel & turb_
Reference to the turbulence model.
virtual ~combustionModel()
Destructor.
Switch active_
Active.
dictionary coeffs_
Dictionary of the model.
virtual bool read()
Update properties from given dictionary.
Abstract base class for turbulence models (RAS, LES and laminar).
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
static autoPtr< CombustionModel > New(typename CombustionModel::reactionThermo &thermo, const compressibleTurbulenceModel &turb, const word &combustionProperties)
Generic New for each of the related chemistry 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
TypeName("combustionModel")
Runtime type information.
Namespace for OpenFOAM.
static const word combustionPropertiesName
Default combustionProperties dictionary name.