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 "veryInhomogeneousMixture.H"
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 template<class ThermoType>
32 const char* Foam::veryInhomogeneousMixture<ThermoType>::specieNames_[3] =
36 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 template<class ThermoType>
39 Foam::veryInhomogeneousMixture<ThermoType>::veryInhomogeneousMixture
41 const dictionary& thermoDict,
45 basicMultiComponentMixture
48 speciesTable(nSpecies_, specieNames_),
52 stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")),
54 fuel_(thermoDict.subDict("fuel")),
55 oxidant_(thermoDict.subDict("oxidant")),
56 products_(thermoDict.subDict("burntProducts")),
58 mixture_("mixture", fuel_),
66 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
68 template<class ThermoType>
69 const ThermoType& Foam::veryInhomogeneousMixture<ThermoType>::mixture
81 scalar ox = 1 - ft - (ft - fu)*stoicRatio().value();
82 scalar pr = 1 - fu - ox;
84 mixture_ = fu/fuel_.W()*fuel_;
85 mixture_ += ox/oxidant_.W()*oxidant_;
86 mixture_ += pr/products_.W()*products_;
93 template<class ThermoType>
94 void Foam::veryInhomogeneousMixture<ThermoType>::read
96 const dictionary& thermoDict
99 fuel_ = ThermoType(thermoDict.subDict("fuel"));
100 oxidant_ = ThermoType(thermoDict.subDict("oxidant"));
101 products_ = ThermoType(thermoDict.subDict("burntProducts"));
105 template<class ThermoType>
106 const ThermoType& Foam::veryInhomogeneousMixture<ThermoType>::getLocalThermo
115 else if (specieI == 1)
119 else if (specieI == 2)
127 "const ThermoType& Foam::veryInhomogeneousMixture<ThermoType>::"
132 ) << "Unknown specie index " << specieI << ". Valid indices are 0..2"
133 << abort(FatalError);
140 template<class ThermoType>
141 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::nMoles
146 return getLocalThermo(specieI).nMoles();
150 template<class ThermoType>
151 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::W
156 return getLocalThermo(specieI).W();
160 template<class ThermoType>
161 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Cp
167 return getLocalThermo(specieI).Cp(T);
171 template<class ThermoType>
172 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Cv
178 return getLocalThermo(specieI).Cv(T);
182 template<class ThermoType>
183 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::H
189 return getLocalThermo(specieI).H(T);
193 template<class ThermoType>
194 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Hs
200 return getLocalThermo(specieI).Hs(T);
204 template<class ThermoType>
205 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Hc
210 return getLocalThermo(specieI).Hc();
214 template<class ThermoType>
215 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::S
221 return getLocalThermo(specieI).S(T);
225 template<class ThermoType>
226 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::E
232 return getLocalThermo(specieI).E(T);
236 template<class ThermoType>
237 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::G
243 return getLocalThermo(specieI).G(T);
247 template<class ThermoType>
248 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::A
254 return getLocalThermo(specieI).A(T);
258 template<class ThermoType>
259 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::mu
265 return getLocalThermo(specieI).mu(T);
269 template<class ThermoType>
270 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::kappa
276 return getLocalThermo(specieI).kappa(T);
280 template<class ThermoType>
281 Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::alpha
287 return getLocalThermo(specieI).alpha(T);
291 // ************************************************************************* //