00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00027 #ifndef OPM_MESITYLENE_HPP
00028 #define OPM_MESITYLENE_HPP
00029
00030 #include <opm/material/IdealGas.hpp>
00031 #include <opm/material/components/Component.hpp>
00032 #include <opm/material/Constants.hpp>
00033
00034 #include <opm/material/common/MathToolbox.hpp>
00035
00036 namespace Opm {
00043 template <class Scalar>
00044 class Mesitylene : public Component<Scalar, Mesitylene<Scalar> >
00045 {
00046 typedef Opm::Constants<Scalar> Consts;
00047
00048 public:
00052 static const char* name()
00053 { return "mesitylene"; }
00054
00058 static Scalar molarMass()
00059 { return 0.120; }
00060
00064 static Scalar criticalTemperature()
00065 { return 637.3; }
00066
00070 static Scalar criticalPressure()
00071 { return 31.3e5; }
00072
00076 static Scalar boilingTemperature()
00077 { return 437.9; }
00078
00082 static Scalar tripleTemperature()
00083 { OPM_THROW(std::runtime_error, "Not implemented: tripleTemperature for mesitylene"); }
00084
00088 static Scalar triplePressure()
00089 { OPM_THROW(std::runtime_error, "Not implemented: triplePressure for mesitylene"); }
00090
00098 template <class Evaluation>
00099 static Evaluation vaporPressure(const Evaluation& temperature)
00100 {
00101 const Scalar A = 7.07638;
00102 const Scalar B = 1571.005;
00103 const Scalar C = 209.728;
00104
00105 const Evaluation& T = temperature - 273.15;
00106
00107 return 100 * 1.334 * Opm::pow(10.0, A - (B / (T + C)));
00108 }
00109
00110
00117 template <class Evaluation>
00118 static Evaluation liquidEnthalpy(const Evaluation& temperature, const Evaluation& pressure)
00119 {
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 return 0.5*temperature*(liquidHeatCapacity(Evaluation(0.2113*temperature), pressure)
00132 + liquidHeatCapacity(Evaluation(0.7887*temperature), pressure));
00133 }
00134
00143 template <class Evaluation>
00144 static Evaluation heatVap(const Evaluation& temperature, const Evaluation& )
00145 {
00146 Evaluation T = Opm::min(temperature, criticalTemperature());
00147 T = Opm::max(T, 0.0);
00148
00149 const Scalar T_crit = criticalTemperature();
00150 const Scalar Tr1 = boilingTemperature()/criticalTemperature();
00151 const Scalar p_crit = criticalPressure();
00152
00153
00154 const Scalar DH_v_boil =
00155 Consts::R * T_crit * Tr1
00156 * (3.978 * Tr1 - 3.958 + 1.555*std::log(p_crit * 1e-5 ) )
00157 / (1.07 - Tr1);
00158
00159
00160 const Evaluation& Tr2 = T/criticalTemperature();
00161 const Scalar n = 0.375;
00162 const Evaluation& DH_vap = DH_v_boil * Opm::pow(((1.0 - Tr2)/(1.0 - Tr1)), n);
00163
00164 return (DH_vap/molarMass());
00165 }
00166
00167
00177 template <class Evaluation>
00178 static Evaluation gasEnthalpy(const Evaluation& temperature, const Evaluation& pressure)
00179 {
00180 return liquidEnthalpy(temperature,pressure) + heatVap(temperature, pressure);
00181 }
00182
00189 template <class Evaluation>
00190 static Evaluation gasDensity(const Evaluation& temperature, const Evaluation& pressure)
00191 { return IdealGas<Scalar>::density(Evaluation(molarMass()), temperature, pressure); }
00192
00199 template <class Evaluation>
00200 static Evaluation liquidDensity(const Evaluation& temperature, const Evaluation& )
00201 { return molarLiquidDensity_(temperature)*molarMass(); }
00202
00206 static bool gasIsCompressible()
00207 { return true; }
00208
00212 static bool gasIsIdeal()
00213 { return true; }
00214
00218 static bool liquidIsCompressible()
00219 { return false; }
00220
00228 template <class Evaluation>
00229 static Evaluation gasViscosity(Evaluation temperature, const Evaluation& , bool =true)
00230 {
00231 temperature = Opm::min(temperature, 500.0);
00232 temperature = Opm::max(temperature, 250.0);
00233
00234
00235 const Evaluation& Tr = temperature/criticalTemperature();
00236
00237 Scalar Fp0 = 1.0;
00238 Scalar xi = 0.00474;
00239 const Evaluation& eta_xi =
00240 Fp0*(0.807*Opm::pow(Tr,0.618)
00241 - 0.357*Opm::exp(-0.449*Tr)
00242 + 0.34*Opm::exp(-4.058*Tr)
00243 + 0.018);
00244
00245 return eta_xi/xi/1e7;
00246 }
00247
00254 template <class Evaluation>
00255 static Evaluation liquidViscosity(Evaluation temperature, const Evaluation& )
00256 {
00257 temperature = Opm::min(temperature, 500.0);
00258 temperature = Opm::max(temperature, 250.0);
00259
00260 const Scalar A = -6.749;
00261 const Scalar B = 2010.0;
00262
00263 return Opm::exp(A + B/temperature)*1e-3;
00264 }
00265
00275 template <class Evaluation>
00276 static Evaluation liquidHeatCapacity(const Evaluation& temperature,
00277 const Evaluation& )
00278 {
00279
00280
00281
00282 Evaluation H, CH3, C6H5;
00283 if(temperature<298.) {
00284
00285 H = 13.4 + 1.2*(temperature-273.0)/25.;
00286 CH3 = 40.0 + 1.6*(temperature-273.0)/25.;
00287 C6H5 = 113.0 + 4.2*(temperature-273.0)/25.;
00288 }
00289 else if((temperature>=298.0)&&(temperature<323.)){
00290 H = 14.6 + 0.9*(temperature-298.0)/25.;
00291 CH3 = 41.6 + 1.9*(temperature-298.0)/25.;
00292 C6H5 = 117.2 + 6.2*(temperature-298.0)/25.;
00293 }
00294 else if((temperature>=323.0)&&(temperature<348.)){
00295 H = 15.5 + 1.2*(temperature-323.0)/25.;
00296 CH3 = 43.5 + 2.3*(temperature-323.0)/25.;
00297 C6H5 = 123.4 + 6.3*(temperature-323.0)/25.;
00298 }
00299 else {
00300 assert(temperature>=348.0);
00301
00302
00303 H = 16.7+2.1*(temperature-348.0)/25.;
00304 CH3 = 45.8+2.5*(temperature-348.0)/25.;
00305 C6H5 = 129.7+6.3*(temperature-348.0)/25.;
00306 }
00307
00308 return (C6H5 + 3*CH3 - 2*H)/molarMass();
00309 }
00310
00311 protected:
00320 template <class Evaluation>
00321 static Evaluation molarLiquidDensity_(Evaluation temperature)
00322 {
00323 temperature = Opm::min(temperature, 500.0);
00324 temperature = Opm::max(temperature, 250.0);
00325
00326 const Scalar Z_RA = 0.2556;
00327 const Evaluation& expo = 1.0 + Opm::pow(1.0 - temperature/criticalTemperature(), 2.0/7.0);
00328 const Evaluation& V = Consts::R*criticalTemperature()/criticalPressure()*Opm::pow(Z_RA, expo);
00329
00330 return 1.0/V;
00331 }
00332
00333 };
00334
00335 }
00336
00337 #endif