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  // Private Data
55 
56  static const int nSpecies_ = 3;
57  static const char* specieNames_[3];
58 
59  dimensionedScalar stoicRatio_;
60 
61  ThermoType fuel_;
62  ThermoType oxidant_;
63  ThermoType products_;
64 
65  mutable ThermoType mixture_;
66 
67  //- Mixture fraction
68  volScalarField& ft_;
69 
70  //- Regress variable
71  volScalarField& b_;
72 
73  //- Residual gases
74  volScalarField& egr_;
75 
76  //- Construct as copy (not implemented)
78 
79 
80 public:
81 
82  //- The type of thermodynamics this mixture is instantiated for
83  typedef ThermoType thermoType;
84 
85 
86  // Constructors
87 
88  //- Construct from dictionary, mesh and phaseName
89  egrMixture(const dictionary&, const fvMesh&, const word&);
90 
91 
92  //- Destructor
93  virtual ~egrMixture()
94  {}
95 
96 
97  // Member Functions
98 
99  //- Return the instantiated type name
100  static word typeName()
101  {
102  return "egrMixture<" + ThermoType::typeName() + '>';
103  }
105  const dimensionedScalar& stoicRatio() const
106  {
107  return stoicRatio_;
108  }
109 
110  const ThermoType& mixture
111  (
112  const scalar,
113  const scalar,
114  const scalar
115  ) const;
117  const ThermoType& cellMixture(const label celli) const
118  {
119  return mixture(ft_[celli], b_[celli], egr_[celli]);
120  }
121 
122  const ThermoType& patchFaceMixture
123  (
124  const label patchi,
125  const label facei
126  ) const
127  {
128  return mixture
129  (
130  ft_.boundaryField()[patchi][facei],
131  b_.boundaryField()[patchi][facei],
132  egr_.boundaryField()[patchi][facei]
133  );
134  }
136  const ThermoType& cellReactants(const label celli) const
137  {
138  return mixture(ft_[celli], 1, egr_[celli]);
139  }
140 
141  const ThermoType& patchFaceReactants
142  (
143  const label patchi,
144  const label facei
145  ) const
146  {
147  return mixture
148  (
149  ft_.boundaryField()[patchi][facei],
150  1,
151  egr_.boundaryField()[patchi][facei]
152  );
153  }
155  const ThermoType& cellProducts(const label celli) const
156  {
157  return mixture(ft_[celli], 0, 0);
158  }
159 
160  const ThermoType& patchFaceProducts
161  (
162  const label patchi,
163  const label facei
164  ) const
165  {
166  return mixture
167  (
168  ft_.boundaryField()[patchi][facei],
169  0,
170  0
171  );
172  }
173 
174  //- Read dictionary
175  void read(const dictionary&);
176 
177  //- Return thermo based on index
178  const ThermoType& specieThermo(const label speciei) const;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
187 
188 #ifdef NoRepository
189  #include "egrMixture.C"
190 #endif
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
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:158
const Boundary & boundaryField() const
Return const-reference to the boundary field.
const dimensionedScalar & stoicRatio() const
Definition: egrMixture.H:104
void read(const dictionary &)
Read dictionary.
Definition: egrMixture.C:102
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:160
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: egrMixture.H:82
A class for handling words, derived from string.
Definition: word.H:59
Specialization of the basicMixture for combustion.
const ThermoType & cellMixture(const label celli) const
Definition: egrMixture.H:116
const ThermoType & specieThermo(const label speciei) const
Return thermo based on index.
Definition: egrMixture.C:114
const ThermoType & cellProducts(const label celli) const
Definition: egrMixture.H:154
const ThermoType & cellReactants(const label celli) const
Definition: egrMixture.H:135
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Definition: egrMixture.H:122
virtual ~egrMixture()
Destructor.
Definition: egrMixture.H:92
label patchi
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
static word typeName()
Return the instantiated type name.
Definition: egrMixture.H:99
const ThermoType & patchFaceReactants(const label patchi, const label facei) const
Definition: egrMixture.H:141
Namespace for OpenFOAM.