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-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::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 private:
101 
102  // Private member functions
103 
104  //- Disallow default bitwise copy construct
106 
107  //- Disallow default bitwise assignment
108  void operator=(const singleStepReactingMixture&);
109 
110 
111 public:
112 
113  //- The type of thermo package this mixture is instantiated for
114  typedef ThermoType thermoType;
115 
116 
117  // Constructors
118 
119  //- Construct from dictionary, mesh and phase name
121  (
122  const dictionary&,
123  const fvMesh&,
124  const word&
125  );
126 
127 
128  //- Destructor
130  {}
131 
132 
133  // Member functions
134 
135  //- Return the instantiated type name
136  static word typeName()
137  {
138  return "singleStepReactingMixture<" + ThermoType::typeName() + '>';
139  }
140 
141  //- Calculates the residual for all components
142  void fresCorrect();
143 
144 
145  // Access functions
146 
147  //- Return the stoichiometric air-fuel mass ratio
148  inline const dimensionedScalar stoicRatio() const;
149 
150  //- Return the Stoichiometric oxygen-fuel mass ratio
151  inline const dimensionedScalar s() const;
152 
153  //- Return the heat of combustion [J/Kg]
154  inline const dimensionedScalar qFuel() const;
155 
156  //- Return the stoichiometric coefficient for the reaction
157  inline const List<scalar>& specieStoichCoeffs() const;
158 
159  //- Return the list of components residual
160  inline tmp<volScalarField> fres(const label index) const;
161 
162  //- Return the inert specie index
163  inline label inertIndex() const;
164 
165  //- Return the fuel specie index
166  inline label fuelIndex() const;
167 
168  //- Return the list to indicate if specie is produced/consumed
169  inline const List<int>& specieProd() const;
170 
171  //- Return the list of products mass concentrations
172  inline const scalarList& Yprod0() const;
173 
174 
175  // I-O
176 
177  //- Read dictionary
178  void read(const dictionary&);
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #ifdef NoRepository
193  #include "singleStepReactingMixture.C"
194 #endif
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
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:137
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.
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:63
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
scalarList Yprod0_
Mass concentrations at stoichiometric mixture for fres.
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.