www.mooseframework.org
PorousFlowBrineCO2.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
13 
17 
48 {
49 public:
51 
53 
54  virtual std::string fluidStateName() const override;
55 
58  Real Xnacl,
59  Real Z,
60  unsigned int qp,
61  std::vector<FluidStateProperties> & fsp) const override;
62 
64  const ADReal & temperature,
65  const ADReal & Xnacl,
66  const ADReal & Z,
67  unsigned int qp,
68  std::vector<FluidStateProperties> & fsp) const override;
69 
85  const ADReal & temperature,
86  const ADReal & Xnacl,
87  ADReal & xco2,
88  ADReal & yh2o) const;
89 
100  const ADReal & temperature,
101  const ADReal & Xnacl,
102  ADReal & Xco2,
103  ADReal & Yh2o) const;
104 
116  void massFractions(const ADReal & pressure,
117  const ADReal & temperature,
118  const ADReal & Xnacl,
119  const ADReal & Z,
120  FluidStatePhaseEnum & phase_state,
121  std::vector<FluidStateProperties> & fsp) const;
122 
130  void gasProperties(const ADReal & pressure,
131  const ADReal & temperature,
132  std::vector<FluidStateProperties> & fsp) const;
133 
142  void liquidProperties(const ADReal & pressure,
143  const ADReal & temperature,
144  const ADReal & Xnacl,
145  std::vector<FluidStateProperties> & fsp) const;
146 
158  const ADReal & temperature,
159  const ADReal & Xnacl,
160  const ADReal & Z,
161  std::vector<FluidStateProperties> & fsp) const;
162 
173  void twoPhaseProperties(const ADReal & pressure,
174  const ADReal & temperature,
175  const ADReal & Xnacl,
176  const ADReal & Z,
177  unsigned int qp,
178  std::vector<FluidStateProperties> & fsp) const;
179 
191  const ADReal & temperature,
192  const ADReal & co2_density,
193  ADReal & fco2,
194  ADReal & fh2o) const;
195 
197 
210  const ADReal & temperature,
211  const ADReal & co2_density,
212  const ADReal & xco2,
213  const ADReal & yh2o,
214  ADReal & fco2,
215  ADReal & fh2o) const;
216 
218  const ADReal & temperature,
219  const ADReal & co2_density,
220  const ADReal & xco2,
221  const ADReal & yh2o) const;
222 
224  const ADReal & temperature,
225  const ADReal & co2_density,
226  const ADReal & xco2,
227  const ADReal & yh2o) const;
229 
238  ADReal activityCoefficientH2O(const ADReal & temperature, const ADReal & xco2) const;
239 
248  ADReal activityCoefficientCO2(const ADReal & temperature, const ADReal & xco2) const;
249 
265  const ADReal & temperature,
266  const ADReal & Xnacl) const;
267 
279  ADReal activityCoefficientHighTemp(const ADReal & temperature, const ADReal & Xnacl) const;
280 
292 
304 
313 
314  virtual Real totalMassFraction(
315  Real pressure, Real temperature, Real Xnacl, Real saturation, unsigned int qp) const override;
316 
321  unsigned int saltComponentIndex() const { return _salt_component; };
322 
332  ADReal henryConstant(const ADReal & temperature, const ADReal & Xnacl) const;
333 
346  ADReal enthalpyOfDissolutionGas(const ADReal & temperature, const ADReal & Xnacl) const;
347 
362 
374  const ADReal & temperature,
375  const ADReal & Xnacl,
376  ADReal & xco2,
377  ADReal & yh2o) const;
378 
390  Real temperature,
391  Real Xnacl,
392  Real co2_density,
393  Real & xco2,
394  Real & yh2o) const;
395 
396 protected:
398  virtual void checkVariables(Real pressure, Real temperature) const;
399 
413  Real temperature, Real f0, Real df0, Real f1, Real df1, Real & value, Real & deriv) const;
414 
416 
429  void funcABHighTemp(Real pressure,
430  Real temperature,
431  Real Xnacl,
432  Real co2_density,
433  Real xco2,
434  Real yh2o,
435  Real & A,
436  Real & B) const;
437 
438  void funcABHighTemp(Real pressure,
439  Real temperature,
440  Real Xnacl,
441  Real co2_density,
442  Real xco2,
443  Real yh2o,
444  Real & A,
445  Real & dA_dp,
446  Real & dA_dT,
447  Real & B,
448  Real & dB_dp,
449  Real & dB_dT,
450  Real & dB_dX) const;
451 
452  void funcABLowTemp(const ADReal & pressure,
453  const ADReal & temperature,
454  const ADReal & co2_density,
455  ADReal & A,
456  ADReal & B) const;
458 
460  const unsigned int _salt_component;
466  const Real _Mh2o;
468  const Real _invMh2o;
470  const Real _Mco2;
472  const Real _Mnacl;
474  const Real _Rbar;
476  const Real _Tlower;
478  const Real _Tupper;
481  const Real _Zmin;
483  const std::vector<Real> _co2_henry;
484 };
void liquidProperties(const ADReal &pressure, const ADReal &temperature, const ADReal &Xnacl, std::vector< FluidStateProperties > &fsp) const
Thermophysical properties of the liquid state.
const Real _Tlower
Temperature below which the Spycher, Pruess & Ennis-King (2003) model is used (K) ...
const unsigned int _salt_component
Salt component index.
const Real _Mh2o
Molar mass of water (kg/mol)
ADReal activityCoefficient(const ADReal &pressure, const ADReal &temperature, const ADReal &Xnacl) const
Activity coefficient for CO2 in brine.
static InputParameters validParams()
ADReal activityCoefficientHighTemp(const ADReal &temperature, const ADReal &Xnacl) const
Activity coefficient for CO2 in brine used in the elevated temperature formulation.
const Real _Mnacl
Molar mass of NaCL.
ADReal equilibriumConstantH2O(const ADReal &temperature) const
Equilibrium constant for H2O For temperatures 12C <= T <= 99C, uses Spycher, Pruess and Ennis-King (2...
const Real _invMh2o
Inverse of molar mass of H2O (mol/kg)
void fugacityCoefficientsHighTemp(const ADReal &pressure, const ADReal &temperature, const ADReal &co2_density, const ADReal &xco2, const ADReal &yh2o, ADReal &fco2, ADReal &fh2o) const
Fugacity coefficients for H2O and CO2 at elevated temperatures (100C < T <= 300C).
const std::vector< Real > _co2_henry
Henry&#39;s coefficeients for CO2.
virtual Real totalMassFraction(Real pressure, Real temperature, Real Xnacl, Real saturation, unsigned int qp) const override
Total mass fraction of fluid component summed over all phases in the two-phase state for a specified ...
void funcABLowTemp(const ADReal &pressure, const ADReal &temperature, const ADReal &co2_density, ADReal &A, ADReal &B) const
ADReal fugacityCoefficientH2OHighTemp(const ADReal &pressure, const ADReal &temperature, const ADReal &co2_density, const ADReal &xco2, const ADReal &yh2o) const
const Real _Mco2
Molar mass of CO2 (kg/mol)
Compositional flash routines for miscible multiphase flow classes with multiple fluid components...
ADReal enthalpyOfDissolutionGas(const ADReal &temperature, const ADReal &Xnacl) const
Enthalpy of dissolution of gas phase CO2 in brine calculated using Henry&#39;s constant From Himmelblau...
static const std::string temperature
Definition: NS.h:57
Brine (NaCl in H2O) fluid properties as a function of pressure (Pa), temperature (K) and NaCl mass fr...
void solveEquilibriumMoleFractionHighTemp(Real pressure, Real temperature, Real Xnacl, Real co2_density, Real &xco2, Real &yh2o) const
Function to solve for yh2o and xco2 iteratively in the elevated temperature regime (T > 100C) ...
const BrineFluidProperties & _brine_fp
Fluid properties UserObject for water.
virtual std::string fluidStateName() const override
Name of FluidState.
const SinglePhaseFluidProperties & _co2_fp
Fluid properties UserObject for the CO2.
ADReal partialDensityCO2(const ADReal &temperature) const
Partial density of dissolved CO2 From Garcia, Density of aqueous solutions of CO2, LBNL-49023 (2001)
void funcABHighTemp(Real pressure, Real temperature, Real Xnacl, Real co2_density, Real xco2, Real yh2o, Real &A, Real &B) const
The function A (Eq.
void equilibriumMassFractions(const ADReal &pressure, const ADReal &temperature, const ADReal &Xnacl, ADReal &Xco2, ADReal &Yh2o) const
Mass fractions of CO2 in brine and water vapor in CO2 at equilibrium.
void thermophysicalProperties(Real pressure, Real temperature, Real Xnacl, Real Z, unsigned int qp, std::vector< FluidStateProperties > &fsp) const override
Determines the complete thermophysical state of the system for a given set of primary variables...
ADReal enthalpyOfDissolution(const ADReal &temperature) const
Enthalpy of dissolution of CO2 in brine calculated using linear fit to model of Duan and Sun...
void equilibriumMoleFractionsLowTemp(const ADReal &pressure, const ADReal &temperature, const ADReal &Xnacl, ADReal &xco2, ADReal &yh2o) const
Mole fractions of CO2 in brine and water vapor in CO2 at equilibrium in the low temperature regime (T...
ADReal activityCoefficientH2O(const ADReal &temperature, const ADReal &xco2) const
Activity coefficient of H2O Eq.
Common class for single phase fluid properties.
FluidStatePhaseEnum
Phase state enum.
DualReal ADReal
void fugacityCoefficientsLowTemp(const ADReal &pressure, const ADReal &temperature, const ADReal &co2_density, ADReal &fco2, ADReal &fh2o) const
Fugacity coefficients for H2O and CO2 for T <= 100C Eq.
ADReal activityCoefficientCO2(const ADReal &temperature, const ADReal &xco2) const
Activity coefficient of CO2 Eq.
ADReal fugacityCoefficientCO2HighTemp(const ADReal &pressure, const ADReal &temperature, const ADReal &co2_density, const ADReal &xco2, const ADReal &yh2o) const
void equilibriumMoleFractions(const ADReal &pressure, const ADReal &temperature, const ADReal &Xnacl, ADReal &xco2, ADReal &yh2o) const
Mole fractions of CO2 in brine and water vapor in CO2 at equilibrium.
void twoPhaseProperties(const ADReal &pressure, const ADReal &temperature, const ADReal &Xnacl, const ADReal &Z, unsigned int qp, std::vector< FluidStateProperties > &fsp) const
Gas and liquid properties in the two-phase region.
static const std::string Z
Definition: NS.h:154
const Real _Rbar
Molar gas constant in bar cm^3 /(K mol)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void massFractions(const ADReal &pressure, const ADReal &temperature, const ADReal &Xnacl, const ADReal &Z, FluidStatePhaseEnum &phase_state, std::vector< FluidStateProperties > &fsp) const
Mass fractions of CO2 and H2O in both phases, as well as derivatives wrt PorousFlow variables...
void gasProperties(const ADReal &pressure, const ADReal &temperature, std::vector< FluidStateProperties > &fsp) const
Thermophysical properties of the gaseous state.
Water (H2O) fluid properties as a function of pressure (Pa) and temperature (K) from IAPWS-IF97: Revi...
Specialized class for brine and CO2 including calculation of mutual solubility of the two fluids usin...
static const std::string pressure
Definition: NS.h:56
const InputParameters & parameters() const
void smoothCubicInterpolation(Real temperature, Real f0, Real df0, Real f1, Real df1, Real &value, Real &deriv) const
Cubic function to smoothly interpolate between the low temperature and elevated temperature models fo...
virtual void checkVariables(Real pressure, Real temperature) const
Check the input variables.
unsigned int saltComponentIndex() const
The index of the salt component.
const Real _Zmin
Minimum Z - below this value all CO2 will be dissolved.
PorousFlowBrineCO2(const InputParameters &parameters)
ADReal henryConstant(const ADReal &temperature, const ADReal &Xnacl) const
Henry&#39;s constant of dissolution of gas phase CO2 in brine.
ADReal equilibriumConstantCO2(const ADReal &temperature) const
Equilibrium constant for CO2 For temperatures 12C <= T <= 99C, uses Spycher, Pruess and Ennis-King (2...
ADReal saturation(const ADReal &pressure, const ADReal &temperature, const ADReal &Xnacl, const ADReal &Z, std::vector< FluidStateProperties > &fsp) const
Gas saturation in the two-phase region.
const Real _Tupper
Temperature above which the Spycher & Pruess (2010) model is used (K)