FreeFOAM The Cross-Platform CFD Toolkit
dieselMixture.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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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::dieselMixture
26 
27 Description
28  Foam::dieselMixture
29 
30 SourceFiles
31  dieselMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef dieselMixture_H
36 #define dieselMixture_H
37 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class dieselMixture Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class ThermoType>
51 :
53 {
54  // Private data
55 
56  static const int nSpecies_ = 2;
57  static const char* specieNames_[2];
58 
59  dimensionedScalar stoicRatio_;
60 
61  ThermoType fuel_;
62  ThermoType oxidant_;
63  ThermoType products_;
64 
65  mutable ThermoType mixture_;
66 
67  volScalarField& ft_;
68  volScalarField& fu_;
69 
70  //- Construct as copy (not implemented)
72 
73 
74 public:
75 
76  //- The type of thermodynamics this mixture is instantiated for
78 
79 
80  // Constructors
81 
82  //- Construct from dictionary and mesh
83  dieselMixture(const dictionary&, const fvMesh&);
84 
85 
86  //- Destructor
87  virtual ~dieselMixture()
88  {}
89 
90 
91  // Member functions
92 
94  {
95  return stoicRatio_;
96  }
97 
98  const ThermoType& mixture(const scalar, const scalar) const;
99 
100  const ThermoType& cellMixture(const label celli) const
101  {
102  return mixture(ft_[celli], fu_[celli]);
103  }
104 
106  (
107  const label patchi,
108  const label facei
109  ) const
110  {
111  return mixture
112  (
113  ft_.boundaryField()[patchi][facei],
114  fu_.boundaryField()[patchi][facei]
115  );
116  }
117 
118  const ThermoType& cellReactants(const label celli) const
119  {
120  return mixture(ft_[celli], ft_[celli]);
121  }
122 
124  (
125  const label patchi,
126  const label facei
127  ) const
128  {
129  return mixture
130  (
131  ft_.boundaryField()[patchi][facei],
132  ft_.boundaryField()[patchi][facei]
133  );
134  }
135 
136  const ThermoType& cellProducts(const label celli) const
137  {
138  scalar ft = ft_[celli];
139  return mixture(ft, fres(ft, stoicRatio().value()));
140  }
141 
143  (
144  const label patchi,
145  const label facei
146  ) const
147  {
148  scalar ft = ft_.boundaryField()[patchi][facei];
149  return mixture(ft, fres(ft, stoicRatio().value()));
150  }
151 
152  //- Read dictionary
153  void read(const dictionary&);
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
162 
163 #ifdef NoRepository
165 #endif
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************ vim: set sw=4 sts=4 et: ************************ //