00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "perfectGas.H"
00031
00032
00033
00034 namespace Foam
00035 {
00036
00037
00038
00039
00040 inline perfectGas::perfectGas
00041 (
00042 const specie& sp
00043 )
00044 :
00045 specie(sp)
00046 {}
00047
00048
00049
00050
00051
00052 inline perfectGas::perfectGas(const word& name, const perfectGas& pg)
00053 :
00054 specie(name, pg)
00055 {}
00056
00057
00058
00059 inline autoPtr<perfectGas> perfectGas::clone() const
00060 {
00061 return autoPtr<perfectGas>(new perfectGas(*this));
00062 }
00063
00064
00065
00066 inline autoPtr<perfectGas> perfectGas::New(Istream& is)
00067 {
00068 return autoPtr<perfectGas>(new perfectGas(is));
00069 }
00070
00071
00072
00073
00074
00075 inline scalar perfectGas::rho(scalar p, scalar T) const
00076 {
00077 return p/(R()*T);
00078 }
00079
00080
00081 inline scalar perfectGas::psi(scalar, scalar T) const
00082 {
00083 return 1.0/(R()*T);
00084 }
00085
00086
00087 inline scalar perfectGas::Z(scalar, scalar) const
00088 {
00089 return 1.0;
00090 }
00091
00092
00093
00094
00095 inline void perfectGas::operator+=(const perfectGas& pg)
00096 {
00097 specie::operator+=(pg);
00098 }
00099
00100 inline void perfectGas::operator-=(const perfectGas& pg)
00101 {
00102 specie::operator-=(pg);
00103 }
00104
00105 inline void perfectGas::operator*=(const scalar s)
00106 {
00107 specie::operator*=(s);
00108 }
00109
00110
00111
00112
00113 inline perfectGas operator+
00114 (
00115 const perfectGas& pg1,
00116 const perfectGas& pg2
00117 )
00118 {
00119 return perfectGas
00120 (
00121 static_cast<const specie&>(pg1)
00122 + static_cast<const specie&>(pg2)
00123 );
00124 }
00125
00126
00127 inline perfectGas operator-
00128 (
00129 const perfectGas& pg1,
00130 const perfectGas& pg2
00131 )
00132 {
00133 return perfectGas
00134 (
00135 static_cast<const specie&>(pg1)
00136 - static_cast<const specie&>(pg2)
00137 );
00138 }
00139
00140
00141 inline perfectGas operator*
00142 (
00143 const scalar s,
00144 const perfectGas& pg
00145 )
00146 {
00147 return perfectGas(s*static_cast<const specie&>(pg));
00148 }
00149
00150
00151 inline perfectGas operator==
00152 (
00153 const perfectGas& pg1,
00154 const perfectGas& pg2
00155 )
00156 {
00157 return pg2 - pg1;
00158 }
00159
00160
00161
00162
00163 }
00164
00165