FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

hConstThermo.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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::hConstThermo
00026 
00027 Description
00028     Constant properties thermodynamics package
00029     templated into the equationOfState.
00030 
00031 SourceFiles
00032     hConstThermoI.H
00033     hConstThermo.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef hConstThermo_H
00038 #define hConstThermo_H
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 // Forward declaration of friend functions and operators
00046 
00047 template<class equationOfState> class hConstThermo;
00048 
00049 template<class equationOfState>
00050 inline hConstThermo<equationOfState> operator+
00051 (
00052     const hConstThermo<equationOfState>&,
00053     const hConstThermo<equationOfState>&
00054 );
00055 
00056 template<class equationOfState>
00057 inline hConstThermo<equationOfState> operator-
00058 (
00059     const hConstThermo<equationOfState>&,
00060     const hConstThermo<equationOfState>&
00061 );
00062 
00063 template<class equationOfState>
00064 inline hConstThermo<equationOfState> operator*
00065 (
00066     const scalar,
00067     const hConstThermo<equationOfState>&
00068 );
00069 
00070 template<class equationOfState>
00071 inline hConstThermo<equationOfState> operator==
00072 (
00073     const hConstThermo<equationOfState>&,
00074     const hConstThermo<equationOfState>&
00075 );
00076 
00077 template<class equationOfState>
00078 Ostream& operator<<
00079 (
00080     Ostream&,
00081     const hConstThermo<equationOfState>&
00082 );
00083 
00084 
00085 /*---------------------------------------------------------------------------*\
00086                            Class hConstThermo Declaration
00087 \*---------------------------------------------------------------------------*/
00088 
00089 template<class equationOfState>
00090 class hConstThermo
00091 :
00092     public equationOfState
00093 {
00094     // Private data
00095 
00096         scalar Cp_;
00097         scalar Hf_;
00098 
00099 
00100     // Private member functions
00101 
00102         //- Construct from components
00103         inline hConstThermo
00104         (
00105             const equationOfState& st,
00106             const scalar cp,
00107             const scalar hf
00108         );
00109 
00110 
00111 public:
00112 
00113     // Constructors
00114 
00115         //- Construct from Istream
00116         hConstThermo(Istream&);
00117 
00118         //- Construct as named copy
00119         inline hConstThermo(const word&, const hConstThermo&);
00120 
00121         //- Construct and return a clone
00122         inline autoPtr<hConstThermo> clone() const;
00123 
00124         //- Selector from Istream
00125         inline static autoPtr<hConstThermo> New(Istream& is);
00126 
00127 
00128     // Member Functions
00129 
00130         // Fundamaental properties
00131 
00132             //- Heat capacity at constant pressure [J/(kmol K)]
00133             inline scalar cp(const scalar T) const;
00134 
00135             //- Enthalpy [J/kmol]
00136             inline scalar h(const scalar T) const;
00137 
00138             //- Sensible enthalpy [J/kmol]
00139             inline scalar hs(const scalar T) const;
00140 
00141             //- Chemical enthalpy [J/kmol]
00142             inline scalar hc() const;
00143 
00144             //- Entropy [J/(kmol K)]
00145             inline scalar s(const scalar T) const;
00146 
00147 
00148     // Member operators
00149 
00150         inline void operator+=(const hConstThermo&);
00151         inline void operator-=(const hConstThermo&);
00152 
00153 
00154     // Friend operators
00155 
00156         friend hConstThermo operator+ <equationOfState>
00157         (
00158             const hConstThermo&,
00159             const hConstThermo&
00160         );
00161 
00162         friend hConstThermo operator- <equationOfState>
00163         (
00164             const hConstThermo&,
00165             const hConstThermo&
00166         );
00167 
00168         friend hConstThermo operator* <equationOfState>
00169         (
00170             const scalar,
00171             const hConstThermo&
00172         );
00173 
00174         friend hConstThermo operator== <equationOfState>
00175         (
00176             const hConstThermo&,
00177             const hConstThermo&
00178         );
00179 
00180 
00181     // IOstream Operators
00182 
00183         friend Ostream& operator<< <equationOfState>
00184         (
00185             Ostream&,
00186             const hConstThermo&
00187         );
00188 };
00189 
00190 
00191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00192 
00193 } // End namespace Foam
00194 
00195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00196 
00197 #include <specie/hConstThermoI.H>
00198 
00199 #ifdef NoRepository
00200 #   include <specie/hConstThermo.C>
00201 #endif
00202 
00203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00204 
00205 #endif
00206 
00207 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines