28 #ifndef OPM_BINARY_COEFF_BRINE_CO2_HPP 29 #define OPM_BINARY_COEFF_BRINE_CO2_HPP 37 namespace BinaryCoeff {
43 template<
class Scalar,
class CO2Tables,
bool verbose = true>
48 static const int liquidPhaseIdx = 0;
49 static const int gasPhaseIdx = 1;
59 template <
class Evaluation>
60 static Evaluation
gasDiffCoeff(
const Evaluation& temperature,
const Evaluation& pressure)
63 Scalar k = 1.3806504e-23;
65 Scalar R_h = 1.72e-10;
67 return k / (c * M_PI * R_h) * (temperature / mu);
76 template <
class Evaluation>
100 template <
class Evaluation>
102 const Evaluation& pg,
104 const int knownPhaseIdx,
108 Evaluation A = computeA_(temperature, pg);
111 Scalar x_NaCl = salinityToMolFrac_(salinity);
115 if (knownPhaseIdx < 0) {
116 Scalar molalityNaCl = moleFracToMolality_(x_NaCl);
117 Evaluation m0_CO2 = molalityCO2inPureWater_(temperature, pg);
118 Evaluation gammaStar = activityCoefficient_(temperature, pg, molalityNaCl);
119 Evaluation m_CO2 = m0_CO2 / gammaStar;
120 xlCO2 = m_CO2 / (molalityNaCl + 55.508 + m_CO2);
121 ygH2O = A * (1 - xlCO2 - x_NaCl);
127 if (knownPhaseIdx == liquidPhaseIdx)
128 ygH2O = A * (1 - xlCO2 - x_NaCl);
133 if (knownPhaseIdx == gasPhaseIdx)
135 xlCO2 = 1 - x_NaCl - ygH2O / A;
141 template <
class Evaluation>
142 static Evaluation
henry(
const Evaluation& temperature)
153 template <
class Evaluation>
156 Valgrind::CheckDefined(temperature);
157 Valgrind::CheckDefined(pg);
160 Evaluation pg_bar = pg / 1.e5;
161 Evaluation a_CO2 = (7.54e7 - 4.13e4 * temperature);
166 lnPhiCO2 = Opm::log(V / (V - b_CO2));
167 lnPhiCO2 += b_CO2 / (V - b_CO2);
168 lnPhiCO2 -= 2 * a_CO2 / (R * Opm::pow(temperature, 1.5) * b_CO2) * log((V + b_CO2) / V);
172 * Opm::pow(temperature, 1.5)
175 * (Opm::log((V + b_CO2) / V)
176 - b_CO2 / (V + b_CO2));
177 lnPhiCO2 -= Opm::log(pg_bar * V / (R * temperature));
179 return Opm::exp(lnPhiCO2);
190 template <
class Evaluation>
194 const Evaluation& pg_bar = pg / 1.e5;
195 const Evaluation& a_CO2 = (7.54e7 - 4.13e4 * temperature);
196 Scalar a_CO2_H2O = 7.89e7;
198 Scalar b_H2O = 18.18;
203 Opm::log(V/(V - b_CO2))
204 + b_H2O/(V - b_CO2) - 2*a_CO2_H2O
205 / (R*Opm::pow(temperature, 1.5)*b_CO2)*Opm::log((V + b_CO2)/V)
206 + a_CO2*b_H2O/(R*Opm::pow(temperature, 1.5)*b_CO2*b_CO2)
207 *(Opm::log((V + b_CO2)/V) - b_CO2/(V + b_CO2))
208 - Opm::log(pg_bar*V/(R*temperature));
209 return Opm::exp(lnPhiH2O);
218 static Scalar salinityToMolFrac_(Scalar salinity) {
221 const Scalar Ms = 58.8e-3;
223 const Scalar X_NaCl = salinity;
225 const Scalar x_NaCl = -Mw * X_NaCl / ((Ms - Mw) * X_NaCl - Ms);
234 static Scalar moleFracToMolality_(Scalar x_NaCl)
237 return 55.508 * x_NaCl / (1 - x_NaCl);
247 template <
class Evaluation>
248 static Evaluation molalityCO2inPureWater_(
const Evaluation& temperature,
const Evaluation& pg)
250 const Evaluation& A = computeA_(temperature, pg);
251 const Evaluation& B = computeB_(temperature, pg);
252 const Evaluation& yH2OinGas = (1 - B) / (1. / A - B);
253 const Evaluation& xCO2inWater = B * (1 - yH2OinGas);
254 return (xCO2inWater * 55.508) / (1 - xCO2inWater);
266 template <
class Evaluation>
267 static Evaluation activityCoefficient_(
const Evaluation& temperature,
268 const Evaluation& pg,
271 const Evaluation& lambda = computeLambda_(temperature, pg);
272 const Evaluation& xi = computeXi_(temperature, pg);
273 const Evaluation& lnGammaStar =
274 2*molalityNaCl*lambda + xi*molalityNaCl*molalityNaCl;
275 return Opm::exp(lnGammaStar);
286 template <
class Evaluation>
287 static Evaluation computeA_(
const Evaluation& temperature,
const Evaluation& pg)
289 const Evaluation& deltaP = pg / 1e5 - 1;
290 Scalar v_av_H2O = 18.1;
292 const Evaluation& k0_H2O = equilibriumConstantH2O_(temperature);
294 const Evaluation& pg_bar = pg / 1.e5;
295 return k0_H2O/(phi_H2O*pg_bar)*Opm::exp(deltaP*v_av_H2O/(R*temperature));
306 template <
class Evaluation>
307 static Evaluation computeB_(
const Evaluation& temperature,
const Evaluation& pg)
309 const Evaluation& deltaP = pg / 1e5 - 1;
310 const Scalar v_av_CO2 = 32.6;
312 const Evaluation& k0_CO2 = equilibriumConstantCO2_(temperature);
314 const Evaluation& pg_bar = pg / 1.e5;
315 return phi_CO2*pg_bar/(55.508*k0_CO2)*Opm::exp(-(deltaP*v_av_CO2)/(R*temperature));
325 template <
class Evaluation>
326 static Evaluation computeLambda_(
const Evaluation& temperature,
const Evaluation& pg)
328 static const Scalar c[6] =
329 { -0.411370585, 6.07632013E-4, 97.5347708, -0.0237622469, 0.0170656236, 1.41335834E-5 };
331 Evaluation pg_bar = pg / 1.0E5;
336 + c[3]*pg_bar/temperature
337 + c[4]*pg_bar/(630.0 - temperature)
338 + c[5]*temperature*Opm::log(pg_bar);
348 template <
class Evaluation>
349 static Evaluation computeXi_(
const Evaluation& temperature,
const Evaluation& pg)
351 static const Scalar c[4] =
352 { 3.36389723E-4, -1.98298980E-5, 2.12220830E-3, -5.24873303E-3 };
354 Evaluation pg_bar = pg / 1.0E5;
355 return c[0] + c[1]*temperature + c[2]*pg_bar/temperature + c[3]*pg_bar/(630.0 - temperature);
364 template <
class Evaluation>
365 static Evaluation equilibriumConstantCO2_(
const Evaluation& temperature)
367 Evaluation temperatureCelcius = temperature - 273.15;
368 static const Scalar c[3] = { 1.189, 1.304e-2, -5.446e-5 };
369 Evaluation logk0_CO2 = c[0] + temperatureCelcius*(c[1] + temperatureCelcius*c[2]);
370 Evaluation k0_CO2 = Opm::pow(10.0, logk0_CO2);
380 template <
class Evaluation>
381 static Evaluation equilibriumConstantH2O_(
const Evaluation& temperature)
383 Evaluation temperatureCelcius = temperature - 273.15;
384 static const Scalar c[4] = { -2.209, 3.097e-2, -1.098e-4, 2.048e-7 };
385 Evaluation logk0_H2O =
386 c[0] + temperatureCelcius*(c[1] + temperatureCelcius*(c[2] + temperatureCelcius*c[3]));
387 return Opm::pow(10.0, logk0_H2O);
Material properties of pure water .
Definition: H2O.hpp:61
static Evaluation fugacityCoefficientH2O(const Evaluation &temperature, const Evaluation &pg)
Returns the fugacity coefficient of the H2O component in a water-CO2 mixture.
Definition: Brine_CO2.hpp:191
static void calculateMoleFractions(const Evaluation &temperature, const Evaluation &pg, Scalar salinity, const int knownPhaseIdx, Evaluation &xlCO2, Evaluation &ygH2O)
Returns the mol (!) fraction of CO2 in the liquid phase and the mol_ (!) fraction of H2O in the gas p...
Definition: Brine_CO2.hpp:101
A class for the CO2 fluid properties.
static Evaluation henry(const Evaluation &temperature)
Henry coefficent for CO2 in brine.
Definition: Brine_CO2.hpp:142
Relations valid for an ideal gas.
A class for the brine fluid properties.
Definition: Air_Mesitylene.hpp:33
Binary coefficients for brine and CO2.
Definition: Brine_CO2.hpp:44
Material properties of pure water .
static const Scalar R
The ideal gas constant .
Definition: IdealGas.hpp:41
A class for the CO2 fluid properties.
Definition: CO2.hpp:54
Relations valid for an ideal gas.
Definition: IdealGas.hpp:37
static Evaluation gasViscosity(Evaluation temperature, const Evaluation &pressure)
The dynamic viscosity [Pa s] of CO2.
Definition: CO2.hpp:202
static Evaluation fugacityCoefficientCO2(const Evaluation &temperature, const Evaluation &pg)
Returns the fugacity coefficient of the CO2 component in a water-CO2 mixture.
Definition: Brine_CO2.hpp:154
static Scalar molarMass()
The mass in [kg] of one mole of CO2.
Definition: CO2.hpp:69
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of CO2 at a given pressure and temperature [kg/m^3].
Definition: CO2.hpp:190
static Evaluation liquidDiffCoeff(const Evaluation &, const Evaluation &)
Binary diffusion coefficent [m^2/s] of CO2 in the brine phase.
Definition: Brine_CO2.hpp:77
static const Scalar molarMass()
The molar mass in of water.
Definition: H2O.hpp:80
static Evaluation gasDiffCoeff(const Evaluation &temperature, const Evaluation &pressure)
Binary diffusion coefficent [m^2/s] of water in the CO2 phase.
Definition: Brine_CO2.hpp:60