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::perfectGas 00026 00027 Description 00028 Perfect gas equation of state. 00029 00030 SourceFiles 00031 perfectGasI.H 00032 perfectGas.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef perfectGas_H 00037 #define perfectGas_H 00038 00039 #include <specie/specie.H> 00040 #include <OpenFOAM/autoPtr.H> 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 /*---------------------------------------------------------------------------*\ 00048 Class perfectGas Declaration 00049 \*---------------------------------------------------------------------------*/ 00050 00051 class perfectGas 00052 : 00053 public specie 00054 { 00055 00056 public: 00057 00058 // Constructors 00059 00060 //- Construct from components 00061 inline perfectGas(const specie& sp); 00062 00063 //- Construct from Istream 00064 perfectGas(Istream&); 00065 00066 //- Construct as named copy 00067 inline perfectGas(const word& name, const perfectGas&); 00068 00069 //- Construct and return a clone 00070 inline autoPtr<perfectGas> clone() const; 00071 00072 // Selector from Istream 00073 inline static autoPtr<perfectGas> New(Istream& is); 00074 00075 00076 // Member functions 00077 00078 //- Return density [kg/m^3] 00079 inline scalar rho(scalar p, scalar T) const; 00080 00081 //- Return compressibility rho/p [s^2/m^2] 00082 inline scalar psi(scalar p, scalar T) const; 00083 00084 //- Return compression factor [] 00085 inline scalar Z(scalar p, scalar T) const; 00086 00087 00088 // Member operators 00089 00090 inline void operator+=(const perfectGas&); 00091 inline void operator-=(const perfectGas&); 00092 00093 inline void operator*=(const scalar); 00094 00095 00096 // Friend operators 00097 00098 inline friend perfectGas operator+ 00099 ( 00100 const perfectGas&, 00101 const perfectGas& 00102 ); 00103 00104 inline friend perfectGas operator- 00105 ( 00106 const perfectGas&, 00107 const perfectGas& 00108 ); 00109 00110 inline friend perfectGas operator* 00111 ( 00112 const scalar s, 00113 const perfectGas& 00114 ); 00115 00116 inline friend perfectGas operator== 00117 ( 00118 const perfectGas&, 00119 const perfectGas& 00120 ); 00121 00122 00123 // Ostream Operator 00124 00125 friend Ostream& operator<<(Ostream&, const perfectGas&); 00126 }; 00127 00128 00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00130 00131 } // End namespace Foam 00132 00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00134 00135 #include <specie/perfectGasI.H> 00136 00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00138 00139 #endif 00140 00141 // ************************ vim: set sw=4 sts=4 et: ************************ //