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

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-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::eConstThermo
00027 
00028 Description
00029     Constant properties thermodynamics package templated on an equation of
00030     state
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 friend functions and operators
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 template<class equationOfState>
00093 class eConstThermo
00094 :
00095     public equationOfState
00096 {
00097     // Private data
00098 
00099         scalar Cv_;
00100         scalar Hf_;
00101 
00102 
00103     // Private member functions
00104 
00105         //- Construct from components
00106         inline eConstThermo
00107         (
00108             const equationOfState& st,
00109             const scalar cv,
00110             const scalar hf
00111         );
00112 
00113 
00114 public:
00115 
00116     // Constructors
00117 
00118         //- Construct from Istream
00119         eConstThermo(Istream&);
00120 
00121         //- Construct as named copy
00122         inline eConstThermo(const word&, const eConstThermo&);
00123 
00124         //- Construct and return a clone
00125         inline autoPtr<eConstThermo> clone() const;
00126 
00127         // Selector from Istream
00128         inline static autoPtr<eConstThermo> New(Istream& is);
00129 
00130 
00131     // Member Functions
00132 
00133         // Fundamaental properties
00134 
00135             //- Heat capacity at constant pressure [J/(kmol K)]
00136             inline scalar cp(const scalar T) const;
00137 
00138             //- Enthalpy [J/kmol]
00139             inline scalar h(const scalar T) const;
00140 
00141             //- Sensible Enthalpy [J/kmol]
00142             inline scalar hs(const scalar T) const;
00143 
00144             //- Chemical enthalpy [J/kmol]
00145             inline scalar hc() const;
00146 
00147             //- Entropy [J/(kmol K)]
00148             inline scalar s(const scalar T) const;
00149 
00150 
00151     // Member operators
00152 
00153         inline void operator+=(const eConstThermo&);
00154         inline void operator-=(const eConstThermo&);
00155 
00156 
00157     // Friend operators
00158 
00159         friend eConstThermo operator+ <equationOfState>
00160         (
00161             const eConstThermo&,
00162             const eConstThermo&
00163         );
00164 
00165         friend eConstThermo operator- <equationOfState>
00166         (
00167             const eConstThermo&,
00168             const eConstThermo&
00169         );
00170 
00171         friend eConstThermo operator* <equationOfState>
00172         (
00173             const scalar,
00174             const eConstThermo&
00175         );
00176 
00177         friend eConstThermo operator== <equationOfState>
00178         (
00179             const eConstThermo&,
00180             const eConstThermo&
00181         );
00182 
00183 
00184     // IOstream Operators
00185 
00186         friend Ostream& operator<< <equationOfState>
00187         (
00188             Ostream&,
00189             const eConstThermo&
00190         );
00191 };
00192 
00193 
00194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00195 
00196 } // End namespace Foam
00197 
00198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00199 
00200 #include "eConstThermoI.H"
00201 
00202 #ifdef NoRepository
00203 #   include "eConstThermo.C"
00204 #endif
00205 
00206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00207 
00208 #endif
00209 
00210 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd