1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "solidMixture.H"
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 // Construct from components
32 Foam::solidMixture::solidMixture
34 const dictionary& thermophysicalProperties
37 components_(thermophysicalProperties.lookup("solidComponents")),
38 properties_(components_.size())
41 forAll(components_, i)
46 solid::New(thermophysicalProperties.lookup(components_[i]))
52 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
54 Foam::autoPtr<Foam::solidMixture> Foam::solidMixture::New
56 const dictionary& thermophysicalProperties
59 return autoPtr<solidMixture>(new solidMixture(thermophysicalProperties));
63 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
65 Foam::scalarField Foam::solidMixture::X
70 scalarField X(Y.size());
74 rhoInv += Y[i]/properties_[i].rho();
75 X[i] = Y[i]/properties_[i].rho();
82 Foam::scalar Foam::solidMixture::rho
88 forAll(properties_, i)
90 tmp += properties_[i].rho()*X[i];
96 Foam::scalar Foam::solidMixture::cp
102 forAll(properties_, i)
104 tmp += properties_[i].cp()*Y[i];
110 // ************************************************************************* //