initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / reactionThermo / mixtures / egrMixture / egrMixture.H
blobe53029155006c848158e9fc1104da1ee41e6b323
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::egrMixture
28 Description
29     Foam::egrMixture
31 SourceFiles
32     egrMixture.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef egrMixture_H
37 #define egrMixture_H
39 #include "basicMultiComponentMixture.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                          Class egrMixture Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class ThermoType>
51 class egrMixture
53     public basicMultiComponentMixture
55     // Private data
57         static const int nSpecies_ = 3;
58         static const char* specieNames_[3];
60         dimensionedScalar stoicRatio_;
62         ThermoType fuel_;
63         ThermoType oxidant_;
64         ThermoType products_;
66         mutable ThermoType mixture_;
68         //- Mixture fraction
69         volScalarField& ft_;
71         //- Regress variable
72         volScalarField& b_;
74         //- Residual gases
75         volScalarField& egr_;
77         //- Construct as copy (not implemented)
78         egrMixture(const egrMixture<ThermoType>&);
81 public:
83     //- The type of thermodynamics this mixture is instantiated for
84     typedef ThermoType thermoType;
87     // Constructors
89         //- Construct from dictionary and mesh
90         egrMixture(const dictionary&, const fvMesh&);
93     //- Destructor
94     virtual ~egrMixture()
95     {}
98     // Member functions
100         const dimensionedScalar& stoicRatio() const
101         {
102             return stoicRatio_;
103         }
105         const ThermoType& mixture
106         (
107             const scalar,
108             const scalar,
109             const scalar
110         ) const;
112         const ThermoType& cellMixture(const label celli) const
113         {
114             return mixture(ft_[celli], b_[celli], egr_[celli]);
115         }
117         const ThermoType& patchFaceMixture
118         (
119             const label patchi,
120             const label facei
121         ) const
122         {
123             return mixture
124             (
125                 ft_.boundaryField()[patchi][facei],
126                 b_.boundaryField()[patchi][facei],
127                 egr_.boundaryField()[patchi][facei]
128             );
129         }
131         const ThermoType& cellReactants(const label celli) const
132         {
133             return mixture(ft_[celli], 1, egr_[celli]);
134         }
136         const ThermoType& patchFaceReactants
137         (
138             const label patchi,
139             const label facei
140         ) const
141         {
142             return mixture
143             (
144                 ft_.boundaryField()[patchi][facei],
145                 1,
146                 egr_.boundaryField()[patchi][facei]
147             );
148         }
150         const ThermoType& cellProducts(const label celli) const
151         {
152             return mixture(ft_[celli], 0, 0);
153         }
155         const ThermoType& patchFaceProducts
156         (
157             const label patchi,
158             const label facei
159         ) const
160         {
161             return mixture
162             (
163                 ft_.boundaryField()[patchi][facei],
164                 0,
165                 0
166             );
167         }
169         //- Read dictionary
170         void read(const dictionary&);
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 } // End namespace Foam
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
180 #ifdef NoRepository
181 #   include "egrMixture.C"
182 #endif
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 #endif
188 // ************************************************************************* //