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
Definition: singleStepReactingMixtureI.H:94
singleStepReactingMixtureI.H
Foam::singleStepReactingMixture::s_
dimensionedScalar s_
Definition: singleStepReactingMixture.H:64
Foam::singleStepReactingMixture::thermoType
ThermoType thermoType
Definition: singleStepReactingMixture.H:114
reactingMixture.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:63
Foam::singleStepReactingMixture::specieStoichCoeffs_
scalarList specieStoichCoeffs_
Definition: singleStepReactingMixture.H:70
singleStepReactingMixture.C
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:57
Foam::singleStepReactingMixture::qFuel_
dimensionedScalar qFuel_
Definition: singleStepReactingMixture.H:67
Foam::singleStepReactingMixture::fresCorrect
void fresCorrect()
Definition: singleStepReactingMixture.C:128
Foam::singleStepReactingMixture::specieProd
const List< int > & specieProd() const
Definition: singleStepReactingMixtureI.H:86
Foam::reactingMixture
Foam::reactingMixture.
Definition: reactingMixture.H:53
Foam::singleStepReactingMixture::qFuel
const dimensionedScalar qFuel() const
Definition: singleStepReactingMixtureI.H:43
Foam::singleStepReactingMixture::fuelIndex_
label fuelIndex_
Definition: singleStepReactingMixture.H:82
Foam::singleStepReactingMixture::specieProd_
List< int > specieProd_
Definition: singleStepReactingMixture.H:85
Foam::singleStepReactingMixture::stoicRatio_
dimensionedScalar stoicRatio_
Definition: singleStepReactingMixture.H:61
Foam::singleStepReactingMixture::read
void read(const dictionary &)
Definition: singleStepReactingMixture.C:248
Foam::singleStepReactingMixture::inertIndex_
label inertIndex_
Definition: singleStepReactingMixture.H:79
Foam::singleStepReactingMixture::s
const dimensionedScalar s() const
Definition: singleStepReactingMixtureI.H:35
Foam::singleStepReactingMixture::fres
tmp< volScalarField > fres(const label index) const
Definition: singleStepReactingMixtureI.H:60
Foam::singleStepReactingMixture::fuelIndex
label fuelIndex() const
Definition: singleStepReactingMixtureI.H:78
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:55
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:119
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:36
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:81
Foam::singleStepReactingMixture::Yprod0_
scalarList Yprod0_
Definition: singleStepReactingMixture.H:73
Foam
Definition: atmBoundaryLayer.C:26
Foam::singleStepReactingMixture::massAndAirStoichRatios
void massAndAirStoichRatios()
Definition: singleStepReactingMixture.C:54
Foam::singleStepReactingMixture::inertIndex
label inertIndex() const
Definition: singleStepReactingMixtureI.H:70
Foam::singleStepReactingMixture::calculateqFuel
void calculateqFuel()
Definition: singleStepReactingMixture.C:27
Foam::singleStepReactingMixture::~singleStepReactingMixture
virtual ~singleStepReactingMixture()=default
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:58
Foam::singleStepReactingMixture
Single step reacting mixture.
Definition: singleStepReactingMixture.H:51
Foam::singleStepReactingMixture::typeName
static word typeName()
Definition: singleStepReactingMixture.H:135
Foam::singleStepReactingMixture::calculateMaxProducts
void calculateMaxProducts()
Definition: singleStepReactingMixture.C:78
Foam::singleStepReactingMixture::fres_
PtrList< volScalarField > fres_
Definition: singleStepReactingMixture.H:76
chemistryReader.H
Foam::singleStepReactingMixture::specieStoichCoeffs
const List< scalar > & specieStoichCoeffs() const
Definition: singleStepReactingMixtureI.H:51
Foam::singleStepReactingMixture::stoicRatio
const dimensionedScalar stoicRatio() const
Definition: singleStepReactingMixtureI.H:27