24#ifndef DUMUX_BINARY_COEFF_BRINE_CO2_HH
25#define DUMUX_BINARY_COEFF_BRINE_CO2_HH
34namespace BinaryCoeff {
39template<
class Scalar,
class CO2Tables,
bool verbose = true>
44 static const int lPhaseIdx = 0;
45 static const int gPhaseIdx = 1;
57 if(!
hasParam(
"BinaryCoefficients.GasDiffCoeff"))
60 Scalar
const PI=3.141593;
61 Scalar
const k = 1.3806504e-23;
63 Scalar
const R_h = 1.72e-10;
67 }
else return getParam<Scalar>(
"BinaryCoefficients.GasDiffCoeff");
79 if(!
hasParam(
"BinaryCoefficients.LiquidDiffCoeff"))
82 }
else return getParam<Scalar>(
"BinaryCoefficients.LiquidDiffCoeff");
104 const Scalar salinity,
105 const int knownPhaseIdx,
112 const Scalar x_NaCl = salinityToMoleFrac_(salinity);
116 if (knownPhaseIdx < 0)
118 Scalar molalityNaCl = molFracToMolality_(x_NaCl);
119 Scalar m0_CO2 = molalityCO2inPureWater_(
temperature, pg);
120 Scalar gammaStar = activityCoefficient_(
temperature, pg, molalityNaCl);
121 Scalar m_CO2 = m0_CO2 / gammaStar;
122 xlCO2 = m_CO2 / (molalityNaCl + 55.508 + m_CO2);
123 ygH2O = A * (1 - xlCO2 - x_NaCl);
129 if (knownPhaseIdx == lPhaseIdx)
130 ygH2O = A * (1 - xlCO2 - x_NaCl);
135 if (knownPhaseIdx == gPhaseIdx)
136 xlCO2 = 1 - x_NaCl - ygH2O / A;
149 Scalar pg_bar = pg / 1.e5;
150 Scalar a_CO2 = (7.54e7 - 4.13e4 * T);
151 static const Scalar b_CO2 = 27.8;
153 Scalar lnPhiCO2, phiCO2;
158 lnPhiCO2 = log(V / (V - b_CO2)) + b_CO2 / (V - b_CO2) - 2 * a_CO2 / (R
159 * pow(T, 1.5) * b_CO2) * log((V + b_CO2) / V) + a_CO2 * b_CO2
160 / (R * pow(T, 1.5) * b_CO2 * b_CO2) * (log((V + b_CO2) / V)
161 - b_CO2 / (V + b_CO2)) - log(pg_bar * V / (R * T));
163 phiCO2 = exp(lnPhiCO2);
177 Scalar pg_bar = pg / 1.e5;
178 Scalar a_CO2 = (7.54e7 - 4.13e4 * T);
179 static const Scalar a_CO2_H2O = 7.89e7;
180 static const Scalar b_CO2 = 27.8;
181 static const Scalar b_H2O = 18.18;
183 Scalar lnPhiH2O, phiH2O;
188 lnPhiH2O = log(V / (V - b_CO2)) + b_H2O / (V - b_CO2) - 2 * a_CO2_H2O
189 / (R * pow(T, 1.5) * b_CO2) * log((V + b_CO2) / V) + a_CO2
190 * b_H2O / (R * pow(T, 1.5) * b_CO2 * b_CO2) * (log((V + b_CO2)
191 / V) - b_CO2 / (V + b_CO2)) - log(pg_bar * V / (R * T));
193 phiH2O = exp(lnPhiH2O);
202 static Scalar salinityToMoleFrac_(Scalar salinity)
205 const Scalar Ms = 58.8e-3;
207 const Scalar X_NaCl = salinity;
209 const Scalar x_NaCl = -Mw * X_NaCl / ((Ms - Mw) * X_NaCl - Ms);
219 static Scalar molFracToMolality_(Scalar x_NaCl)
222 const Scalar mol_NaCl = 55.508 * x_NaCl / (1 - x_NaCl);
233 static Scalar molalityCO2inPureWater_(Scalar
temperature, Scalar pg)
237 Scalar yH2OinGas = (1 - B) / (1. / A - B);
238 Scalar xCO2inWater = B * (1 - yH2OinGas);
239 Scalar molalityCO2 = (xCO2inWater * 55.508) / (1 - xCO2inWater);
252 static Scalar activityCoefficient_(Scalar
temperature, Scalar pg, Scalar molalityNaCl)
256 Scalar lnGammaStar = 2 * lambda * molalityNaCl + xi * molalityNaCl
259 Scalar gammaStar = exp(lnGammaStar);
271 static Scalar computeA_(Scalar T, Scalar pg)
273 Scalar deltaP = pg / 1e5 - 1;
274 const Scalar v_av_H2O = 18.1;
276 Scalar k0_H2O = equilibriumConstantH2O_(T);
278 Scalar pg_bar = pg / 1.e5;
280 Scalar A = k0_H2O / (phi_H2O * pg_bar) * exp(deltaP * v_av_H2O / (R * T));
292 static Scalar computeB_(Scalar T, Scalar pg)
294 Scalar deltaP = pg / 1e5 - 1;
295 const Scalar v_av_CO2 = 32.6;
297 Scalar k0_CO2 = equilibriumConstantCO2_(T);
299 Scalar pg_bar = pg / 1.e5;
301 Scalar B = phi_CO2 * pg_bar / (55.508 * k0_CO2) * exp(-(deltaP
302 * v_av_CO2) / (R * T));
313 static Scalar computeLambda_(Scalar T, Scalar pg)
316 static const Scalar c[6] = { -0.411370585, 6.07632013E-4, 97.5347708,
317 -0.0237622469, 0.0170656236, 1.41335834E-5 };
320 Scalar pg_bar = pg / 1.0E5;
321 lambda = c[0] + c[1] * T + c[2] / T + c[3] * pg_bar / T + c[4] * pg_bar
322 / (630.0 - T) + c[5] * T * log(pg_bar);
334 static Scalar computeXi_(Scalar T, Scalar pg)
337 static const Scalar c[4] = { 3.36389723E-4, -1.98298980E-5,
338 2.12220830E-3, -5.24873303E-3 };
340 Scalar pg_bar = pg / 1.0E5;
341 xi = c[0] + c[1] * T + c[2] * pg_bar / T + c[3] * pg_bar / (630.0 - T);
352 static Scalar equilibriumConstantCO2_(Scalar T)
354 Scalar TinC = T - 273.15;
355 static const Scalar c[3] = { 1.189, 1.304e-2, -5.446e-5 };
356 Scalar logk0_CO2 = c[0] + c[1] * TinC + c[2] * TinC * TinC;
358 Scalar k0_CO2 = pow(10, logk0_CO2);
368 static Scalar equilibriumConstantH2O_(Scalar T)
370 Scalar TinC = T - 273.15;
371 static const Scalar c[4] = { -2.209, 3.097e-2, -1.098e-4, 2.048e-7 };
372 Scalar logk0_H2O = c[0] + c[1] * TinC + c[2] * TinC * TinC + c[3]
373 * TinC * TinC * TinC;
375 Scalar k0_H2O = pow(10, logk0_H2O);
386template<
class Scalar,
class CO2Tables,
bool verbose = true>
420 const Scalar Ms = 58.8e-3;
424 const Scalar x_NaCl = -Mw * X_NaCl / ((Ms - Mw) * X_NaCl - Ms);
427 const Scalar mol_NaCl = -55.56 * x_NaCl / (x_NaCl - 1);
432 const Scalar pgCO2 = partialPressureCO2_(
temperature, pg);
433 const Scalar phiCO2 = fugacityCoeffCO2_(
temperature, pgCO2, rhoCO2);
437 const Scalar exponent = A - log(phiCO2) + 2*B*mol_NaCl + C*pow(mol_NaCl,2);
440 const Scalar mol_CO2w = pgCO2 / (1e5 * exp(exponent));
442 const Scalar x_CO2w = mol_CO2w / (mol_CO2w + 55.56);
454 static Scalar computeA_(Scalar T, Scalar pg)
456 static const Scalar c[10] = {
469 const Scalar pg_bar = pg / 1.0E5;
470 const Scalar Tr = 630.0 - T;
483 c[9]*pg_bar*pg_bar/(Tr*Tr);
492 static Scalar computeB_(Scalar T, Scalar pg)
494 const Scalar c1 = -0.411370585;
495 const Scalar c2 = 6.07632013E-4;
496 const Scalar c3 = 97.5347708;
497 const Scalar c8 = -0.0237622469;
498 const Scalar c9 = 0.0170656236;
499 const Scalar c11 = 1.41335834E-5;
501 const Scalar pg_bar = pg / 1.0E5;
509 c9*pg_bar/(630.0-T) +
519 static Scalar computeC_(Scalar T, Scalar pg)
521 const Scalar c1 = 3.36389723E-4;
522 const Scalar c2 = -1.98298980E-5;
523 const Scalar c8 = 2.12220830E-3;
524 const Scalar c9 = -5.24873303E-3;
526 const Scalar pg_bar = pg / 1.0E5;
545 static Scalar partialPressureCO2_(Scalar
temperature, Scalar pg)
557 static Scalar fugacityCoeffCO2_(Scalar
temperature,
561 static const Scalar a[15] = {
595 const Scalar Z = pr * Vr / Tr;
597 const Scalar A = a[0] + a[1] / (Tr * Tr) + a[2] / (Tr * Tr * Tr);
598 const Scalar B = a[3] + a[4] / (Tr * Tr) + a[5] / (Tr * Tr * Tr);
599 const Scalar C = a[6] + a[7] / (Tr * Tr) + a[8] / (Tr * Tr * Tr);
600 const Scalar D = a[9] + a[10] / (Tr * Tr) + a[11] / (Tr * Tr * Tr);
604 const Scalar lnphiCO2 =
612 a[12]/(2*Tr*Tr*Tr*a[14])*
617 )*exp(-a[14]/(Vr*Vr)));
619 return exp(lnphiCO2);
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
A class for the CO2 fluid properties.
Material properties of pure water .
Relations valid for an ideal gas.
bool hasParam(const std::string ¶m)
Check whether a key exists in the parameter tree.
Definition: parameters.hh:383
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:51
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:34
Binary coefficients for brine and CO2.
Definition: brine_co2.hh:40
static Scalar fugacityCoefficientCO2(Scalar T, Scalar pg)
Returns the fugacity coefficient of the CO2 component in a water-CO2 mixture (given in Spycher,...
Definition: brine_co2.hh:146
static Scalar fugacityCoefficientH2O(Scalar T, Scalar pg)
Returns the fugacity coefficient of the H2O component in a water-CO2 mixture (given in Spycher,...
Definition: brine_co2.hh:174
static void calculateMoleFractions(const Scalar temperature, const Scalar pg, const Scalar salinity, const int knownPhaseIdx, Scalar &xlCO2, Scalar &ygH2O)
Returns the mol (!) fraction of CO2 in the liquid phase and the mol (!) fraction of H2O in the gas ph...
Definition: brine_co2.hh:102
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient of CO2 in the brine phase.
Definition: brine_co2.hh:76
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient of water in the CO2 phase.
Definition: brine_co2.hh:55
Old version of binary coefficients for CO2 and brine. Calculates molfraction of CO2 in brine accordin...
Definition: brine_co2.hh:388
static Scalar moleFracCO2InBrine(Scalar temperature, Scalar pg, Scalar rhoCO2)
Returns the mole (!) fraction of CO2 in the liquid phase at a given temperature, pressure and density...
Definition: brine_co2.hh:403
A class for the brine fluid properties.
Definition: components/brine.hh:57
static Scalar salinity()
Return the constant salinity.
Definition: components/brine.hh:74
static Scalar vaporPressure(Scalar temperature)
The vapor pressure in of pure brine at a given temperature. Here, it is assumed to be equal to that ...
Definition: components/brine.hh:121
A class for the CO2 fluid properties.
Definition: co2.hh:56
static constexpr Scalar molarMass()
The mass in of one mole of CO2.
Definition: co2.hh:71
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of CO2 at a given pressure and temperature .
Definition: co2.hh:225
static Scalar criticalTemperature()
Returns the critical temperature of CO2.
Definition: co2.hh:77
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of CO2. Equations given in: - Vesovic et al., 1990.
Definition: co2.hh:326
static Scalar criticalPressure()
Returns the critical pressure of CO2.
Definition: co2.hh:83
Material properties of pure water .
Definition: h2o.hh:61
static constexpr Scalar molarMass()
The molar mass in of water.
Definition: h2o.hh:81
Relations valid for an ideal gas.
Definition: idealgas.hh:37
static constexpr Scalar R
The ideal gas constant .
Definition: idealgas.hh:40
A class for the brine fluid properties,.