1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
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 "multiComponentSolidMixture.H"
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
30 template<class ThermoSolidType>
31 void Foam::multiComponentSolidMixture<ThermoSolidType>::correctMassFractions()
33 volScalarField Yt("Yt", Y_[0]);
35 for (label n=1; n<Y_.size(); n++)
49 template<class ThermoSolidType>
50 Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::X
52 label iComp, label celli, scalar T
58 rhoInv += Y_[i][celli]/solidData_[i].rho(T);
61 scalar X = Y_[iComp][celli]/solidData_[iComp].rho(T);
67 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
69 template<class ThermoSolidType>
70 Foam::multiComponentSolidMixture<ThermoSolidType>::multiComponentSolidMixture
72 const dictionary& thermoSolidDict,
78 thermoSolidDict.lookup("solidComponents"),
81 solidData_(components_.size())
84 forAll(components_, i)
91 thermoSolidDict.subDict(components_[i] + "Coeffs")
95 correctMassFractions();
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 template<class ThermoSolidType>
102 Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::rho
104 scalar T, label celli
108 forAll(solidData_, i)
110 tmp += solidData_[i].rho(T)*X(i, celli, T);
116 template<class ThermoSolidType>
117 Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::hf
123 forAll(solidData_, i)
125 tmp += solidData_[i].hf()*Y_[i][celli];
131 template<class ThermoSolidType>
132 Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::hs
134 scalar T, label celli
138 forAll(solidData_, i)
140 tmp += solidData_[i].hs(T)*Y_[i][celli];
146 template<class ThermoSolidType>
147 Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::h
149 scalar T, label celli
153 forAll(solidData_, i)
155 tmp += solidData_[i].h(T)*Y_[i][celli];
161 template<class ThermoSolidType>
162 Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::kappa
164 scalar T, label celli
168 forAll(solidData_, i)
170 tmp += solidData_[i].kappa(T)*X(i, celli, T);
176 template<class ThermoSolidType>
177 Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::sigmaS
179 scalar T, label celli
183 forAll(solidData_, i)
185 tmp += solidData_[i].sigmaS(T)*X(i, celli, T);
191 template<class ThermoSolidType>
192 Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::K
194 scalar T, label celli
198 forAll(solidData_, i)
200 tmp += solidData_[i].K(T)*X(i, celli, T);
206 template<class ThermoSolidType>
207 Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::emissivity
209 scalar T, label celli
213 forAll(solidData_, i)
215 tmp += solidData_[i].emissivity(T)*Y_[i][celli];
221 template<class ThermoSolidType>
222 Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::Cp
224 scalar T, label celli
228 forAll(solidData_, i)
230 tmp += solidData_[i].Cp(T)*Y_[i][celli];
236 template<class ThermoSolidType>
237 void Foam::multiComponentSolidMixture<ThermoSolidType>::read
239 const dictionary& thermoDict
242 forAll(components_, i)
245 ThermoSolidType(thermoDict.subDict(components_[i] + "Coeffs"));
250 // ************************************************************************* //