1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "dieselMixture.H"
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 template<class ThermoType>
32 const char* Foam::dieselMixture<ThermoType>::specieNames_[2] = {"ft", "fu"};
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37 template<class ThermoType>
38 Foam::dieselMixture<ThermoType>::dieselMixture
40 const dictionary& thermoDict,
44 basicMultiComponentMixture
47 speciesTable(nSpecies_, specieNames_),
51 stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")),
53 fuel_(thermoDict.subDict("fuel")),
54 oxidant_(thermoDict.subDict("oxidant")),
55 products_(thermoDict.subDict("burntProducts")),
57 mixture_("mixture", fuel_),
64 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
66 template<class ThermoType>
67 const ThermoType& Foam::dieselMixture<ThermoType>::mixture
79 scalar ox = 1 - ft - (ft - fu)*stoicRatio().value();
80 scalar pr = 1 - fu - ox;
82 mixture_ = fu/fuel_.W()*fuel_;
83 mixture_ += ox/oxidant_.W()*oxidant_;
84 mixture_ += pr/products_.W()*products_;
91 template<class ThermoType>
92 void Foam::dieselMixture<ThermoType>::read(const dictionary& thermoDict)
94 fuel_ = ThermoType(thermoDict.subDict("fuel"));
95 oxidant_ = ThermoType(thermoDict.subDict("oxidant"));
96 products_ = ThermoType(thermoDict.subDict("burntProducts"));
100 template<class ThermoType>
101 const ThermoType& Foam::dieselMixture<ThermoType>::getLocalThermo
110 else if (specieI == 1)
114 else if (specieI == 2)
122 "const ThermoType& Foam::dieselMixture<ThermoType>::getLocalThermo"
126 ) << "Unknown specie index " << specieI << ". Valid indices are 0..2"
127 << abort(FatalError);
134 template<class ThermoType>
135 Foam::scalar Foam::dieselMixture<ThermoType>::nMoles
140 return getLocalThermo(specieI).nMoles();
144 template<class ThermoType>
145 Foam::scalar Foam::dieselMixture<ThermoType>::W
150 return getLocalThermo(specieI).W();
154 template<class ThermoType>
155 Foam::scalar Foam::dieselMixture<ThermoType>::Cp
161 return getLocalThermo(specieI).Cp(T);
165 template<class ThermoType>
166 Foam::scalar Foam::dieselMixture<ThermoType>::Cv
172 return getLocalThermo(specieI).Cv(T);
176 template<class ThermoType>
177 Foam::scalar Foam::dieselMixture<ThermoType>::H
183 return getLocalThermo(specieI).H(T);
187 template<class ThermoType>
188 Foam::scalar Foam::dieselMixture<ThermoType>::Hs
194 return getLocalThermo(specieI).Hs(T);
198 template<class ThermoType>
199 Foam::scalar Foam::dieselMixture<ThermoType>::Hc
204 return getLocalThermo(specieI).Hc();
208 template<class ThermoType>
209 Foam::scalar Foam::dieselMixture<ThermoType>::S
215 return getLocalThermo(specieI).S(T);
219 template<class ThermoType>
220 Foam::scalar Foam::dieselMixture<ThermoType>::E
226 return getLocalThermo(specieI).E(T);
230 template<class ThermoType>
231 Foam::scalar Foam::dieselMixture<ThermoType>::G
237 return getLocalThermo(specieI).G(T);
241 template<class ThermoType>
242 Foam::scalar Foam::dieselMixture<ThermoType>::A
248 return getLocalThermo(specieI).A(T);
252 template<class ThermoType>
253 Foam::scalar Foam::dieselMixture<ThermoType>::mu
259 return getLocalThermo(specieI).mu(T);
263 template<class ThermoType>
264 Foam::scalar Foam::dieselMixture<ThermoType>::kappa
270 return getLocalThermo(specieI).kappa(T);
274 template<class ThermoType>
275 Foam::scalar Foam::dieselMixture<ThermoType>::alpha
281 return getLocalThermo(specieI).alpha(T);
285 // ************************************************************************* //