egrMixture.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-2023 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::egrMixture
26 
27 Description
28  Foam::egrMixture
29 
30 SourceFiles
31  egrMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef egrMixture_H
36 #define egrMixture_H
37 
38 #include "dimensionedTypes.H"
39 #include "FieldListSlice.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class egrMixture Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class ThermoType>
51 class egrMixture
52 {
53 public:
54 
55  // Public Typedefs
56 
57  //- The type of thermodynamics this mixture is instantiated for
58  typedef ThermoType thermoType;
59 
60  //- Mixing type for thermodynamic properties
61  typedef ThermoType thermoMixtureType;
62 
63  //- Mixing type for transport properties
64  typedef ThermoType transportMixtureType;
65 
66 
67 private:
68 
69  // Private Enumerations
70 
71  //- Specie indices
72  enum species { FT, B, EGR };
73 
74 
75  // Private Data
76 
77  //- Stoichiometric air/fuel ratio
78  dimensionedScalar stoicRatio_;
79 
80  //- Fuel thermodynamic model
81  thermoType fuel_;
82 
83  //- Oxidant thermodynamic model
84  thermoType oxidant_;
85 
86  //- Product thermodynamic model
87  thermoType products_;
88 
89  //- Mutable storage for the mixed thermodynamic model
90  mutable thermoType mixture_;
91 
92 
93 public:
94 
95  // Constructors
96 
97  //- Construct from a dictionary
98  egrMixture(const dictionary&);
99 
100  //- Disallow default bitwise copy construction
101  egrMixture(const egrMixture<ThermoType>&) = delete;
102 
103 
104  //- Destructor
105  virtual ~egrMixture()
106  {}
107 
108 
109  // Member Functions
110 
111  //- Return the instantiated type name
112  static word typeName()
113  {
114  return "egrMixture<" + ThermoType::typeName() + '>';
115  }
116 
117  //- Return the specie names
118  static wordList specieNames()
119  {
120  return {"ft", "b", "egr"};
121  }
122 
123  //- Return the residual fraction of fuel in the burnt mixture
124  scalar fres(const scalar ft) const
125  {
126  return max(ft - (scalar(1) - ft)/stoicRatio_.value(), scalar(0));
127  }
128 
129  //- Return the mixture for the given composition
130  const thermoType& mixture
131  (
132  const scalar ft,
133  const scalar b,
134  const scalar egr
135  ) const;
136 
137  //- Return the mixture for thermodynamic properties
139  (
140  const scalarFieldListSlice&
141  ) const;
142 
143  //- Return the mixture for transport properties
145  (
146  const scalarFieldListSlice&
147  ) const;
148 
149  //- Return the mixture for transport properties
151  (
152  const scalarFieldListSlice&,
153  const thermoMixtureType&
154  ) const;
155 
156  //- Return the reactant mixture
157  const thermoType& reactants(const scalarFieldListSlice&) const;
158 
159  //- Return the product mixture
160  const thermoType& products(const scalarFieldListSlice&) const;
161 
162  //- Read dictionary
163  void read(const dictionary&);
164 
165 
166  // Member Operators
167 
168  //- Disallow default bitwise assignment
169  void operator=(const egrMixture<ThermoType>&) = delete;
170 };
171 
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 } // End namespace Foam
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
178 
179 #ifdef NoRepository
180  #include "egrMixture.C"
181 #endif
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #endif
186 
187 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const Type & value() const
Return const reference to value.
Foam::egrMixture.
Definition: egrMixture.H:51
static wordList specieNames()
Return the specie names.
Definition: egrMixture.H:117
const transportMixtureType & transportMixture(const scalarFieldListSlice &) const
Return the mixture for transport properties.
Definition: egrMixture.C:88
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: egrMixture.H:57
egrMixture(const dictionary &)
Construct from a dictionary.
Definition: egrMixture.C:31
static word typeName()
Return the instantiated type name.
Definition: egrMixture.H:111
ThermoType transportMixtureType
Mixing type for transport properties.
Definition: egrMixture.H:63
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
Definition: egrMixture.H:60
const thermoType & mixture(const scalar ft, const scalar b, const scalar egr) const
Return the mixture for the given composition.
Definition: egrMixture.C:45
void read(const dictionary &)
Read dictionary.
Definition: egrMixture.C:125
virtual ~egrMixture()
Destructor.
Definition: egrMixture.H:104
const thermoType & products(const scalarFieldListSlice &) const
Return the product mixture.
Definition: egrMixture.C:118
scalar fres(const scalar ft) const
Return the residual fraction of fuel in the burnt mixture.
Definition: egrMixture.H:123
const thermoMixtureType & thermoMixture(const scalarFieldListSlice &) const
Return the mixture for thermodynamic properties.
Definition: egrMixture.C:77
const thermoType & reactants(const scalarFieldListSlice &) const
Return the reactant mixture.
Definition: egrMixture.C:110
void operator=(const egrMixture< ThermoType > &)=delete
Disallow default bitwise assignment.
A class for handling words, derived from string.
Definition: word.H:62
volScalarField & b
Definition: createFields.H:25
Namespace for OpenFOAM.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)