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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::egrMixture
28
29Group
30 grpReactionThermophysicalMixtures
31
32Description
33 The egr mixture contains species ("ft", "b", "egr").
34
35SourceFiles
36 egrMixture.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef egrMixture_H
41#define egrMixture_H
42
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class egrMixture Declaration
52\*---------------------------------------------------------------------------*/
53
54template<class ThermoType>
55class 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
74
75 //- Residual gases
76 volScalarField& egr_;
77
78 //- No copy construct
79 egrMixture(const egrMixture<ThermoType>&) = delete;
80
81
82public:
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 (
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 }
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;
123 const ThermoType& cellMixture(const label celli) const
124 {
125 return mixture(ft_[celli], b_[celli], egr_[celli]);
126 }
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 }
142 const ThermoType& cellReactants(const label celli) const
143 {
144 return mixture(ft_[celli], 1, egr_[celli]);
145 }
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 }
161 const ThermoType& cellProducts(const label celli) const
162 {
163 return mixture(ft_[celli], 0, 0);
164 }
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// ************************************************************************* //
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Specialization of the basicSpecieMixture for combustion.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
The egr mixture contains species ("ft", "b", "egr").
Definition: egrMixture.H:57
const ThermoType & cellMixture(const label celli) const
Definition: egrMixture.H:122
const ThermoType & cellReactants(const label celli) const
Definition: egrMixture.H:141
const ThermoType & cellProducts(const label celli) const
Definition: egrMixture.H:160
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: egrMixture.H:84
const ThermoType & patchFaceProducts(const label patchi, const label facei) const
Definition: egrMixture.H:166
static word typeName()
Return the instantiated type name.
Definition: egrMixture.H:105
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Definition: egrMixture.H:128
const dimensionedScalar & stoicRatio() const
Definition: egrMixture.H:110
const ThermoType & patchFaceReactants(const label patchi, const label facei) const
Definition: egrMixture.H:147
void read(const dictionary &)
Read dictionary.
Definition: egrMixture.C:98
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
Definition: egrMixture.C:110
virtual ~egrMixture()=default
Destructor.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
A class for handling words, derived from Foam::string.
Definition: word.H:68
const dictionary & thermoDict
Definition: EEqn.H:16
dynamicFvMesh & mesh
Namespace for OpenFOAM.