singleStepCombustion.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-2020 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::combustionModels::singleStepCombustion
26 
27 Description
28  Base class for combustion models using multiComponentMixture.
29 
30 SourceFiles
31  singleStepCombustion.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef singleStepCombustion_H
36 #define singleStepCombustion_H
37 
38 #include "multiComponentMixture.H"
39 #include "ThermoCombustion.H"
40 #include "ReactionList.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace combustionModels
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class singleStepCombustion Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class ReactionThermo, class ThermoType>
55 :
56  public ThermoCombustion<ReactionThermo>
57 {
58 protected:
59 
60  // Protected data
61 
63 
64  //- The single-step reaction
66 
67  //- Stoichiometric air-fuel mass ratio
69 
70  //- Stoichiometric oxygen-fuel mass ratio
72 
73  //- Heat of combustion [J/Kg]
75 
76  //- Stoichiometric coefficient for the reaction.
78 
79  //- Mass concentrations at stoichiometric mixture for fres.
81 
82  //- List of components residual
84 
85  //- Inert specie index
87 
88  //- Fuel specie index
90 
91  //- List to indicate if specie is produced/consumed
93 
94  //- Fuel consumption rate
96 
97  //- Semi-implicit (true) or explicit (false) treatment
98  bool semiImplicit_;
99 
100 
101  // Protected member functions
102 
103  //- Calculate qFuel
104  void calculateqFuel();
105 
106  //- Calculate air/fuel and oxygen/fuel ratio
107  void massAndAirStoichRatios();
108 
109  //- Calculate maximum products at stoichiometric mixture
110  void calculateMaxProducts();
111 
112 
113 public:
114 
115  // Constructors
116 
117  //- Construct from components
119  (
120  const word& modelType,
121  const ReactionThermo& thermo,
123  const word& combustionProperties
124  );
125 
126  //- Disallow default bitwise copy construction
128 
129 
130  //- Destructor
131  virtual ~singleStepCombustion();
132 
133 
134  // Member Functions
135 
136  // Access functions
139  {
140  return mixture_;
141  }
142 
143  //- Return the single step reaction
144  inline const Reaction<ThermoType>& reaction() const;
145 
146  //- Return the stoichiometric air-fuel mass ratio
147  inline const dimensionedScalar stoicRatio() const;
148 
149  //- Return the Stoichiometric oxygen-fuel mass ratio
150  inline const dimensionedScalar s() const;
151 
152  //- Return the heat of combustion [J/Kg]
153  inline const dimensionedScalar qFuel() const;
154 
155  //- Return the stoichiometric coefficient for the reaction
156  inline const List<scalar>& specieStoichCoeffs() const;
157 
158  //- Return the list of components residual
159  inline tmp<volScalarField> fres(const label index) const;
160 
161  //- Return the inert specie index
162  inline label inertIndex() const;
163 
164  //- Return the fuel specie index
165  inline label fuelIndex() const;
166 
167  //- Return the list to indicate if specie is produced/consumed
168  inline const List<int>& specieProd() const;
169 
170  //- Return the list of products mass concentrations
171  inline const scalarList& Yprod0() const;
172 
173 
174  //- Fuel consumption rate matrix
175  virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
176 
177  //- Heat release rate [kg/m/s^3]
178  virtual tmp<volScalarField> Qdot() const;
179 
180  //- Update properties from given dictionary
181  virtual bool read();
182 
183  //- Calculates the residual for all components
184  void fresCorrect();
185 
186 
187  // Member Operators
188 
189  //- Disallow default bitwise assignment
190  void operator=(const singleStepCombustion&) = delete;
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace combustionModels
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #include "singleStepCombustionI.H"
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #ifdef NoRepository
206  #include "singleStepCombustion.C"
207 #endif
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
void calculateMaxProducts()
Calculate maximum products at stoichiometric mixture.
volScalarField wFuel_
Fuel consumption rate.
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
dimensionedScalar s_
Stoichiometric oxygen-fuel mass ratio.
virtual const ReactionThermo & thermo() const
Return const access to the thermo package.
dimensionedScalar stoicRatio_
Stoichiometric air-fuel mass ratio.
label fuelIndex() const
Return the fuel specie index.
const multiComponentMixture< ThermoType > & mixture_
scalarList Yprod0_
Mass concentrations at stoichiometric mixture for fres.
const dimensionedScalar stoicRatio() const
Return the stoichiometric air-fuel mass ratio.
PtrList< volScalarField > fres_
List of components residual.
autoPtr< Reaction< ThermoType > > reaction_
The single-step reaction.
const scalarList & Yprod0() const
Return the list of products mass concentrations.
bool semiImplicit_
Semi-implicit (true) or explicit (false) treatment.
A class for handling words, derived from string.
Definition: word.H:59
const List< scalar > & specieStoichCoeffs() const
Return the stoichiometric coefficient for the reaction.
Foam::multiComponentMixture.
label inertIndex() const
Return the inert specie index.
const dimensionedScalar qFuel() const
Return the heat of combustion [J/Kg].
scalarList specieStoichCoeffs_
Stoichiometric coefficient for the reaction.
const multiComponentMixture< ThermoType > & mixture() const
Thermo model wrapper for combustion models.
dimensionedScalar qFuel_
Heat of combustion [J/Kg].
virtual tmp< volScalarField > Qdot() const
Heat release rate [kg/m/s^3].
const Reaction< ThermoType > & reaction() const
Return the single step reaction.
void operator=(const singleStepCombustion &)=delete
Disallow default bitwise assignment.
virtual bool read()
Update properties from given dictionary.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
tmp< volScalarField > fres(const label index) const
Return the list of components residual.
const dimensionedScalar s() const
Return the Stoichiometric oxygen-fuel mass ratio.
PtrList< volScalarField > & Y
singleStepCombustion(const word &modelType, const ReactionThermo &thermo, const compressibleMomentumTransportModel &turb, const word &combustionProperties)
Construct from components.
Base class for combustion models using multiComponentMixture.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
List< int > specieProd_
List to indicate if specie is produced/consumed.
A class for managing temporary objects.
Definition: PtrList.H:53
void fresCorrect()
Calculates the residual for all components.
void massAndAirStoichRatios()
Calculate air/fuel and oxygen/fuel ratio.
Abstract base class for turbulence models (RAS, LES and laminar).
const List< int > & specieProd() const
Return the list to indicate if specie is produced/consumed.
virtual tmp< fvScalarMatrix > R(volScalarField &Y) const
Fuel consumption rate matrix.
Namespace for OpenFOAM.