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

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