singleStepReactingMixture.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::singleStepReactingMixture
28 
29 Group
30  grpReactionThermophysicalMixtures
31 
32 Description
33  Single step reacting mixture
34 
35 SourceFiles
36  singleStepReactingMixture.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef singleStepReactingMixture_H
41 #define singleStepReactingMixture_H
42 
43 #include "chemistryReader.H"
44 #include "reactingMixture.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class singleStepReactingMixture Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class ThermoType>
57 :
58  public reactingMixture<ThermoType>
59 {
60 
61 protected:
62 
63  // Protected data
64 
65  //- Stoichiometric air-fuel mass ratio
67 
68  //- Stoichiometric oxygen-fuel mass ratio
70 
71  //- Heat of combustion [J/Kg]
73 
74  //- Stoichiometric coefficient for the reaction.
76 
77  //- Mass concentrations at stoichiometric mixture for fres.
79 
80  //- List of components residual
82 
83  //- Inert specie index
84  label inertIndex_;
85 
86  //- Fuel specie index
87  label fuelIndex_;
88 
89  //- List to indicate if specie is produced/consumed
91 
92 
93  // Protected member functions
94 
95  //- Calculate qFuel
96  void calculateqFuel();
97 
98  //- Calculate air/fuel and oxygen/fuel ratio
100 
101  //- Calculate maximum products at stoichiometric mixture
102  void calculateMaxProducts();
103 
104 
105 private:
106 
107  // Private member functions
108 
109  //- No copy construct
111 
112  //- No copy assignment
113  void operator=(const singleStepReactingMixture&) = delete;
114 
115 
116 public:
117 
118  //- The type of thermo package this mixture is instantiated for
119  typedef ThermoType thermoType;
120 
121 
122  // Constructors
123 
124  //- Construct from dictionary, mesh and phase name
126  (
127  const dictionary&,
128  const fvMesh&,
129  const word&
130  );
131 
132 
133  //- Destructor
134  virtual ~singleStepReactingMixture() = default;
135 
136 
137  // Member functions
138 
139  //- Return the instantiated type name
140  static word typeName()
141  {
142  return "singleStepReactingMixture<" + ThermoType::typeName() + '>';
143  }
144 
145  //- Calculates the residual for all components
146  void fresCorrect();
147 
148 
149  // Access functions
150 
151  //- Return the stoichiometric air-fuel mass ratio
152  inline const dimensionedScalar stoicRatio() const;
153 
154  //- Return the Stoichiometric oxygen-fuel mass ratio
155  inline const dimensionedScalar s() const;
156 
157  //- Return the heat of combustion [J/Kg]
158  inline const dimensionedScalar qFuel() const;
159 
160  //- Return the stoichiometric coefficient for the reaction
161  inline const List<scalar>& specieStoichCoeffs() const;
162 
163  //- Return the list of components residual
164  inline tmp<volScalarField> fres(const label index) const;
165 
166  //- Return the inert specie index
167  inline label inertIndex() const;
168 
169  //- Return the fuel specie index
170  inline label fuelIndex() const;
171 
172  //- Return the list to indicate if specie is produced/consumed
173  inline const List<int>& specieProd() const;
174 
175  //- Return the list of products mass concentrations
176  inline const scalarList& Yprod0() const;
177 
178 
179  // I-O
180 
181  //- Read dictionary
182  void read(const dictionary&);
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #ifdef NoRepository
197  #include "singleStepReactingMixture.C"
198 #endif
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #endif
203 
204 // ************************************************************************* //
Foam::singleStepReactingMixture::Yprod0
const scalarList & Yprod0() const
Return the list of products mass concentrations.
Definition: singleStepReactingMixtureI.H:101
singleStepReactingMixtureI.H
Foam::singleStepReactingMixture::s_
dimensionedScalar s_
Stoichiometric oxygen-fuel mass ratio.
Definition: singleStepReactingMixture.H:68
Foam::singleStepReactingMixture::thermoType
ThermoType thermoType
The type of thermo package this mixture is instantiated for.
Definition: singleStepReactingMixture.H:118
reactingMixture.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::singleStepReactingMixture::specieStoichCoeffs_
scalarList specieStoichCoeffs_
Stoichiometric coefficient for the reaction.
Definition: singleStepReactingMixture.H:74
singleStepReactingMixture.C
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::singleStepReactingMixture::qFuel_
dimensionedScalar qFuel_
Heat of combustion [J/Kg].
Definition: singleStepReactingMixture.H:71
Foam::singleStepReactingMixture::fresCorrect
void fresCorrect()
Calculates the residual for all components.
Definition: singleStepReactingMixture.C:135
Foam::singleStepReactingMixture::specieProd
const List< int > & specieProd() const
Return the list to indicate if specie is produced/consumed.
Definition: singleStepReactingMixtureI.H:93
Foam::reactingMixture
Foam::reactingMixture.
Definition: reactingMixture.H:57
Foam::singleStepReactingMixture::qFuel
const dimensionedScalar qFuel() const
Return the heat of combustion [J/Kg].
Definition: singleStepReactingMixtureI.H:50
Foam::singleStepReactingMixture::fuelIndex_
label fuelIndex_
Fuel specie index.
Definition: singleStepReactingMixture.H:86
Foam::singleStepReactingMixture::specieProd_
List< int > specieProd_
List to indicate if specie is produced/consumed.
Definition: singleStepReactingMixture.H:89
Foam::singleStepReactingMixture::stoicRatio_
dimensionedScalar stoicRatio_
Stoichiometric air-fuel mass ratio.
Definition: singleStepReactingMixture.H:65
Foam::singleStepReactingMixture::read
void read(const dictionary &)
Read dictionary.
Definition: singleStepReactingMixture.C:255
Foam::singleStepReactingMixture::inertIndex_
label inertIndex_
Inert specie index.
Definition: singleStepReactingMixture.H:83
Foam::singleStepReactingMixture::s
const dimensionedScalar s() const
Return the Stoichiometric oxygen-fuel mass ratio.
Definition: singleStepReactingMixtureI.H:42
Foam::singleStepReactingMixture::fres
tmp< volScalarField > fres(const label index) const
Return the list of components residual.
Definition: singleStepReactingMixtureI.H:67
Foam::singleStepReactingMixture::fuelIndex
label fuelIndex() const
Return the fuel specie index.
Definition: singleStepReactingMixtureI.H:85
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::dimensioned< scalar >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::singleStepReactingMixture::Yprod0_
scalarList Yprod0_
Mass concentrations at stoichiometric mixture for fres.
Definition: singleStepReactingMixture.H:77
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::singleStepReactingMixture::massAndAirStoichRatios
void massAndAirStoichRatios()
Calculate air/fuel and oxygen/fuel ratio.
Definition: singleStepReactingMixture.C:61
Foam::singleStepReactingMixture::inertIndex
label inertIndex() const
Return the inert specie index.
Definition: singleStepReactingMixtureI.H:77
Foam::singleStepReactingMixture::calculateqFuel
void calculateqFuel()
Calculate qFuel.
Definition: singleStepReactingMixture.C:34
Foam::singleStepReactingMixture::~singleStepReactingMixture
virtual ~singleStepReactingMixture()=default
Destructor.
Foam::List< scalar >
Foam::singleStepReactingMixture
Single step reacting mixture.
Definition: singleStepReactingMixture.H:55
Foam::singleStepReactingMixture::typeName
static word typeName()
Return the instantiated type name.
Definition: singleStepReactingMixture.H:139
Foam::singleStepReactingMixture::calculateMaxProducts
void calculateMaxProducts()
Calculate maximum products at stoichiometric mixture.
Definition: singleStepReactingMixture.C:85
Foam::singleStepReactingMixture::fres_
PtrList< volScalarField > fres_
List of components residual.
Definition: singleStepReactingMixture.H:80
chemistryReader.H
Foam::singleStepReactingMixture::specieStoichCoeffs
const List< scalar > & specieStoichCoeffs() const
Return the stoichiometric coefficient for the reaction.
Definition: singleStepReactingMixtureI.H:58
Foam::singleStepReactingMixture::stoicRatio
const dimensionedScalar stoicRatio() const
Return the stoichiometric air-fuel mass ratio.
Definition: singleStepReactingMixtureI.H:34