egrMixture.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::egrMixture
28 
29 Group
30  grpReactionThermophysicalMixtures
31 
32 Description
33  The egr mixture contains species ("ft", "b", "egr").
34 
35 SourceFiles
36  egrMixture.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef egrMixture_H
41 #define egrMixture_H
42 
43 #include "basicCombustionMixture.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class egrMixture Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class ThermoType>
55 class egrMixture
56 :
58 {
59  // Private Data
60 
61  dimensionedScalar stoicRatio_;
62 
63  ThermoType fuel_;
64  ThermoType oxidant_;
65  ThermoType products_;
66 
67  mutable ThermoType mixture_;
68 
69  //- Mixture fraction
70  volScalarField& ft_;
71 
72  //- Regress variable
73  volScalarField& b_;
74 
75  //- Residual gases
76  volScalarField& egr_;
77 
78  //- No copy construct
79  egrMixture(const egrMixture<ThermoType>&) = delete;
80 
81 
82 public:
83 
84  //- The type of thermodynamics this mixture is instantiated for
85  typedef ThermoType thermoType;
86 
87 
88  // Constructors
89 
90  //- Construct from dictionary, mesh and phaseName
92  (
93  const dictionary& thermoDict,
94  const fvMesh& mesh,
95  const word& phaseName
96  );
97 
98 
99  //- Destructor
100  virtual ~egrMixture() = default;
101 
102 
103  // Member functions
104 
105  //- Return the instantiated type name
106  static word typeName()
107  {
108  return "egrMixture<" + ThermoType::typeName() + '>';
109  }
110 
111  const dimensionedScalar& stoicRatio() const
112  {
113  return stoicRatio_;
114  }
115 
116  const ThermoType& mixture
117  (
118  const scalar,
119  const scalar,
120  const scalar
121  ) const;
122 
123  const ThermoType& cellMixture(const label celli) const
124  {
125  return mixture(ft_[celli], b_[celli], egr_[celli]);
126  }
127 
128  const ThermoType& patchFaceMixture
129  (
130  const label patchi,
131  const label facei
132  ) const
133  {
134  return mixture
135  (
136  ft_.boundaryField()[patchi][facei],
137  b_.boundaryField()[patchi][facei],
138  egr_.boundaryField()[patchi][facei]
139  );
140  }
141 
142  const ThermoType& cellReactants(const label celli) const
143  {
144  return mixture(ft_[celli], 1, egr_[celli]);
145  }
146 
147  const ThermoType& patchFaceReactants
148  (
149  const label patchi,
150  const label facei
151  ) const
152  {
153  return mixture
154  (
155  ft_.boundaryField()[patchi][facei],
156  1,
157  egr_.boundaryField()[patchi][facei]
158  );
159  }
160 
161  const ThermoType& cellProducts(const label celli) const
162  {
163  return mixture(ft_[celli], 0, 0);
164  }
165 
166  const ThermoType& patchFaceProducts
167  (
168  const label patchi,
169  const label facei
170  ) const
171  {
172  return mixture
173  (
174  ft_.boundaryField()[patchi][facei],
175  0,
176  0
177  );
178  }
179 
180  //- Read dictionary
181  void read(const dictionary&);
182 
183  //- Return thermo based on index
184  const ThermoType& getLocalThermo(const label speciei) const;
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #ifdef NoRepository
195  #include "egrMixture.C"
196 #endif
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************************************************************* //
Foam::egrMixture::getLocalThermo
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
Definition: egrMixture.C:110
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::egrMixture::typeName
static word typeName()
Return the instantiated type name.
Definition: egrMixture.H:105
Foam::egrMixture::stoicRatio
const dimensionedScalar & stoicRatio() const
Definition: egrMixture.H:110
Foam::egrMixture::patchFaceMixture
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Definition: egrMixture.H:128
egrMixture.C
basicCombustionMixture.H
Foam::egrMixture::patchFaceProducts
const ThermoType & patchFaceProducts(const label patchi, const label facei) const
Definition: egrMixture.H:166
Foam::egrMixture::mixture
const ThermoType & mixture(const scalar, const scalar, const scalar) const
Definition: egrMixture.C:67
Foam::basicCombustionMixture
Specialization of the basicSpecieMixture for combustion.
Definition: basicCombustionMixture.H:53
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::dimensioned< scalar >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
thermoDict
const dictionary & thermoDict
Definition: EEqn.H:16
Foam::egrMixture::cellReactants
const ThermoType & cellReactants(const label celli) const
Definition: egrMixture.H:141
Foam::egrMixture::cellMixture
const ThermoType & cellMixture(const label celli) const
Definition: egrMixture.H:122
Foam::egrMixture::~egrMixture
virtual ~egrMixture()=default
Destructor.
Foam::egrMixture::thermoType
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: egrMixture.H:84
Foam::egrMixture::patchFaceReactants
const ThermoType & patchFaceReactants(const label patchi, const label facei) const
Definition: egrMixture.H:147
Foam::egrMixture::read
void read(const dictionary &)
Read dictionary.
Definition: egrMixture.C:98
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::egrMixture::cellProducts
const ThermoType & cellProducts(const label celli) const
Definition: egrMixture.H:160
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62
Foam::egrMixture
The egr mixture contains species ("ft", "b", "egr").
Definition: egrMixture.H:54