initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / thermophysicalModels / specie / thermo / eConst / eConstThermo.H
blobfa8e6249460f11cb82527ddaa69f34b4aa53cd07
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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 Class
26     Foam::eConstThermo
28 Description
29     Constant properties thermodynamics package derived from the basic
30     thermo package data type specieThermo.
32 SourceFiles
33     eConstThermoI.H
34     eConstThermo.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef eConstThermo_H
39 #define eConstThermo_H
41 #include "specieThermo.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
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*
69     const scalar,
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>
81 Ostream& operator<<
83     Ostream&,
84     const eConstThermo<equationOfState>&
88 /*---------------------------------------------------------------------------*\
89                            Class eConstThermo Declaration
90 \*---------------------------------------------------------------------------*/
92 class eConstThermo
94     public specieThermo
96     // Private data
98         scalar CV;
99         scalar Hf;
102     // Private member functions
104         //- construct from components
105         inline eConstThermo
106         (
107             const specieThermo& st,
108             const scalar cv,
109             const scalar hf
110         );
112 public:
114     // Constructors
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);
129     // Member Functions
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;
153     // Member operators
155         inline void operator+=(const hConstThermo&);
156         inline void operator-=(const hConstThermo&);
159     // Friend operators
161         friend eConstThermo operator+ <equationOfState>
162         (
163             const eConstThermo&,
164             const eConstThermo&
165         );
167         friend eConstThermo operator- <equationOfState>
168         (
169             const eConstThermo&,
170             const eConstThermo&
171         );
173         friend eConstThermo operator* <equationOfState>
174         (
175             const scalar,
176             const eConstThermo&
177         );
179         friend eConstThermo operator== <equationOfState>
180         (
181             const eConstThermo&,
182             const eConstThermo&
183         );
186     // IOstream Operators
188         friend Ostream& operator<< <equationOfState>
189         (
190             Ostream&, const eConstThermo&
191         );
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 } // End namespace Foam
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 #include "eConstThermoI.H"
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 #endif
207 // ************************************************************************* //