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/>.
28 Constant properties thermodynamics package
29 templated into the equationOfState.
35 \*---------------------------------------------------------------------------*/
37 #ifndef hConstThermo_H
38 #define hConstThermo_H
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 // Forward declaration of friend functions and operators
47 template<class equationOfState> class hConstThermo;
49 template<class equationOfState>
50 inline hConstThermo<equationOfState> operator+
52 const hConstThermo<equationOfState>&,
53 const hConstThermo<equationOfState>&
56 template<class equationOfState>
57 inline hConstThermo<equationOfState> operator-
59 const hConstThermo<equationOfState>&,
60 const hConstThermo<equationOfState>&
63 template<class equationOfState>
64 inline hConstThermo<equationOfState> operator*
67 const hConstThermo<equationOfState>&
70 template<class equationOfState>
71 inline hConstThermo<equationOfState> operator==
73 const hConstThermo<equationOfState>&,
74 const hConstThermo<equationOfState>&
77 template<class equationOfState>
81 const hConstThermo<equationOfState>&
85 /*---------------------------------------------------------------------------*\
86 Class hConstThermo Declaration
87 \*---------------------------------------------------------------------------*/
89 template<class equationOfState>
92 public equationOfState
100 // Private Member Functions
102 //- Construct from components
105 const equationOfState& st,
115 //- Construct from Istream
116 hConstThermo(Istream&);
118 //- Construct from dictionary
119 hConstThermo(const dictionary& dict);
121 //- Construct as named copy
122 inline hConstThermo(const word&, const hConstThermo&);
124 //- Construct and return a clone
125 inline autoPtr<hConstThermo> clone() const;
127 //- Selector from Istream
128 inline static autoPtr<hConstThermo> New(Istream& is);
130 //- Selector from dictionary
131 inline static autoPtr<hConstThermo> New(const dictionary& dict);
136 //- Limit the temperature to be in the range Tlow_ to Thigh_
137 inline scalar limit(const scalar T) const;
139 // Fundamental properties
141 //- Heat capacity at constant pressure [J/(kmol K)]
142 inline scalar cp(const scalar T) const;
144 //- Enthalpy [J/kmol]
145 inline scalar h(const scalar T) const;
147 //- Sensible enthalpy [J/kmol]
148 inline scalar hs(const scalar T) const;
150 //- Chemical enthalpy [J/kmol]
151 inline scalar hc() const;
153 //- Entropy [J/(kmol K)]
154 inline scalar s(const scalar T) const;
160 void write(Ostream& os) const;
165 inline void operator+=(const hConstThermo&);
166 inline void operator-=(const hConstThermo&);
171 friend hConstThermo operator+ <equationOfState>
177 friend hConstThermo operator- <equationOfState>
183 friend hConstThermo operator* <equationOfState>
189 friend hConstThermo operator== <equationOfState>
196 // IOstream Operators
198 friend Ostream& operator<< <equationOfState>
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 } // End namespace Foam
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 #include "hConstThermoI.H"
215 # include "hConstThermo.C"
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 // ************************************************************************* //