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
29 Constant properties thermodynamics package derived from the basic
30 thermo package data type specieThermo.
36 \*---------------------------------------------------------------------------*/
38 #ifndef eConstThermo_H
39 #define eConstThermo_H
41 #include "specieThermo.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // Forward declaration of friend functions and operators
50 template<class equationOfState> class eConstThermo;
52 template<class equationOfState>
53 inline eConstThermo<equationOfState> operator+
55 const eConstThermo<equationOfState>&,
56 const eConstThermo<equationOfState>&
59 template<class equationOfState>
60 inline eConstThermo<equationOfState> operator-
62 const eConstThermo<equationOfState>&,
63 const eConstThermo<equationOfState>&
66 template<class equationOfState>
67 inline eConstThermo<equationOfState> operator*
70 const eConstThermo<equationOfState>&
73 template<class equationOfState>
74 inline eConstThermo<equationOfState> operator==
76 const eConstThermo<equationOfState>&,
77 const eConstThermo<equationOfState>&
80 template<class equationOfState>
84 const eConstThermo<equationOfState>&
88 /*---------------------------------------------------------------------------*\
89 Class eConstThermo Declaration
90 \*---------------------------------------------------------------------------*/
102 // Private member functions
104 //- construct from components
107 const specieThermo& st,
116 //- Construct from Istream
117 eConstThermo(Istream&);
119 //- Construct as named copy
120 inline eConstThermo(const word&, const eConstThermo&);
122 //- Construct and return a clone
123 inline autoPtr<eConstThermo> clone() const;
125 // Selector from Istream
126 inline static autoPtr<eConstThermo> New(Istream& is);
131 // Fundamaental properties
133 //- Heat capacity at constant pressure [J/(kmol K)]
134 inline scalar cp(const scalar T) const;
136 //- Enthalpy [J/kmol]
137 inline scalar h(const scalar T) const;
139 //- Entropy [J/(kmol K)]
140 inline scalar s(const scalar T) const;
143 // Some derived properties
144 // Other derived properties obtained from specieThermo base type
146 //- Temperature from Enthalpy given an initial temperature T0
147 inline scalar TH(const scalar h, const scalar T0) const;
149 //- Temperature from internal energy given an initial temperature T0
150 inline scalar TE(const scalar e, const scalar T0) const;
155 inline void operator+=(const hConstThermo&);
156 inline void operator-=(const hConstThermo&);
161 friend eConstThermo operator+ <equationOfState>
167 friend eConstThermo operator- <equationOfState>
173 friend eConstThermo operator* <equationOfState>
179 friend eConstThermo operator== <equationOfState>
186 // IOstream Operators
188 friend Ostream& operator<< <equationOfState>
190 Ostream&, const eConstThermo&
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 } // End namespace Foam
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 #include "eConstThermoI.H"
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 // ************************************************************************* //