OpenFOAM logo
Open Source CFD Toolkit

eConstThermo.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     eConstThermo
00027 
00028 Description
00029     Constant properties thermodynamics package derived from the basic
00030     thermo package data type specieThermo.
00031 
00032 SourceFiles
00033     eConstThermoI.H
00034     eConstThermo.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef eConstThermo_H
00039 #define eConstThermo_H
00040 
00041 #include "specieThermo.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 // * * * * * * Forward declaration of template friend fuctions * * * * * * * //
00049 
00050 template<class equationOfState> class eConstThermo;
00051 
00052 template<class equationOfState>
00053 inline eConstThermo<equationOfState> operator+
00054 (
00055     const eConstThermo<equationOfState>&,
00056     const eConstThermo<equationOfState>&
00057 );
00058 
00059 template<class equationOfState>
00060 inline eConstThermo<equationOfState> operator-
00061 (
00062     const eConstThermo<equationOfState>&,
00063     const eConstThermo<equationOfState>&
00064 );
00065 
00066 template<class equationOfState>
00067 inline eConstThermo<equationOfState> operator*
00068 (
00069     const scalar,
00070     const eConstThermo<equationOfState>&
00071 );
00072 
00073 template<class equationOfState>
00074 inline eConstThermo<equationOfState> operator==
00075 (
00076     const eConstThermo<equationOfState>&,
00077     const eConstThermo<equationOfState>&
00078 );
00079 
00080 template<class equationOfState>
00081 Ostream& operator<<
00082 (
00083     Ostream&,
00084     const eConstThermo<equationOfState>&
00085 );
00086 
00087 
00088 /*---------------------------------------------------------------------------*\
00089                            Class eConstThermo Declaration
00090 \*---------------------------------------------------------------------------*/
00091 
00092 class eConstThermo
00093 :
00094     public specieThermo
00095 {
00096     // Private data
00097 
00098         scalar CV;
00099         scalar Hf;
00100 
00101 
00102     // Private member functions
00103 
00104         //- construct from components
00105         inline eConstThermo
00106         (
00107             const specieThermo& st,
00108             const scalar cv,
00109             const scalar hf
00110         );
00111 
00112 public:
00113 
00114     // Constructors
00115 
00116         //- Construct from Istream
00117         eConstThermo(Istream&);
00118 
00119         //- Construct as named copy
00120         inline eConstThermo(const word&, const eConstThermo&);
00121 
00122         //- Construct and return a clone
00123         inline autoPtr<eConstThermo> clone() const;
00124 
00125         // Selector from Istream
00126         inline static autoPtr<eConstThermo> New(Istream& is);
00127 
00128 
00129     // Member Functions
00130 
00131         // fundamaental properties
00132 
00133             //- Heat capacity at constant pressure [J/(kmol K)]
00134             inline scalar cp(const scalar T) const;
00135 
00136             //- Enthalpy [J/kmol]
00137             inline scalar h(const scalar T) const;
00138 
00139             //- Entropy [J/(kmol K)]
00140             inline scalar s(const scalar T) const;
00141 
00142 
00143         // Some derived properties
00144         // Other derived properties obtained from specieThermo base type
00145 
00146             //- Temperature from Enthalpy given an initial temperature T0
00147             inline scalar TH(const scalar h, const scalar T0) const;
00148 
00149             //- Temperature from internal energy given an initial temperature T0
00150             inline scalar TE(const scalar e, const scalar T0) const;
00151 
00152 
00153     // Member operators
00154 
00155         inline eConstThermo& operator=
00156         (
00157             const eConstThermo&
00158         );
00159 
00160 
00161     // Friend operators
00162 
00163         friend eConstThermo operator+ <equationOfState>
00164         (
00165             const eConstThermo&,
00166             const eConstThermo&
00167         );
00168 
00169         friend eConstThermo operator- <equationOfState>
00170         (
00171             const eConstThermo&,
00172             const eConstThermo&
00173         );
00174 
00175         friend eConstThermo operator* <equationOfState>
00176         (
00177             const scalar,
00178             const eConstThermo&
00179         );
00180 
00181         friend eConstThermo operator== <equationOfState>
00182         (
00183             const eConstThermo&,
00184             const eConstThermo&
00185         );
00186 
00187 
00188     // IOstream Operators
00189 
00190         friend Ostream& operator<< <equationOfState>
00191         (
00192             Ostream&, const eConstThermo&
00193         );
00194 };
00195 
00196 
00197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00198 
00199 } // End namespace Foam
00200 
00201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00202 
00203 #include "eConstThermoI.H"
00204 
00205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00206 
00207 #endif
00208 
00209 // ************************************************************************* //
For further information go to www.openfoam.org