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_SIMPLE_H2O_HPP
00028 #define OPM_SIMPLE_H2O_HPP
00029
00030 #include <opm/material/IdealGas.hpp>
00031 #include <opm/material/common/MathToolbox.hpp>
00032
00033 #include "Component.hpp"
00034
00035 #include <cmath>
00036
00037 namespace Opm {
00038
00053 template <class Scalar>
00054 class SimpleH2O : public Component<Scalar, SimpleH2O<Scalar> >
00055 {
00056 typedef Opm::IdealGas<Scalar> IdealGas;
00057
00058 static const Scalar R;
00059
00060 public:
00064 static const char* name()
00065 { return "H2O"; }
00066
00070 static bool gasIsCompressible()
00071 { return true; }
00072
00076 static bool liquidIsCompressible()
00077 { return false; }
00078
00082 static bool gasIsIdeal()
00083 { return true; }
00084
00088 static Scalar molarMass()
00089 { return 18e-3; }
00090
00094 static Scalar criticalTemperature()
00095 { return 647.096; }
00096
00100 static Scalar criticalPressure()
00101 { return 22.064e6; }
00102
00106 static Scalar tripleTemperature()
00107 { return 273.16; }
00108
00112 static Scalar triplePressure()
00113 { return 611.657; }
00114
00127 template <class Evaluation>
00128 static Evaluation vaporPressure(const Evaluation& T)
00129 {
00130 if (T > criticalTemperature())
00131 return criticalPressure();
00132 if (T < tripleTemperature())
00133 return 0;
00134
00135 static const Scalar n[10] = {
00136 0.11670521452767e4, -0.72421316703206e6, -0.17073846940092e2,
00137 0.12020824702470e5, -0.32325550322333e7, 0.14915108613530e2,
00138 -0.48232657361591e4, 0.40511340542057e6, -0.23855557567849,
00139 0.65017534844798e3
00140 };
00141
00142 Evaluation sigma = T + n[8]/(T - n[9]);
00143
00144 Evaluation A = (sigma + n[0])*sigma + n[1];
00145 Evaluation B = (n[2]*sigma + n[3])*sigma + n[4];
00146 Evaluation C = (n[5]*sigma + n[6])*sigma + n[7];
00147
00148 Evaluation tmp = 2.0*C/(Opm::sqrt(B*B - 4.0*A*C) - B);
00149 tmp *= tmp;
00150 tmp *= tmp;
00151
00152 return 1e6*tmp;
00153 }
00154
00161 template <class Evaluation>
00162 static Evaluation gasEnthalpy(const Evaluation& temperature,
00163 const Evaluation& )
00164 { return 1976*(temperature - 293.15) + 2.45e6; }
00165
00172 template <class Evaluation>
00173 static Evaluation liquidEnthalpy(const Evaluation& temperature,
00174 const Evaluation& )
00175 { return 4180*(temperature - 293.15); }
00176
00190 template <class Evaluation>
00191 static Evaluation gasInternalEnergy(const Evaluation& temperature,
00192 const Evaluation& pressure)
00193 {
00194 return
00195 gasEnthalpy(temperature, pressure) -
00196 1/molarMass()*
00197 IdealGas::R*temperature;
00198 }
00199
00206 template <class Evaluation>
00207 static Evaluation liquidInternalEnergy(const Evaluation& temperature,
00208 const Evaluation& pressure)
00209 {
00210 return
00211 liquidEnthalpy(temperature, pressure) -
00212 pressure/liquidDensity(temperature, pressure);
00213 }
00214
00221 template <class Evaluation>
00222 static Evaluation liquidThermalConductivity(const Evaluation& ,
00223 const Evaluation& )
00224 {
00225 return 0.578078;
00226 }
00227
00234 template <class Evaluation>
00235 static Evaluation gasThermalConductivity(const Evaluation& ,
00236 const Evaluation& )
00237 {
00238 return 0.028224;
00239 }
00240
00247 template <class Evaluation>
00248 static Evaluation gasDensity(const Evaluation& temperature, const Evaluation& pressure)
00249 {
00250
00251 return molarMass()*IdealGas::molarDensity(temperature, pressure);
00252 }
00253
00260 template <class Evaluation>
00261 static Evaluation gasPressure(const Evaluation& temperature, const Evaluation& density)
00262 {
00263
00264 return IdealGas::pressure(temperature, density/molarMass());
00265 }
00266
00273 template <class Evaluation>
00274 static Evaluation liquidDensity(const Evaluation& , const Evaluation& )
00275 {
00276 return 1000;
00277 }
00278
00285 template <class Evaluation>
00286 static Evaluation liquidPressure(const Evaluation& , const Evaluation& )
00287 {
00288 OPM_THROW(std::logic_error,
00289 "The liquid pressure is undefined for incompressible fluids");
00290 }
00291
00299 template <class Evaluation>
00300 static Evaluation gasViscosity(const Evaluation& ,
00301 const Evaluation& )
00302 {
00303 return 1e-05;
00304 }
00305
00312 template <class Evaluation>
00313 static Evaluation liquidViscosity(const Evaluation& , const Evaluation& )
00314 {
00315 return 1e-03;
00316 }
00317 };
00318
00319 template <class Scalar>
00320 const Scalar SimpleH2O<Scalar>::R = Opm::Constants<Scalar>::R / 18e-3;
00321
00322 }
00323
00324 #endif