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 templated on an equation of
35 \*---------------------------------------------------------------------------*/
37 #ifndef eConstThermo_H
38 #define eConstThermo_H
40 #include "specieThermo.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 // Forward declaration of friend functions and operators
49 template<class EquationOfState> class eConstThermo;
51 template<class EquationOfState>
52 inline eConstThermo<EquationOfState> operator+
54 const eConstThermo<EquationOfState>&,
55 const eConstThermo<EquationOfState>&
58 template<class EquationOfState>
59 inline eConstThermo<EquationOfState> operator-
61 const eConstThermo<EquationOfState>&,
62 const eConstThermo<EquationOfState>&
65 template<class EquationOfState>
66 inline eConstThermo<EquationOfState> operator*
69 const eConstThermo<EquationOfState>&
72 template<class EquationOfState>
73 inline eConstThermo<EquationOfState> operator==
75 const eConstThermo<EquationOfState>&,
76 const eConstThermo<EquationOfState>&
79 template<class EquationOfState>
83 const eConstThermo<EquationOfState>&
87 /*---------------------------------------------------------------------------*\
88 Class eConstThermo Declaration
89 \*---------------------------------------------------------------------------*/
91 template<class EquationOfState>
94 public EquationOfState
102 // Private Member Functions
104 //- Construct from components
107 const EquationOfState& st,
117 //- Construct from Istream
118 eConstThermo(Istream&);
120 //- Construct from dictionary
121 eConstThermo(const dictionary& dict);
123 //- Construct as named copy
124 inline eConstThermo(const word&, const eConstThermo&);
126 //- Construct and return a clone
127 inline autoPtr<eConstThermo> clone() const;
129 // Selector from Istream
130 inline static autoPtr<eConstThermo> New(Istream& is);
132 // Selector from dictionary
133 inline static autoPtr<eConstThermo> New(const dictionary& dict);
138 //- Limit the temperature to be in the range Tlow_ to Thigh_
139 inline scalar limit(const scalar T) const;
141 // Fundamental properties
143 //- Heat capacity at constant pressure [J/(kmol K)]
144 inline scalar cp(const scalar T) const;
146 //- Enthalpy [J/kmol]
147 inline scalar h(const scalar T) const;
149 //- Sensible Enthalpy [J/kmol]
150 inline scalar hs(const scalar T) const;
152 //- Chemical enthalpy [J/kmol]
153 inline scalar hc() const;
155 //- Entropy [J/(kmol K)]
156 inline scalar s(const scalar T) const;
162 void write(Ostream& os) const;
167 inline void operator+=(const eConstThermo&);
168 inline void operator-=(const eConstThermo&);
173 friend eConstThermo operator+ <EquationOfState>
179 friend eConstThermo operator- <EquationOfState>
185 friend eConstThermo operator* <EquationOfState>
191 friend eConstThermo operator== <EquationOfState>
198 // IOstream Operators
200 friend Ostream& operator<< <EquationOfState>
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 } // End namespace Foam
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 #include "eConstThermoI.H"
217 # include "eConstThermo.C"
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 // ************************************************************************* //