OpenFOAM logo
Open Source CFD Toolkit

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-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     hConstThermo
00027 
00028 Description
00029     Constant properties thermodynamics package
00030     templated ito 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 template friend fuctions * * * * * * * //
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 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             //- Entropy [J/(kmol K)]
00139             inline scalar s(const scalar T) const;
00140 
00141 
00142     // Member operators
00143 
00144         inline hConstThermo& operator=
00145         (
00146             const hConstThermo&
00147         );
00148 
00149 
00150     // Friend operators
00151 
00152         friend hConstThermo operator+ <equationOfState>
00153         (
00154             const hConstThermo&,
00155             const hConstThermo&
00156         );
00157 
00158         friend hConstThermo operator- <equationOfState>
00159         (
00160             const hConstThermo&,
00161             const hConstThermo&
00162         );
00163 
00164         friend hConstThermo operator* <equationOfState>
00165         (
00166             const scalar,
00167             const hConstThermo&
00168         );
00169 
00170         friend hConstThermo operator== <equationOfState>
00171         (
00172             const hConstThermo&,
00173             const hConstThermo&
00174         );
00175 
00176 
00177     // IOstream Operators
00178 
00179         friend Ostream& operator<< <equationOfState>
00180         (
00181             Ostream&,
00182             const hConstThermo&
00183         );
00184 };
00185 
00186 
00187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00188 
00189 } // End namespace Foam
00190 
00191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00192 
00193 #include "hConstThermoI.H"
00194 
00195 #ifdef NoRepository
00196 #   include "hConstThermo.C"
00197 #endif
00198 
00199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00200 
00201 #endif
00202 
00203 // ************************************************************************* //
For further information go to www.openfoam.org