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 "homogeneousMixture.H"
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 template<class ThermoType>
32 const char* Foam::homogeneousMixture<ThermoType>::specieNames_[1] = {"b"};
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37 template<class ThermoType>
38 Foam::homogeneousMixture<ThermoType>::homogeneousMixture
40 const dictionary& thermoDict,
44 basicMultiComponentMixture
47 speciesTable(nSpecies_, specieNames_),
51 reactants_(thermoDict.subDict("reactants")),
52 products_(thermoDict.subDict("products")),
53 mixture_("mixture", reactants_),
58 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
60 template<class ThermoType>
61 const ThermoType& Foam::homogeneousMixture<ThermoType>::mixture
76 mixture_ = b/reactants_.W()*reactants_;
77 mixture_ += (1 - b)/products_.W()*products_;
84 template<class ThermoType>
85 void Foam::homogeneousMixture<ThermoType>::read(const dictionary& thermoDict)
87 reactants_ = ThermoType(thermoDict.subDict("reactants"));
88 products_ = ThermoType(thermoDict.subDict("products"));
92 template<class ThermoType>
93 const ThermoType& Foam::homogeneousMixture<ThermoType>::getLocalThermo
102 else if (specieI == 1)
110 "const ThermoType& Foam::homogeneousMixture<ThermoType>::"
115 ) << "Unknown specie index " << specieI << ". Valid indices are 0..1"
116 << abort(FatalError);
123 template<class ThermoType>
124 Foam::scalar Foam::homogeneousMixture<ThermoType>::nMoles
129 return getLocalThermo(specieI).nMoles();
133 template<class ThermoType>
134 Foam::scalar Foam::homogeneousMixture<ThermoType>::W
139 return getLocalThermo(specieI).W();
143 template<class ThermoType>
144 Foam::scalar Foam::homogeneousMixture<ThermoType>::Cp
150 return getLocalThermo(specieI).Cp(T);
154 template<class ThermoType>
155 Foam::scalar Foam::homogeneousMixture<ThermoType>::Cv
161 return getLocalThermo(specieI).Cv(T);
165 template<class ThermoType>
166 Foam::scalar Foam::homogeneousMixture<ThermoType>::H
172 return getLocalThermo(specieI).H(T);
176 template<class ThermoType>
177 Foam::scalar Foam::homogeneousMixture<ThermoType>::Hs
183 return getLocalThermo(specieI).Hs(T);
187 template<class ThermoType>
188 Foam::scalar Foam::homogeneousMixture<ThermoType>::Hc
193 return getLocalThermo(specieI).Hc();
197 template<class ThermoType>
198 Foam::scalar Foam::homogeneousMixture<ThermoType>::S
204 return getLocalThermo(specieI).S(T);
208 template<class ThermoType>
209 Foam::scalar Foam::homogeneousMixture<ThermoType>::E
215 return getLocalThermo(specieI).E(T);
219 template<class ThermoType>
220 Foam::scalar Foam::homogeneousMixture<ThermoType>::G
226 return getLocalThermo(specieI).G(T);
230 template<class ThermoType>
231 Foam::scalar Foam::homogeneousMixture<ThermoType>::A
237 return getLocalThermo(specieI).A(T);
241 template<class ThermoType>
242 Foam::scalar Foam::homogeneousMixture<ThermoType>::mu
248 return getLocalThermo(specieI).mu(T);
252 template<class ThermoType>
253 Foam::scalar Foam::homogeneousMixture<ThermoType>::kappa
259 return getLocalThermo(specieI).kappa(T);
263 template<class ThermoType>
264 Foam::scalar Foam::homogeneousMixture<ThermoType>::alpha
270 return getLocalThermo(specieI).alpha(T);
274 // ************************************************************************* //