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-2020 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 "basicCombustionMixture.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class egrMixture Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class ThermoType>
50 class egrMixture
51 :
53 {
54 
55 public:
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 Data
70 
71  static const int nSpecies_ = 3;
72  static const char* specieNames_[3];
73 
74  dimensionedScalar stoicRatio_;
75 
76  ThermoType fuel_;
77  ThermoType oxidant_;
78  ThermoType products_;
79 
80  mutable thermoType mixture_;
81 
82  //- Mixture fraction
83  volScalarField& ft_;
84 
85  //- Regress variable
86  volScalarField& b_;
87 
88  //- Residual gases
89  volScalarField& egr_;
90 
91 
92 public:
93 
94  // Constructors
95 
96  //- Construct from dictionary, mesh and phaseName
97  egrMixture(const dictionary&, const fvMesh&, const word&);
98 
99  //- Disallow default bitwise copy construction
100  egrMixture(const egrMixture<ThermoType>&) = delete;
101 
102 
103  //- Destructor
104  virtual ~egrMixture()
105  {}
106 
107 
108  // Member Functions
109 
110  //- Return the instantiated type name
111  static word typeName()
112  {
113  return "egrMixture<" + ThermoType::typeName() + '>';
114  }
116  const dimensionedScalar& stoicRatio() const
117  {
118  return stoicRatio_;
119  }
120 
121  const thermoType& mixture
122  (
123  const scalar,
124  const scalar,
125  const scalar
126  ) const;
128  const thermoMixtureType& cellThermoMixture(const label celli) const
129  {
130  return mixture(ft_[celli], b_[celli], egr_[celli]);
131  }
132 
133  const thermoMixtureType& patchFaceThermoMixture
134  (
135  const label patchi,
136  const label facei
137  ) const
138  {
139  return mixture
140  (
141  ft_.boundaryField()[patchi][facei],
142  b_.boundaryField()[patchi][facei],
143  egr_.boundaryField()[patchi][facei]
144  );
145  }
146 
147  const transportMixtureType& cellTransportMixture
148  (
149  const label celli
150  ) const
151  {
152  return cellThermoMixture(celli);
153  }
154 
155  const transportMixtureType& patchFaceTransportMixture
156  (
157  const label patchi,
158  const label facei
159  ) const
160  {
161  return patchFaceThermoMixture(patchi, facei);
162  }
163 
164  const transportMixtureType& cellTransportMixture
165  (
166  const label,
167  const thermoMixtureType& thermoMixture
168  ) const
169  {
170  return thermoMixture;
171  }
172 
173  const transportMixtureType& patchFaceTransportMixture
174  (
175  const label,
176  const label,
177  const thermoMixtureType& thermoMixture
178  ) const
179  {
180  return thermoMixture;
181  }
183  const thermoType& cellReactants(const label celli) const
184  {
185  return mixture(ft_[celli], 1, egr_[celli]);
186  }
187 
188  const thermoType& patchFaceReactants
189  (
190  const label patchi,
191  const label facei
192  ) const
193  {
194  return mixture
195  (
196  ft_.boundaryField()[patchi][facei],
197  1,
198  egr_.boundaryField()[patchi][facei]
199  );
200  }
202  const thermoType& cellProducts(const label celli) const
203  {
204  return mixture(ft_[celli], 0, 0);
205  }
206 
207  const thermoType& patchFaceProducts
208  (
209  const label patchi,
210  const label facei
211  ) const
212  {
213  return mixture
214  (
215  ft_.boundaryField()[patchi][facei],
216  0,
217  0
218  );
219  }
220 
221  //- Read dictionary
222  void read(const dictionary&);
223 
224  //- Return thermo based on index
225  const ThermoType& specieThermo(const label speciei) const;
226 
227 
228  // Member Operators
229 
230  //- Disallow default bitwise assignment
231  void operator=(const egrMixture<ThermoType>&) = delete;
232 };
233 
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 } // End namespace Foam
238 
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
240 
241 #ifdef NoRepository
242  #include "egrMixture.C"
243 #endif
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #endif
248 
249 // ************************************************************************* //
const thermoMixtureType & patchFaceThermoMixture(const label patchi, const label facei) const
Definition: egrMixture.H:133
Foam::egrMixture.
Definition: egrMixture.H:49
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const thermoType & cellProducts(const label celli) const
Definition: egrMixture.H:201
const Boundary & boundaryField() const
Return const-reference to the boundary field.
const dimensionedScalar & stoicRatio() const
Definition: egrMixture.H:115
void read(const dictionary &)
Read dictionary.
Definition: egrMixture.C:102
const thermoMixtureType & cellThermoMixture(const label celli) const
Definition: egrMixture.H:127
const thermoType & mixture(const scalar, const scalar, const scalar) const
Definition: egrMixture.C:71
const thermoType & patchFaceProducts(const label patchi, const label facei) const
Definition: egrMixture.H:207
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: egrMixture.H:57
const transportMixtureType & patchFaceTransportMixture(const label patchi, const label facei) const
Definition: egrMixture.H:155
A class for handling words, derived from string.
Definition: word.H:59
Specialisation of the basicMixture for combustion.
const ThermoType & specieThermo(const label speciei) const
Return thermo based on index.
Definition: egrMixture.C:114
void operator=(const egrMixture< ThermoType > &)=delete
Disallow default bitwise assignment.
const thermoType & patchFaceReactants(const label patchi, const label facei) const
Definition: egrMixture.H:188
egrMixture(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phaseName.
Definition: egrMixture.C:39
virtual ~egrMixture()
Destructor.
Definition: egrMixture.H:103
const thermoType & cellReactants(const label celli) const
Definition: egrMixture.H:182
label patchi
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
static word typeName()
Return the instantiated type name.
Definition: egrMixture.H:110
const transportMixtureType & cellTransportMixture(const label celli) const
Definition: egrMixture.H:147
ThermoType transportMixtureType
Mixing type for transport properties.
Definition: egrMixture.H:63
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
Definition: egrMixture.H:60
Namespace for OpenFOAM.