singleStepReactingMixture.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-2019 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::singleStepReactingMixture
26 
27 Description
28  Single step reacting mixture
29 
30 SourceFiles
31  singleStepReactingMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef singleStepReactingMixture_H
36 #define singleStepReactingMixture_H
37 
38 #include "chemistryReader.H"
39 #include "reactingMixture.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class singleStepReactingMixture Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class ThermoType>
52 :
53  public reactingMixture<ThermoType>
54 {
55 
56 protected:
57 
58  // Protected data
59 
60  //- Stoichiometric air-fuel mass ratio
62 
63  //- Stoichiometric oxygen-fuel mass ratio
65 
66  //- Heat of combustion [J/Kg]
68 
69  //- Stoichiometric coefficient for the reaction.
71 
72  //- Mass concentrations at stoichiometric mixture for fres.
74 
75  //- List of components residual
77 
78  //- Inert specie index
80 
81  //- Fuel specie index
83 
84  //- List to indicate if specie is produced/consumed
86 
87 
88  // Protected member functions
89 
90  //- Calculate qFuel
91  void calculateqFuel();
92 
93  //- Calculate air/fuel and oxygen/fuel ratio
95 
96  //- Calculate maximum products at stoichiometric mixture
97  void calculateMaxProducts();
98 
99 
100 public:
101 
102  //- The type of thermo package this mixture is instantiated for
103  typedef ThermoType thermoType;
104 
105 
106  // Constructors
107 
108  //- Construct from dictionary, mesh and phase name
110  (
111  const dictionary&,
112  const fvMesh&,
113  const word&
114  );
115 
116  //- Disallow default bitwise copy construction
118 
119 
120  //- Destructor
122  {}
123 
124 
125  // Member Functions
126 
127  //- Return the instantiated type name
128  static word typeName()
129  {
130  return "singleStepReactingMixture<" + ThermoType::typeName() + '>';
131  }
132 
133  //- Calculates the residual for all components
134  void fresCorrect();
135 
136 
137  // Access functions
138 
139  //- Return the stoichiometric air-fuel mass ratio
140  inline const dimensionedScalar stoicRatio() const;
141 
142  //- Return the Stoichiometric oxygen-fuel mass ratio
143  inline const dimensionedScalar s() const;
144 
145  //- Return the heat of combustion [J/Kg]
146  inline const dimensionedScalar qFuel() const;
147 
148  //- Return the stoichiometric coefficient for the reaction
149  inline const List<scalar>& specieStoichCoeffs() const;
150 
151  //- Return the list of components residual
152  inline tmp<volScalarField> fres(const label index) const;
153 
154  //- Return the inert specie index
155  inline label inertIndex() const;
156 
157  //- Return the fuel specie index
158  inline label fuelIndex() const;
159 
160  //- Return the list to indicate if specie is produced/consumed
161  inline const List<int>& specieProd() const;
162 
163  //- Return the list of products mass concentrations
164  inline const scalarList& Yprod0() const;
165 
166 
167  // I-O
168 
169  //- Read dictionary
170  void read(const dictionary&);
171 
172 
173  // Member Operators
174 
175  //- Disallow default bitwise assignment
176  void operator=(const singleStepReactingMixture&) = delete;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #ifdef NoRepository
191  #include "singleStepReactingMixture.C"
192 #endif
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
const List< int > & specieProd() const
Return the list to indicate if specie is produced/consumed.
const dimensionedScalar s() const
Return the Stoichiometric oxygen-fuel mass ratio.
Foam::reactingMixture.
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
const dimensionedScalar qFuel() const
Return the heat of combustion [J/Kg].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Single step reacting mixture.
virtual ~singleStepReactingMixture()
Destructor.
tmp< volScalarField > fres(const label index) const
Return the list of components residual.
void massAndAirStoichRatios()
Calculate air/fuel and oxygen/fuel ratio.
static word typeName()
Return the instantiated type name.
dimensionedScalar s_
Stoichiometric oxygen-fuel mass ratio.
label fuelIndex() const
Return the fuel specie index.
void operator=(const singleStepReactingMixture &)=delete
Disallow default bitwise assignment.
scalarList specieStoichCoeffs_
Stoichiometric coefficient for the reaction.
A class for handling words, derived from string.
Definition: word.H:59
List< int > specieProd_
List to indicate if specie is produced/consumed.
label inertIndex() const
Return the inert specie index.
const scalarList & Yprod0() const
Return the list of products mass concentrations.
PtrList< volScalarField > fres_
List of components residual.
void calculateMaxProducts()
Calculate maximum products at stoichiometric mixture.
const List< scalar > & specieStoichCoeffs() const
Return the stoichiometric coefficient for the reaction.
void read(const dictionary &)
Read 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
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
scalarList Yprod0_
Mass concentrations at stoichiometric mixture for fres.
singleStepReactingMixture(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
const dimensionedScalar stoicRatio() const
Return the stoichiometric air-fuel mass ratio.
ThermoType thermoType
The type of thermo package this mixture is instantiated for.
A class for managing temporary objects.
Definition: PtrList.H:53
dimensionedScalar qFuel_
Heat of combustion [J/Kg].
dimensionedScalar stoicRatio_
Stoichiometric air-fuel mass ratio.
void fresCorrect()
Calculates the residual for all components.
Namespace for OpenFOAM.