OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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     Foam::hConstThermo
00027 
00028 Description
00029     Constant properties thermodynamics package
00030     templated into the equationOfState.
00031 
00032 SourceFiles
00033     hConstThermoI.H
00034     hConstThermo.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef hConstThermo_H
00039 #define hConstThermo_H
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 // Forward declaration of friend functions and operators
00047 
00048 template<class equationOfState> class hConstThermo;
00049 
00050 template<class equationOfState>
00051 inline hConstThermo<equationOfState> operator+
00052 (
00053     const hConstThermo<equationOfState>&,
00054     const hConstThermo<equationOfState>&
00055 );
00056 
00057 template<class equationOfState>
00058 inline hConstThermo<equationOfState> operator-
00059 (
00060     const hConstThermo<equationOfState>&,
00061     const hConstThermo<equationOfState>&
00062 );
00063 
00064 template<class equationOfState>
00065 inline hConstThermo<equationOfState> operator*
00066 (
00067     const scalar,
00068     const hConstThermo<equationOfState>&
00069 );
00070 
00071 template<class equationOfState>
00072 inline hConstThermo<equationOfState> operator==
00073 (
00074     const hConstThermo<equationOfState>&,
00075     const hConstThermo<equationOfState>&
00076 );
00077 
00078 template<class equationOfState>
00079 Ostream& operator<<
00080 (
00081     Ostream&,
00082     const hConstThermo<equationOfState>&
00083 );
00084 
00085 
00086 /*---------------------------------------------------------------------------*\
00087                            Class hConstThermo Declaration
00088 \*---------------------------------------------------------------------------*/
00089 
00090 template<class equationOfState>
00091 class hConstThermo
00092 :
00093     public equationOfState
00094 {
00095     // Private data
00096 
00097         scalar Cp_;
00098         scalar Hf_;
00099 
00100 
00101     // Private member functions
00102 
00103         //- Construct from components
00104         inline hConstThermo
00105         (
00106             const equationOfState& st,
00107             const scalar cp,
00108             const scalar hf
00109         );
00110 
00111 
00112 public:
00113 
00114     // Constructors
00115 
00116         //- Construct from Istream
00117         hConstThermo(Istream&);
00118 
00119         //- Construct as named copy
00120         inline hConstThermo(const word&, const hConstThermo&);
00121 
00122         //- Construct and return a clone
00123         inline autoPtr<hConstThermo> clone() const;
00124 
00125         //- Selector from Istream
00126         inline static autoPtr<hConstThermo> 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             //- Sensible enthalpy [J/kmol]
00140             inline scalar hs(const scalar T) const;
00141 
00142             //- Chemical enthalpy [J/kmol]
00143             inline scalar hc() const;
00144 
00145             //- Entropy [J/(kmol K)]
00146             inline scalar s(const scalar T) const;
00147 
00148 
00149     // Member operators
00150 
00151         inline void operator+=(const hConstThermo&);
00152         inline void operator-=(const hConstThermo&);
00153 
00154 
00155     // Friend operators
00156 
00157         friend hConstThermo operator+ <equationOfState>
00158         (
00159             const hConstThermo&,
00160             const hConstThermo&
00161         );
00162 
00163         friend hConstThermo operator- <equationOfState>
00164         (
00165             const hConstThermo&,
00166             const hConstThermo&
00167         );
00168 
00169         friend hConstThermo operator* <equationOfState>
00170         (
00171             const scalar,
00172             const hConstThermo&
00173         );
00174 
00175         friend hConstThermo operator== <equationOfState>
00176         (
00177             const hConstThermo&,
00178             const hConstThermo&
00179         );
00180 
00181 
00182     // IOstream Operators
00183 
00184         friend Ostream& operator<< <equationOfState>
00185         (
00186             Ostream&,
00187             const hConstThermo&
00188         );
00189 };
00190 
00191 
00192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00193 
00194 } // End namespace Foam
00195 
00196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00197 
00198 #include "hConstThermoI.H"
00199 
00200 #ifdef NoRepository
00201 #   include "hConstThermo.C"
00202 #endif
00203 
00204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00205 
00206 #endif
00207 
00208 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd