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