1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29 inline Foam::eConstThermo::eConstThermo
31 const specieThermo& st,
42 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 inline Foam::eConstThermo::eConstThermo
47 const eConstThermo& ct
50 specieThermo(name, ct),
56 template<class equationOfState>
57 inline Foam::autoPtr<eConstThermo<equationOfState> >
58 Foam::eConstThermo<equationOfState>::clone() const
60 return autoPtr<eConstThermo<equationOfState> >
62 new eConstThermo<equationOfState>(*this)
67 template<class equationOfState>
68 inline autoPtr<eConstThermo<equationOfState> >
69 Foam::eConstThermo<equationOfState>::New(Istream& is)
71 return autoPtr<eConstThermo<equationOfState> >
73 new eConstThermo<equationOfState>(is)
78 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
80 inline Foam::scalar Foam::eConstThermo::cp(const scalar) const
86 inline Foam::scalar Foam::eConstThermo::h(const scalar T) const
88 return cp(T)*T + Hf*W();
92 inline Foam::scalar Foam::eConstThermo::s(const scalar T) const
94 notImplemented("scalar eConstThermo::s(const scalar T) const");
99 inline Foam::scalar Foam::eConstThermo::TH
105 return (h - Hf)/Cp(T0);
109 inline Foam::scalar Foam::eConstThermo::TE
119 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
121 inline Foam::eConstThermo& Foam::eConstThermo::operator=
123 const eConstThermo& ct
126 specieThermo::operator=(ct);
135 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
137 inline Foam::eConstThermo Foam::operator+
139 const eConstThermo& ct1,
140 const eConstThermo& ct2
143 specieThermo st(((const specieThermo&)ct1) + ((const specieThermo&)ct2));
148 ct1.nMoles()/st.nMoles()*ct1.CV + ct2.nMoles()/st.nMoles()*ct2.CV,
149 ct1.nMoles()/st.nMoles()*ct1.Hf + ct2.nMoles()/st.nMoles()*ct2.Hf
154 inline Foam::eConstThermo Foam::operator-
156 const eConstThermo& ct1,
157 const eConstThermo& ct2
160 specieThermo st(((const specieThermo&)ct1) - ((const specieThermo&)ct2));
165 ct1.nMoles()/st.nMoles()*ct1.CV - ct2.nMoles()/st.nMoles()*ct2.CV,
166 ct1.nMoles()/st.nMoles()*ct1.Hf - ct2.nMoles()/st.nMoles()*ct2.Hf
171 inline Foam::eConstThermo Foam::operator*
174 const eConstThermo& ct
179 s*((const specieThermo&)ct),
186 inline Foam::eConstThermo Foam::operator==
188 const eConstThermo& ct1,
189 const eConstThermo& ct2
196 // ************************************************************************* //