initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / thermophysicalModels / combustion / mixtureThermos / mixtures / dieselMixture / dieselMixture.H
blob363a2a35090027bbcf035e7e28eff1feb0d510a1
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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::dieselMixture
28 Description
29     Foam::dieselMixture
31 SourceFiles
32     dieselMixture.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef dieselMixture_H
37 #define dieselMixture_H
39 #include "combustionMixture.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                            Class dieselMixture Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class ThermoType>
51 class dieselMixture
53     public combustionMixture
55     // Private data
57         static const int nSpecies_ = 2;
58         static const char* specieNames_[2];
60         dimensionedScalar stoicRatio_;
62         ThermoType fuel_;
63         ThermoType oxidant_;
64         ThermoType products_;
66         mutable ThermoType mixture_;
68         volScalarField& ft_;
69         volScalarField& fu_;
71         //- Construct as copy (not implemented)
72         dieselMixture(const dieselMixture<ThermoType>&);
75 public:
77     //- The type of thermodynamics this mixture is instantiated for
78     typedef ThermoType thermoType;
81     // Constructors
83         //- Construct from dictionary and mesh
84         dieselMixture(const dictionary&, const fvMesh&);
87     // Destructor
89         virtual ~dieselMixture()
90         {}
93     // Member functions
95         const dimensionedScalar& stoicRatio() const
96         {
97             return stoicRatio_;
98         }
100         const ThermoType& mixture(const scalar, const scalar) const;
102         const ThermoType& cellMixture(const label celli) const
103         {
104             return mixture(ft_[celli], fu_[celli]);
105         }
107         const ThermoType& patchFaceMixture
108         (
109             const label patchi,
110             const label facei
111         ) const
112         {
113             return mixture
114             (
115                 ft_.boundaryField()[patchi][facei],
116                 fu_.boundaryField()[patchi][facei]
117             );
118         }
120         const ThermoType& cellReactants(const label celli) const
121         {
122             return mixture(ft_[celli], ft_[celli]);
123         }
125         const ThermoType& patchFaceReactants
126         (
127             const label patchi,
128             const label facei
129         ) const
130         {
131             return mixture
132             (
133                 ft_.boundaryField()[patchi][facei],
134                 ft_.boundaryField()[patchi][facei]
135             );
136         }
138         const ThermoType& cellProducts(const label celli) const
139         {
140             scalar ft = ft_[celli];
141             return mixture(ft, fres(ft, stoicRatio().value()));
142         }
144         const ThermoType& patchFaceProducts
145         (
146             const label patchi,
147             const label facei
148         ) const
149         {
150             scalar ft = ft_.boundaryField()[patchi][facei];
151             return mixture(ft, fres(ft, stoicRatio().value()));
152         }
154         //- Read dictionary
155         void read(const dictionary&);
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 } // End namespace Foam
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
165 #ifdef NoRepository
166 #   include "dieselMixture.C"
167 #endif
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 #endif
173 // ************************************************************************* //