https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowBrineCO2.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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{
49public:
51
53
54 virtual std::string fluidStateName() const override;
55
56 void thermophysicalProperties(Real pressure,
57 Real temperature,
58 Real Xnacl,
59 Real Z,
60 unsigned int qp,
61 std::vector<FluidStateProperties> & fsp) const override;
62
63 void thermophysicalProperties(const ADReal & pressure,
64 const ADReal & temperature,
65 const ADReal & Xnacl,
66 const ADReal & Z,
67 unsigned int qp,
68 std::vector<FluidStateProperties> & fsp) const override;
69
84 void equilibriumMoleFractions(const ADReal & pressure,
85 const ADReal & temperature,
86 const ADReal & Xnacl,
87 ADReal & xco2,
88 ADReal & yh2o) const;
89
99 void equilibriumMassFractions(const ADReal & pressure,
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
157 ADReal saturation(const ADReal & pressure,
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
190 void fugacityCoefficientsLowTemp(const ADReal & pressure,
191 const ADReal & temperature,
192 const ADReal & co2_density,
193 ADReal & fco2,
194 ADReal & fh2o) const;
195
197
209 void fugacityCoefficientsHighTemp(const ADReal & pressure,
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
264 ADReal activityCoefficient(const ADReal & pressure,
265 const ADReal & temperature,
266 const ADReal & Xnacl) const;
267
279 ADReal activityCoefficientHighTemp(const ADReal & temperature, const ADReal & Xnacl) const;
280
291 ADReal equilibriumConstantH2O(const ADReal & temperature) const;
292
303 ADReal equilibriumConstantCO2(const ADReal & temperature) const;
304
312 ADReal partialDensityCO2(const ADReal & temperature) const;
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
361 ADReal enthalpyOfDissolution(const ADReal & temperature) const;
362
373 void equilibriumMoleFractionsLowTemp(const ADReal & pressure,
374 const ADReal & temperature,
375 const ADReal & Xnacl,
376 ADReal & xco2,
377 ADReal & yh2o) const;
378
389 void solveEquilibriumMoleFractionHighTemp(Real pressure,
390 Real temperature,
391 Real Xnacl,
392 Real co2_density,
393 Real & xco2,
394 Real & yh2o) const;
395
396protected:
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};
DualNumber< Real, DNDerivativeType, true > ADReal
FluidStatePhaseEnum
Phase state enum.
Brine (NaCl in H2O) fluid properties as a function of pressure (Pa), temperature (K) and NaCl mass fr...
const InputParameters & parameters() const
Specialized class for brine and CO2 including calculation of mutual solubility of the two fluids usin...
void liquidProperties(const ADReal &pressure, const ADReal &temperature, const ADReal &Xnacl, std::vector< FluidStateProperties > &fsp) const
Thermophysical properties of the liquid state.
void funcABLowTemp(const ADReal &pressure, const ADReal &temperature, const ADReal &co2_density, ADReal &A, ADReal &B) const
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.
ADReal fugacityCoefficientCO2HighTemp(const ADReal &pressure, const ADReal &temperature, const ADReal &co2_density, const ADReal &xco2, const ADReal &yh2o) const
ADReal henryConstant(const ADReal &temperature, const ADReal &Xnacl) const
Henry's constant of dissolution of gas phase CO2 in brine.
const Real _Tlower
Temperature below which the Spycher, Pruess & Ennis-King (2003) model is used (K)
void gasProperties(const ADReal &pressure, const ADReal &temperature, std::vector< FluidStateProperties > &fsp) const
Thermophysical properties of the gaseous state.
const Real _Tupper
Temperature above which the Spycher & Pruess (2010) model is used (K)
const Real _invMh2o
Inverse of molar mass of H2O (mol/kg)
ADReal enthalpyOfDissolutionGas(const ADReal &temperature, const ADReal &Xnacl) const
Enthalpy of dissolution of gas phase CO2 in brine calculated using Henry's constant From Himmelblau,...
virtual void checkVariables(Real pressure, Real temperature) const
Check the input variables.
ADReal fugacityCoefficientH2OHighTemp(const ADReal &pressure, const ADReal &temperature, const ADReal &co2_density, const ADReal &xco2, const ADReal &yh2o) const
ADReal partialDensityCO2(const ADReal &temperature) const
Partial density of dissolved CO2 From Garcia, Density of aqueous solutions of CO2,...
const Real _Rbar
Molar gas constant in bar cm^3 /(K mol)
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).
ADReal activityCoefficientHighTemp(const ADReal &temperature, const ADReal &Xnacl) const
Activity coefficient for CO2 in brine used in the elevated temperature formulation.
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 Real _Mco2
Molar mass of CO2 (kg/mol)
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 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...
void funcABHighTemp(Real pressure, Real temperature, Real Xnacl, Real co2_density, Real xco2, Real yh2o, Real &A, Real &B) const
The function A (Eq.
const Real _Zmin
Minimum Z - below this value all CO2 will be dissolved.
const std::vector< Real > _co2_henry
Henry's coefficeients for CO2.
virtual std::string fluidStateName() const override
Name of FluidState.
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...
const BrineFluidProperties & _brine_fp
Fluid properties UserObject for water.
unsigned int saltComponentIndex() const
The index of the salt component.
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.
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 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.
ADReal equilibriumConstantCO2(const ADReal &temperature) const
Equilibrium constant for CO2 For temperatures 12C <= T <= 99C, uses Spycher, Pruess and Ennis-King (2...
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.
ADReal activityCoefficient(const ADReal &pressure, const ADReal &temperature, const ADReal &Xnacl) const
Activity coefficient for CO2 in brine.
const Real _Mh2o
Molar mass of water (kg/mol)
static InputParameters validParams()
const unsigned int _salt_component
Salt component index.
ADReal activityCoefficientCO2(const ADReal &temperature, const ADReal &xco2) const
Activity coefficient of CO2 Eq.
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.
const SinglePhaseFluidProperties & _co2_fp
Fluid properties UserObject for the CO2.
ADReal enthalpyOfDissolution(const ADReal &temperature) const
Enthalpy of dissolution of CO2 in brine calculated using linear fit to model of Duan and Sun,...
ADReal activityCoefficientH2O(const ADReal &temperature, const ADReal &xco2) const
Activity coefficient of H2O Eq.
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 equilibriumConstantH2O(const ADReal &temperature) const
Equilibrium constant for H2O For temperatures 12C <= T <= 99C, uses Spycher, Pruess and Ennis-King (2...
const Real _Mnacl
Molar mass of NaCL.
Compositional flash routines for miscible multiphase flow classes with multiple fluid components.
Common class for single phase fluid properties.
Water (H2O) fluid properties as a function of pressure (Pa) and temperature (K) from IAPWS-IF97: Revi...