BrineCO2FluidSystem.hpp
Go to the documentation of this file.
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 /*
4  Copyright (C) 2011-2013 by Andreas Lauser
5 
6  This file is part of the Open Porous Media project (OPM).
7 
8  OPM is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 2 of the License, or
11  (at your option) any later version.
12 
13  OPM is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with OPM. If not, see <http://www.gnu.org/licenses/>.
20 */
26 #ifndef OPM_BRINE_CO2_SYSTEM_HPP
27 #define OPM_BRINE_CO2_SYSTEM_HPP
28 
29 #include "BaseFluidSystem.hpp"
30 #include "NullParameterCache.hpp"
31 
33 
39 
43 
45 
46 #include <iostream>
47 
48 namespace Opm {
49 namespace FluidSystems {
50 
58 template <class Scalar, class CO2Tables>
59 class BrineCO2
60  : public BaseFluidSystem<Scalar, BrineCO2<Scalar, CO2Tables> >
61 {
66 
67  typedef H2O_Tabulated H2O;
68 
69 public:
72 
75 
76  /****************************************
77  * Fluid phase related static parameters
78  ****************************************/
79 
81  static const int numPhases = 2;
82 
84  static const int liquidPhaseIdx = 0;
86  static const int gasPhaseIdx = 1;
87 
91  static const char *phaseName(unsigned phaseIdx)
92  {
93  static const char *name[] = {
94  "liquid",
95  "gas"
96  };
97 
98  assert(0 <= phaseIdx && phaseIdx < numPhases);
99  return name[phaseIdx];
100  }
101 
105  static bool isLiquid(unsigned phaseIdx)
106  {
107  assert(0 <= phaseIdx && phaseIdx < numPhases);
108 
109  return phaseIdx != gasPhaseIdx;
110  }
111 
115  static bool isIdealGas(unsigned phaseIdx)
116  {
117  assert(0 <= phaseIdx && phaseIdx < numPhases);
118 
119  if (phaseIdx == gasPhaseIdx)
120  return CO2::gasIsIdeal();
121  return false;
122  }
123 
127  static bool isIdealMixture(OPM_OPTIM_UNUSED unsigned phaseIdx)
128  {
129  assert(0 <= phaseIdx && phaseIdx < numPhases);
130 
131  return true;
132  }
133 
137  static bool isCompressible(OPM_OPTIM_UNUSED unsigned phaseIdx)
138  {
139  assert(0 <= phaseIdx && phaseIdx < numPhases);
140 
141  return true;
142  }
143 
144  /****************************************
145  * Component related static parameters
146  ****************************************/
148  static const int numComponents = 2;
149 
151  static const int BrineIdx = 0;
153  static const int CO2Idx = 1;
154 
156  typedef Brine_Tabulated Brine;
159 
163  static const char *componentName(unsigned compIdx)
164  {
165  static const char *name[] = {
166  Brine::name(),
167  CO2::name(),
168  };
169 
170  assert(0 <= compIdx && compIdx < numComponents);
171  return name[compIdx];
172  }
173 
177  static Scalar molarMass(unsigned compIdx)
178  {
179  assert(0 <= compIdx && compIdx < numComponents);
180  return (compIdx==BrineIdx)
181  ? Brine::molarMass()
182  : CO2::molarMass();
183  }
184 
185  /****************************************
186  * thermodynamic relations
187  ****************************************/
188 
192  static void init()
193  {
194  init(/*startTemp=*/273.15, /*endTemp=*/623.15, /*tempSteps=*/100,
195  /*startPressure=*/1e4, /*endPressure=*/40e6, /*pressureSteps=*/200);
196  }
197 
209  static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp,
210  Scalar pressMin, Scalar pressMax, unsigned nPress)
211  {
212  if (H2O::isTabulated) {
213  H2O_Tabulated::init(tempMin, tempMax, nTemp,
214  pressMin, pressMax, nPress);
215  }
216 
217  // set the salinity of brine to the one used by the CO2 tables
218  Brine_IAPWS::salinity = CO2Tables::brineSalinity;
219 
220  if (Brine::isTabulated) {
221  Brine_Tabulated::init(tempMin, tempMax, nTemp,
222  pressMin, pressMax, nPress);
223  }
224  }
225 
229  template <class FluidState, class LhsEval = typename FluidState::Scalar>
230  static LhsEval density(const FluidState &fluidState,
231  const ParameterCache &/*paramCache*/,
232  unsigned phaseIdx)
233  {
235  typedef MathToolbox<LhsEval> LhsToolbox;
236 
237  assert(0 <= phaseIdx && phaseIdx < numPhases);
238 
239  const LhsEval& temperature = FsToolbox::template toLhs<LhsEval>(fluidState.temperature(phaseIdx));
240  const LhsEval& pressure = FsToolbox::template toLhs<LhsEval>(fluidState.pressure(phaseIdx));
241 
242  if (phaseIdx == liquidPhaseIdx) {
243  // use normalized composition for to calculate the density
244  // (the relations don't seem to take non-normalized
245  // compositions too well...)
246  LhsEval xlBrine = LhsToolbox::min(1.0, LhsToolbox::max(0.0, FsToolbox::template toLhs<LhsEval>(fluidState.moleFraction(liquidPhaseIdx, BrineIdx))));
247  LhsEval xlCO2 = LhsToolbox::min(1.0, LhsToolbox::max(0.0, FsToolbox::template toLhs<LhsEval>(fluidState.moleFraction(liquidPhaseIdx, CO2Idx))));
248  LhsEval sumx = xlBrine + xlCO2;
249  xlBrine /= sumx;
250  xlCO2 /= sumx;
251 
252  LhsEval result = liquidDensity_(temperature,
253  pressure,
254  xlBrine,
255  xlCO2);
256 
257  Valgrind::CheckDefined(result);
258  return result;
259  }
260 
261  assert(phaseIdx == gasPhaseIdx);
262 
263  // use normalized composition for to calculate the density
264  // (the relations don't seem to take non-normalized
265  // compositions too well...)
266  LhsEval xgBrine = LhsToolbox::min(1.0, LhsToolbox::max(0.0, FsToolbox::template toLhs<LhsEval>(fluidState.moleFraction(gasPhaseIdx, BrineIdx))));
267  LhsEval xgCO2 = LhsToolbox::min(1.0, LhsToolbox::max(0.0, FsToolbox::template toLhs<LhsEval>(fluidState.moleFraction(gasPhaseIdx, CO2Idx))));
268  LhsEval sumx = xgBrine + xgCO2;
269  xgBrine /= sumx;
270  xgCO2 /= sumx;
271 
272  LhsEval result = gasDensity_(temperature,
273  pressure,
274  xgBrine,
275  xgCO2);
276  Valgrind::CheckDefined(result);
277  return result;
278  }
279 
283  template <class FluidState, class LhsEval = typename FluidState::Scalar>
284  static LhsEval viscosity(const FluidState &fluidState,
285  const ParameterCache &/*paramCache*/,
286  unsigned phaseIdx)
287  {
289 
290  assert(0 <= phaseIdx && phaseIdx < numPhases);
291 
292  const LhsEval& temperature = FsToolbox::template toLhs<LhsEval>(fluidState.temperature(phaseIdx));
293  const LhsEval& pressure = FsToolbox::template toLhs<LhsEval>(fluidState.pressure(phaseIdx));
294 
295  if (phaseIdx == liquidPhaseIdx) {
296  // assume pure brine for the liquid phase. TODO: viscosity
297  // of mixture
298  LhsEval result = Brine::liquidViscosity(temperature, pressure);
299  Valgrind::CheckDefined(result);
300  return result;
301  }
302 
303  assert(phaseIdx == gasPhaseIdx);
304  LhsEval result = CO2::gasViscosity(temperature, pressure);
305  Valgrind::CheckDefined(result);
306  return result;
307  }
308 
312  template <class FluidState, class LhsEval = typename FluidState::Scalar>
313  static LhsEval fugacityCoefficient(const FluidState &fluidState,
314  const ParameterCache &/*paramCache*/,
315  unsigned phaseIdx,
316  unsigned compIdx)
317  {
319  typedef MathToolbox<LhsEval> LhsToolbox;
320 
321  assert(0 <= phaseIdx && phaseIdx < numPhases);
322  assert(0 <= compIdx && compIdx < numComponents);
323 
324  if (phaseIdx == gasPhaseIdx)
325  // use the fugacity coefficients of an ideal gas. the
326  // actual value of the fugacity is not relevant, as long
327  // as the relative fluid compositions are observed,
328  return LhsToolbox::createConstant(1.0);
329 
330  const LhsEval& temperature = FsToolbox::template toLhs<LhsEval>(fluidState.temperature(phaseIdx));
331  const LhsEval& pressure = FsToolbox::template toLhs<LhsEval>(fluidState.pressure(phaseIdx));
332  assert(temperature > 0);
333  assert(pressure > 0);
334 
335  // calulate the equilibrium composition for the given
336  // temperature and pressure. TODO: calculateMoleFractions()
337  // could use some cleanup.
338  LhsEval xlH2O, xgH2O;
339  LhsEval xlCO2, xgCO2;
341  pressure,
343  /*knownPhaseIdx=*/-1,
344  xlCO2,
345  xgH2O);
346 
347  // normalize the phase compositions
348  xlCO2 = LhsToolbox::max(0.0, LhsToolbox::min(1.0, xlCO2));
349  xgH2O = LhsToolbox::max(0.0, LhsToolbox::min(1.0, xgH2O));
350 
351  xlH2O = 1.0 - xlCO2;
352  xgCO2 = 1.0 - xgH2O;
353 
354  if (compIdx == BrineIdx) {
355  Scalar phigH2O = 1.0;
356  return phigH2O * xgH2O / xlH2O;
357  }
358  else {
359  assert(compIdx == CO2Idx);
360 
361  Scalar phigCO2 = 1.0;
362  return phigCO2 * xgCO2 / xlCO2;
363  };
364  }
365 
369  template <class FluidState, class LhsEval = typename FluidState::Scalar>
370  static LhsEval diffusionCoefficient(const FluidState &fluidState,
371  const ParameterCache &/*paramCache*/,
372  unsigned phaseIdx,
373  unsigned /*compIdx*/)
374  {
376 
377  const LhsEval& temperature = FsToolbox::template toLhs<LhsEval>(fluidState.temperature(phaseIdx));
378  const LhsEval& pressure = FsToolbox::template toLhs<LhsEval>(fluidState.pressure(phaseIdx));
379  if (phaseIdx == liquidPhaseIdx)
380  return BinaryCoeffBrineCO2::liquidDiffCoeff(temperature, pressure);
381 
382  assert(phaseIdx == gasPhaseIdx);
383  return BinaryCoeffBrineCO2::gasDiffCoeff(temperature, pressure);
384  }
385 
389  template <class FluidState, class LhsEval = typename FluidState::Scalar>
390  static LhsEval enthalpy(const FluidState &fluidState,
391  const ParameterCache &/*paramCache*/,
392  unsigned phaseIdx)
393  {
395  typedef MathToolbox<LhsEval> LhsToolbox;
396 
397  assert(0 <= phaseIdx && phaseIdx < numPhases);
398 
399  const LhsEval& temperature = FsToolbox::template toLhs<LhsEval>(fluidState.temperature(phaseIdx));
400  const LhsEval& pressure = FsToolbox::template toLhs<LhsEval>(fluidState.pressure(phaseIdx));
401 
402  if (phaseIdx == liquidPhaseIdx) {
403  const LhsEval& XlCO2 = FsToolbox::template toLhs<LhsEval>(fluidState.massFraction(phaseIdx, CO2Idx));
404  const LhsEval& result = liquidEnthalpyBrineCO2_(temperature,
405  pressure,
407  XlCO2);
408  Valgrind::CheckDefined(result);
409  return result;
410  }
411  else {
412  const LhsEval& XCO2 = FsToolbox::template toLhs<LhsEval>(fluidState.massFraction(gasPhaseIdx, CO2Idx));
413  const LhsEval& XBrine = FsToolbox::template toLhs<LhsEval>(fluidState.massFraction(gasPhaseIdx, BrineIdx));
414 
415  LhsEval result = LhsToolbox::createConstant(0);
416  result += XBrine * Brine::gasEnthalpy(temperature, pressure);
417  result += XCO2 * CO2::gasEnthalpy(temperature, pressure);
418  Valgrind::CheckDefined(result);
419  return result;
420  }
421  }
422 
426  template <class FluidState, class LhsEval = typename FluidState::Scalar>
427  static LhsEval thermalConductivity(const FluidState &/*fluidState*/,
428  const ParameterCache &/*paramCache*/,
429  unsigned phaseIdx)
430  {
431  typedef MathToolbox<LhsEval> LhsToolbox;
432 
433  // TODO way too simple!
434  if (phaseIdx == liquidPhaseIdx)
435  return LhsToolbox::createConstant(0.6); // conductivity of water[W / (m K ) ]
436 
437  // gas phase
438  return LhsToolbox::createConstant(0.025); // conductivity of air [W / (m K ) ]
439  }
440 
453  template <class FluidState, class LhsEval = typename FluidState::Scalar>
454  static LhsEval heatCapacity(const FluidState &fluidState,
455  const ParameterCache &/*paramCache*/,
456  unsigned phaseIdx)
457  {
459 
460  assert(0 <= phaseIdx && phaseIdx < numPhases);
461 
462  const LhsEval& temperature = FsToolbox::template toLhs<LhsEval>(fluidState.temperature(phaseIdx));
463  const LhsEval& pressure = FsToolbox::template toLhs<LhsEval>(fluidState.pressure(phaseIdx));
464 
465  if(phaseIdx == liquidPhaseIdx)
466  return H2O::liquidHeatCapacity(temperature, pressure);
467  else
468  return CO2::gasHeatCapacity(temperature, pressure);
469  }
470 
471 private:
472  template <class LhsEval>
473  static LhsEval gasDensity_(const LhsEval& T,
474  const LhsEval& pg,
475  const LhsEval& xgH2O,
476  const LhsEval& xgCO2)
477  {
480  Valgrind::CheckDefined(xgH2O);
481  Valgrind::CheckDefined(xgCO2);
482 
483  return CO2::gasDensity(T, pg);
484  }
485 
486  /***********************************************************************/
487  /* */
488  /* Total brine density with dissolved CO2 */
489  /* rho_{b,CO2} = rho_w + contribution(salt) + contribution(CO2) */
490  /* */
491  /***********************************************************************/
492  template <class LhsEval>
493  static LhsEval liquidDensity_(const LhsEval& T,
494  const LhsEval& pl,
495  const LhsEval& xlH2O,
496  const LhsEval& xlCO2)
497  {
500  Valgrind::CheckDefined(xlH2O);
501  Valgrind::CheckDefined(xlCO2);
502 
503  if(T < 273.15) {
504  OPM_THROW(NumericalProblem,
505  "Liquid density for Brine and CO2 is only "
506  "defined above 273.15K (is " << T << "K)");
507  }
508  if(pl >= 2.5e8) {
509  OPM_THROW(NumericalProblem,
510  "Liquid density for Brine and CO2 is only "
511  "defined below 250MPa (is " << pl << "Pa)");
512  }
513 
514  const LhsEval& rho_brine = Brine::liquidDensity(T, pl);
515  const LhsEval& rho_pure = H2O::liquidDensity(T, pl);
516  const LhsEval& rho_lCO2 = liquidDensityWaterCO2_(T, pl, xlH2O, xlCO2);
517  const LhsEval& contribCO2 = rho_lCO2 - rho_pure;
518 
519  return rho_brine + contribCO2;
520  }
521 
522  template <class LhsEval>
523  static LhsEval liquidDensityWaterCO2_(const LhsEval& temperature,
524  const LhsEval& pl,
525  const LhsEval& /*xlH2O*/,
526  const LhsEval& xlCO2)
527  {
528  Scalar M_CO2 = CO2::molarMass();
529  Scalar M_H2O = H2O::molarMass();
530 
531  const LhsEval& tempC = temperature - 273.15; /* tempC : temperature in °C */
532  const LhsEval& rho_pure = H2O::liquidDensity(temperature, pl);
533  // calculate the mole fraction of CO2 in the liquid. note that xlH2O is available
534  // as a function parameter, but in the case of a pure gas phase the value of M_T
535  // for the virtual liquid phase can become very large
536  const LhsEval xlH2O = 1.0 - xlCO2;
537  const LhsEval& M_T = M_H2O * xlH2O + M_CO2 * xlCO2;
538  const LhsEval& V_phi =
539  (37.51 +
540  tempC*(-9.585e-2 +
541  tempC*(8.74e-4 -
542  tempC*5.044e-7))) / 1.0e6;
543  return 1/ (xlCO2 * V_phi/M_T + M_H2O * xlH2O / (rho_pure * M_T));
544  }
545 
546  template <class LhsEval>
547  static LhsEval liquidEnthalpyBrineCO2_(const LhsEval& T,
548  const LhsEval& p,
549  Scalar S, // salinity
550  const LhsEval& X_CO2_w)
551  {
552  typedef MathToolbox<LhsEval> LhsToolbox;
553 
554  /* X_CO2_w : mass fraction of CO2 in brine */
555 
556  /* same function as enthalpy_brine, only extended by CO2 content */
557 
558  /*Numerical coefficents from PALLISER*/
559  static Scalar f[] = {
560  2.63500E-1, 7.48368E-6, 1.44611E-6, -3.80860E-10
561  };
562 
563  /*Numerical coefficents from MICHAELIDES for the enthalpy of brine*/
564  static Scalar a[4][3] = {
565  { 9633.6, -4080.0, +286.49 },
566  { +166.58, +68.577, -4.6856 },
567  { -0.90963, -0.36524, +0.249667E-1 },
568  { +0.17965E-2, +0.71924E-3, -0.4900E-4 }
569  };
570 
571  LhsEval theta, h_NaCl;
572  LhsEval h_ls1, d_h;
573  LhsEval delta_h;
574  LhsEval delta_hCO2, hg, hw;
575 
576  theta = T - 273.15;
577 
578  // Regularization
579  Scalar scalarTheta = LhsToolbox::value(theta);
580  Scalar S_lSAT = f[0] + scalarTheta*(f[1] + scalarTheta*(f[2] + scalarTheta*f[3]));
581  if (S > S_lSAT)
582  S = S_lSAT;
583 
584  hw = H2O::liquidEnthalpy(T, p) /1E3; /* kJ/kg */
585 
586  /*DAUBERT and DANNER*/
587  /*U=*/h_NaCl = (3.6710E4*T + 0.5*(6.2770E1)*T*T - ((6.6670E-2)/3)*T*T*T
588  +((2.8000E-5)/4)*(T*T*T*T))/(58.44E3)- 2.045698e+02; /* kJ/kg */
589 
590  Scalar m = 1E3/58.44 * S/(1-S);
591  int i = 0;
592  int j = 0;
593  d_h = 0;
594 
595  for (i = 0; i<=3; i++) {
596  for (j=0; j<=2; j++) {
597  d_h = d_h + a[i][j] * LhsToolbox::pow(theta, static_cast<Scalar>(i)) * std::pow(m, j);
598  }
599  }
600  /* heat of dissolution for halite according to Michaelides 1971 */
601  delta_h = (4.184/(1E3 + (58.44 * m)))*d_h;
602 
603  /* Enthalpy of brine without CO2 */
604  h_ls1 =(1-S)*hw + S*h_NaCl + S*delta_h; /* kJ/kg */
605 
606  /* heat of dissolution for CO2 according to Fig. 6 in Duan and Sun 2003. (kJ/kg)
607  In the relevant temperature ranges CO2 dissolution is
608  exothermal */
609  delta_hCO2 = (-57.4375 + T * 0.1325) * 1000/44;
610 
611  /* enthalpy contribution of CO2 (kJ/kg) */
612  hg = CO2::gasEnthalpy(T, p)/1E3 + delta_hCO2;
613 
614  /* Enthalpy of brine with dissolved CO2 */
615  return (h_ls1 - X_CO2_w*hw + hg*X_CO2_w)*1E3; /*J/kg*/
616  }
617 };
618 
619 } // namespace FluidSystems
620 } // namespace Opm
621 
622 #endif
static const char * name()
A human readable name for the component.
Definition: TabulatedComponent.hpp:216
static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, Scalar pressMin, Scalar pressMax, unsigned nPress)
Initialize the tables.
Definition: TabulatedComponent.hpp:73
static Evaluation liquidDiffCoeff(const Evaluation &, const Evaluation &)
Binary diffusion coefficent [m^2/s] of CO2 in the brine phase.
Definition: Brine_CO2.hpp:75
Material properties of pure water .
Definition: H2O.hpp:60
Binary coefficients for water and CO2.
Opm::NullParameterCache ParameterCache
The type of the fluid system's parameter cache.
Definition: BrineCO2FluidSystem.hpp:74
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: CO2.hpp:160
bool CheckDefined(const T &value OPM_UNUSED)
Make valgrind complain if any of the memory occupied by an object is undefined.
Definition: Valgrind.hpp:74
static Evaluation gasViscosity(Evaluation temperature, const Evaluation &pressure)
The dynamic viscosity [Pa s] of CO2.
Definition: CO2.hpp:202
Definition: MathToolbox.hpp:39
Definition: Air_Mesitylene.hpp:31
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of liquid at a given pressure and temperature .
Definition: TabulatedComponent.hpp:449
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
Binary coefficients for brine and CO2.
Definition: Brine_CO2.hpp:42
A parameter cache which does nothing.
Opm::BinaryCoeff::Brine_CO2< Scalar, CO2Tables > BinaryCoeffBrineCO2
The binary coefficients for brine and CO2 used by this fluid system.
Definition: BrineCO2FluidSystem.hpp:71
Binary coefficients for water and nitrogen.
static bool isIdealGas(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: BrineCO2FluidSystem.hpp:115
A class for the brine fluid properties.
Definition: Brine.hpp:43
Evaluation< Scalar, VarSetTag, numVars > max(const Evaluation< Scalar, VarSetTag, numVars > &x1, const Evaluation< Scalar, VarSetTag, numVars > &x2)
Definition: Math.hpp:114
static const int CO2Idx
The index of the CO2 component.
Definition: BrineCO2FluidSystem.hpp:153
A class for the CO2 fluid properties.
static bool isIdealMixture(OPM_OPTIM_UNUSED unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: BrineCO2FluidSystem.hpp:127
static Evaluation liquidHeatCapacity(const Evaluation &temperature, const Evaluation &pressure)
Specific isobaric heat capacity of the liquid .
Definition: TabulatedComponent.hpp:330
A class for the CO2 fluid properties.
Definition: CO2.hpp:52
The base class for all fluid systems.
Definition: BaseFluidSystem.hpp:43
static const char * name()
A human readable name for the CO2.
Definition: CO2.hpp:61
A parameter cache which does nothing.
Definition: NullParameterCache.hpp:36
static Scalar molarMass(unsigned compIdx)
Return the molar mass of a component in [kg/mol].
Definition: BrineCO2FluidSystem.hpp:177
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:99
static const int numPhases
The number of phases considered by the fluid system.
Definition: BrineCO2FluidSystem.hpp:81
static Scalar molarMass()
The molar mass in of the component.
Definition: TabulatedComponent.hpp:222
static const int gasPhaseIdx
The index of the gas phase.
Definition: BrineCO2FluidSystem.hpp:86
static LhsEval diffusionCoefficient(const FluidState &fluidState, const ParameterCache &, unsigned phaseIdx, unsigned)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase [mol^2 * s / (k...
Definition: BrineCO2FluidSystem.hpp:370
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of gaseous CO2 [J/kg].
Definition: CO2.hpp:167
static LhsEval heatCapacity(const FluidState &fluidState, const ParameterCache &, unsigned phaseIdx)
Specific isobaric heat capacity of a fluid phase [J/kg].
Definition: BrineCO2FluidSystem.hpp:454
static LhsEval viscosity(const FluidState &fluidState, const ParameterCache &, unsigned phaseIdx)
Calculate the dynamic viscosity of a fluid phase [Pa*s].
Definition: BrineCO2FluidSystem.hpp:284
static LhsEval thermalConductivity(const FluidState &, const ParameterCache &, unsigned phaseIdx)
Thermal conductivity of a fluid phase [W/(m K)].
Definition: BrineCO2FluidSystem.hpp:427
A class for the brine fluid properties.
static Evaluation gasHeatCapacity(const Evaluation &temperature, const Evaluation &pressure)
Specific isobaric heat capacity of the component [J/kg] as a liquid.
Definition: CO2.hpp:254
static LhsEval density(const FluidState &fluidState, const ParameterCache &, unsigned phaseIdx)
Calculate the density [kg/m^3] of a fluid phase.
Definition: BrineCO2FluidSystem.hpp:230
static bool isLiquid(unsigned phaseIdx)
Return whether a phase is liquid.
Definition: BrineCO2FluidSystem.hpp:105
static void init()
Initialize the fluid system's static parameters.
Definition: BrineCO2FluidSystem.hpp:192
static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, Scalar pressMin, Scalar pressMax, unsigned nPress)
Initialize the fluid system's static parameters using problem specific temperature and pressure range...
Definition: BrineCO2FluidSystem.hpp:209
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:58
A simple version of pure water.
Binary coefficients for brine and CO2.
static const int numComponents
Number of chemical species in the fluid system.
Definition: BrineCO2FluidSystem.hpp:148
Evaluation< Scalar, VarSetTag, numVars > min(const Evaluation< Scalar, VarSetTag, numVars > &x1, const Evaluation< Scalar, VarSetTag, numVars > &x2)
Definition: Math.hpp:61
A generic class which tabulates all thermodynamic properties of a given component.
Definition: TabulatedComponent.hpp:56
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the liquid .
Definition: TabulatedComponent.hpp:292
#define OPM_OPTIM_UNUSED
Definition: Unused.hpp:42
A two-phase fluid system with water and CO2.
Definition: BrineCO2FluidSystem.hpp:59
static const bool isTabulated
Definition: TabulatedComponent.hpp:61
Relations valid for an ideal gas.
A generic class which tabulates all thermodynamic properties of a given component.
Opm::CO2< Scalar, CO2Tables > CO2
The type of the component for pure CO2 used by the fluid system.
Definition: BrineCO2FluidSystem.hpp:158
static bool isCompressible(OPM_OPTIM_UNUSED unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: BrineCO2FluidSystem.hpp:137
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the gas .
Definition: TabulatedComponent.hpp:273
static Scalar molarMass()
The mass in [kg] of one mole of CO2.
Definition: CO2.hpp:67
static const char * componentName(unsigned compIdx)
Return the human readable name of a component.
Definition: BrineCO2FluidSystem.hpp:163
static const int liquidPhaseIdx
The index of the liquid phase.
Definition: BrineCO2FluidSystem.hpp:84
Evaluation< Scalar, VarSetTag, numVars > pow(const Evaluation< Scalar, VarSetTag, numVars > &base, Scalar exp)
Definition: Math.hpp:312
Brine_Tabulated Brine
The type of the component for brine used by the fluid system.
Definition: BrineCO2FluidSystem.hpp:156
static LhsEval fugacityCoefficient(const FluidState &fluidState, const ParameterCache &, unsigned phaseIdx, unsigned compIdx)
Calculate the fugacity coefficient [Pa] of an individual component in a fluid phase.
Definition: BrineCO2FluidSystem.hpp:313
A simplistic class representing the fluid properties.
static const int BrineIdx
The index of the brine component.
Definition: BrineCO2FluidSystem.hpp:151
static const char * phaseName(unsigned phaseIdx)
Return the human readable name of a fluid phase.
Definition: BrineCO2FluidSystem.hpp:91
Provides the OPM_UNUSED macro.
static Scalar salinity
The mass fraction of salt assumed to be in the brine.
Definition: Brine.hpp:47
The base class for all fluid systems.
static Evaluation liquidViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of liquid.
Definition: TabulatedComponent.hpp:487
static LhsEval enthalpy(const FluidState &fluidState, const ParameterCache &, unsigned phaseIdx)
Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy [J/kg...
Definition: BrineCO2FluidSystem.hpp:390