www.mooseframework.org
PorousFlowWaterNCG.C
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 #include "PorousFlowWaterNCG.h"
12 #include "Water97FluidProperties.h"
13 #include "Conversion.h"
14 
15 registerMooseObject("PorousFlowApp", PorousFlowWaterNCG);
16 
17 template <>
18 InputParameters
20 {
21  InputParameters params = validParams<PorousFlowFluidStateMultiComponentBase>();
22  params.addRequiredParam<UserObjectName>("water_fp", "The name of the user object for water");
23  params.addRequiredParam<UserObjectName>(
24  "gas_fp", "The name of the user object for the non-condensable gas");
25  params.addClassDescription("Fluid state class for water and non-condensable gas");
26  return params;
27 }
28 
29 PorousFlowWaterNCG::PorousFlowWaterNCG(const InputParameters & parameters)
31  _water_fp(getUserObject<SinglePhaseFluidProperties>("water_fp")),
32  _water97_fp(getUserObject<Water97FluidProperties>("water_fp")),
33  _ncg_fp(getUserObject<SinglePhaseFluidProperties>("gas_fp")),
34  _Mh2o(_water_fp.molarMass()),
35  _Mncg(_ncg_fp.molarMass()),
36  _water_triple_temperature(_water_fp.triplePointTemperature()),
37  _water_critical_temperature(_water_fp.criticalTemperature()),
38  _ncg_henry(_ncg_fp.henryCoefficients())
39 {
40  // Check that the correct FluidProperties UserObjects have been provided
41  if (_water_fp.fluidName() != "water")
42  paramError("water_fp", "A valid water FluidProperties UserObject must be provided in water_fp");
43 
44  // Set the number of phases and components, and their indexes
45  _num_phases = 2;
46  _num_components = 2;
49 
50  // Check that _aqueous_phase_number is <= total number of phases
52  paramError("liquid_phase_number",
53  "This value is larger than the possible number of phases ",
54  _num_phases);
55 
56  // Check that _aqueous_fluid_component is <= total number of fluid components
58  paramError("liquid_fluid_component",
59  "This value is larger than the possible number of fluid components",
61 
63 }
64 
65 std::string
67 {
68  return "water-ncg";
69 }
70 
71 void
73  Real temperature,
74  Real /* Xnacl */,
75  Real Z,
76  unsigned int qp,
77  std::vector<FluidStateProperties> & fsp) const
78 {
81 
82  // Check whether the input temperature is within the region of validity
84 
85  // AD versions of primary variables
86  DualReal p = pressure;
87  Moose::derivInsert(p.derivatives(), _pidx, 1.0);
88  DualReal T = temperature;
89  Moose::derivInsert(T.derivatives(), _Tidx, 1.0);
90  DualReal Zncg = Z;
91  Moose::derivInsert(Zncg.derivatives(), _Zidx, 1.0);
92 
93  // Clear all of the FluidStateProperties data
95 
96  FluidStatePhaseEnum phase_state;
97  massFractions(p, T, Zncg, phase_state, fsp);
98 
99  switch (phase_state)
100  {
102  {
103  // Set the gas saturations
104  gas.saturation = 1.0;
105 
106  // Calculate gas properties
107  gasProperties(p, T, fsp);
108 
109  break;
110  }
111 
113  {
114  // Calculate the liquid properties
115  const DualReal liquid_pressure = p - _pc.capillaryPressure(1.0, qp);
116  liquidProperties(liquid_pressure, T, fsp);
117 
118  break;
119  }
120 
122  {
123  // Calculate the gas and liquid properties in the two phase region
124  twoPhaseProperties(p, T, Zncg, qp, fsp);
125 
126  break;
127  }
128  }
129 
130  // Liquid saturations can now be set
131  liquid.saturation = 1.0 - gas.saturation;
132 
133  // Save pressures to FluidStateProperties object
134  gas.pressure = p;
135  liquid.pressure = p - _pc.capillaryPressure(liquid.saturation, qp);
136 }
137 
138 void
140  const DualReal & temperature,
141  const DualReal & Z,
142  FluidStatePhaseEnum & phase_state,
143  std::vector<FluidStateProperties> & fsp) const
144 {
147 
148  // Equilibrium mass fraction of NCG in liquid and H2O in gas phases
149  DualReal Xncg, Yh2o;
151 
152  DualReal Yncg = 1.0 - Yh2o;
153 
154  // Determine which phases are present based on the value of Z
155  phaseState(Z.value(), Xncg.value(), Yncg.value(), phase_state);
156 
157  // The equilibrium mass fractions calculated above are only correct in the two phase
158  // state. If only liquid or gas phases are present, the mass fractions are given by
159  // the total mass fraction Z.
160  DualReal Xh2o = 0.0;
161 
162  switch (phase_state)
163  {
165  {
166  Xncg = Z;
167  Yncg = 0.0;
168  Xh2o = 1.0 - Z;
169  Yh2o = 0.0;
170  Moose::derivInsert(Xncg.derivatives(), _pidx, 0.0);
171  Moose::derivInsert(Xncg.derivatives(), _Tidx, 0.0);
172  Moose::derivInsert(Xncg.derivatives(), _Zidx, 1.0);
173  break;
174  }
175 
177  {
178  Xncg = 0.0;
179  Yncg = Z;
180  Yh2o = 1.0 - Z;
181  Moose::derivInsert(Yncg.derivatives(), _pidx, 0.0);
182  Moose::derivInsert(Yncg.derivatives(), _Tidx, 0.0);
183  Moose::derivInsert(Yncg.derivatives(), _Zidx, 1.0);
184  break;
185  }
186 
188  {
189  // Keep equilibrium mass fractions
190  Xh2o = 1.0 - Xncg;
191  break;
192  }
193  }
194 
195  // Save the mass fractions in the FluidStateMassFractions object
197  liquid.mass_fraction[_gas_fluid_component] = Xncg;
200 }
201 
202 void
204  const DualReal & temperature,
205  std::vector<FluidStateProperties> & fsp) const
206 {
209 
210  const DualReal psat = _water_fp.vaporPressure(temperature);
211 
212  const DualReal Yncg = gas.mass_fraction[_gas_fluid_component];
213  const DualReal Xncg = liquid.mass_fraction[_gas_fluid_component];
214 
215  // NCG density, viscosity and enthalpy calculated using partial pressure
216  // Yncg * gas_poreressure (Dalton's law)
217  DualReal ncg_density, ncg_viscosity;
218  _ncg_fp.rho_mu_from_p_T(Yncg * pressure, temperature, ncg_density, ncg_viscosity);
219  DualReal ncg_enthalpy = _ncg_fp.h_from_p_T(Yncg * pressure, temperature);
220 
221  // Vapor density, viscosity and enthalpy calculated using partial pressure
222  // X1 * psat (Raoult's law)
223  DualReal vapor_density, vapor_viscosity;
224 
225  _water_fp.rho_mu_from_p_T((1.0 - Xncg) * psat, temperature, vapor_density, vapor_viscosity);
226  DualReal vapor_enthalpy = _water_fp.h_from_p_T((1.0 - Xncg) * psat, temperature);
227 
228  // Density is just the sum of individual component densities
229  gas.density = ncg_density + vapor_density;
230 
231  // Viscosity of the gas phase is a weighted sum of the individual viscosities
232  gas.viscosity = Yncg * ncg_viscosity + (1.0 - Yncg) * vapor_viscosity;
233 
234  // Enthalpy of the gas phase is a weighted sum of the individual enthalpies
235  gas.enthalpy = Yncg * ncg_enthalpy + (1.0 - Yncg) * vapor_enthalpy;
236 
237  // Internal energy of the gas phase (e = h - pv)
238  mooseAssert(gas.density.value() > 0.0, "Gas density must be greater than zero");
239  gas.internal_energy = gas.enthalpy - pressure / gas.density;
240 }
241 
242 void
244  const DualReal & temperature,
245  std::vector<FluidStateProperties> & fsp) const
246 {
248 
249  // Calculate liquid density and viscosity if in the two phase or single phase
250  // liquid region, assuming they are not affected by the presence of dissolved
251  // NCG. Note: the (small) contribution due to derivative of capillary pressure
252  // wrt pressure (using the chain rule) is not implemented.
253  DualReal liquid_density, liquid_viscosity;
254  _water_fp.rho_mu_from_p_T(pressure, temperature, liquid_density, liquid_viscosity);
255 
256  liquid.density = liquid_density;
257  liquid.viscosity = liquid_viscosity;
258 
259  // Enthalpy does include a contribution due to the enthalpy of dissolution
260  const DualReal hdis = enthalpyOfDissolution(temperature);
261 
262  const DualReal water_enthalpy = _water_fp.h_from_p_T(pressure, temperature);
263  const DualReal ncg_enthalpy = _ncg_fp.h_from_p_T(pressure, temperature);
264 
265  const DualReal Xncg = liquid.mass_fraction[_gas_fluid_component];
266  liquid.enthalpy = (1.0 - Xncg) * water_enthalpy + Xncg * (ncg_enthalpy + hdis);
267 
268  // Internal energy of the liquid phase (e = h - pv)
269  mooseAssert(liquid.density.value() > 0.0, "Liquid density must be greater than zero");
270  liquid.internal_energy = liquid.enthalpy - pressure / liquid.density;
271 }
272 
273 DualReal
274 PorousFlowWaterNCG::liquidDensity(const DualReal & pressure, const DualReal & temperature) const
275 {
276  return _water_fp.rho_from_p_T(pressure, temperature);
277 }
278 
279 DualReal
281  const DualReal & temperature,
282  std::vector<FluidStateProperties> & fsp) const
283 {
284  auto & liquid = fsp[_aqueous_phase_number];
285  auto & gas = fsp[_gas_phase_number];
286 
287  DualReal psat = _water_fp.vaporPressure(temperature);
288 
289  const DualReal Yncg = gas.mass_fraction[_gas_fluid_component];
290  const DualReal Xncg = liquid.mass_fraction[_gas_fluid_component];
291 
292  DualReal ncg_density = _ncg_fp.rho_from_p_T(Yncg * pressure, temperature);
293  DualReal vapor_density = _water_fp.rho_from_p_T((1.0 - Xncg) * psat, temperature);
294 
295  // Density is just the sum of individual component densities
296  return ncg_density + vapor_density;
297 }
298 
299 DualReal
301  const DualReal & temperature,
302  const DualReal & Z,
303  std::vector<FluidStateProperties> & fsp) const
304 {
305  auto & gas = fsp[_gas_phase_number];
306  auto & liquid = fsp[_aqueous_fluid_component];
307 
308  // Approximate liquid density as saturation isn't known yet, by using the gas
309  // pressure rather than the liquid pressure. This does result in a small error
310  // in the calculated saturation, but this is below the error associated with
311  // the correlations. A more accurate saturation could be found iteraviely,
312  // at the cost of increased computational expense
313 
314  // The gas and liquid densities
315  const DualReal gas_density = gasDensity(pressure, temperature, fsp);
316  const DualReal liquid_density = liquidDensity(pressure, temperature);
317 
318  // Set mass equilibrium constants used in the calculation of vapor mass fraction
319  const DualReal Xncg = liquid.mass_fraction[_gas_fluid_component];
320  const DualReal Yncg = gas.mass_fraction[_gas_fluid_component];
321 
322  const DualReal K0 = Yncg / Xncg;
323  const DualReal K1 = (1.0 - Yncg) / (1.0 - Xncg);
324  const DualReal vapor_mass_fraction = vaporMassFraction(Z, K0, K1);
325 
326  // The gas saturation in the two phase case
327  const DualReal saturation = vapor_mass_fraction * liquid_density /
328  (gas_density + vapor_mass_fraction * (liquid_density - gas_density));
329 
330  return saturation;
331 }
332 
333 void
335  const DualReal & temperature,
336  const DualReal & Z,
337  unsigned int qp,
338  std::vector<FluidStateProperties> & fsp) const
339 {
340  auto & gas = fsp[_gas_phase_number];
341 
342  // Calculate all of the gas phase properties, as these don't depend on saturation
344 
345  // The gas saturation in the two phase case
346  gas.saturation = saturation(pressure, temperature, Z, fsp);
347 
348  // The liquid pressure and properties can now be calculated
349  const DualReal liquid_pressure = pressure - _pc.capillaryPressure(1.0 - gas.saturation, qp);
350  liquidProperties(liquid_pressure, temperature, fsp);
351 }
352 
353 void
355  const DualReal & temperature,
356  DualReal & Xncg,
357  DualReal & Yh2o) const
358 {
359  // Equilibrium constants for each component (Henry's law for the NCG
360  // component, and Raoult's law for water).
361  const DualReal Kh = _water97_fp.henryConstant(temperature, _ncg_henry);
362  const DualReal psat = _water_fp.vaporPressure(temperature);
363 
364  const DualReal Kncg = Kh / pressure;
365  const DualReal Kh2o = psat / pressure;
366 
367  // The mole fractions for the NCG component in the two component
368  // case can be expressed in terms of the equilibrium constants only
369  const DualReal xncg = (1.0 - Kh2o) / (Kncg - Kh2o);
370  const DualReal yncg = Kncg * xncg;
371 
372  // Convert mole fractions to mass fractions
373  Xncg = moleFractionToMassFraction(xncg);
374  Yh2o = 1.0 - moleFractionToMassFraction(yncg);
375 }
376 
377 DualReal
379 {
380  return xmol * _Mncg / (xmol * _Mncg + (1.0 - xmol) * _Mh2o);
381 }
382 
383 void
385 {
386  // Check whether the input temperature is within the region of validity of this equation
387  // of state (T_triple <= T <= T_critical)
388  if (temperature < _water_triple_temperature || temperature > _water_critical_temperature)
389  mooseException(name() + ": temperature " + Moose::stringify(temperature) +
390  " is outside range 273.16 K <= T <= 647.096 K");
391 }
392 
393 DualReal
395 {
396  // Henry's constant
397  const DualReal Kh = _water97_fp.henryConstant(temperature, _ncg_henry);
398 
399  DualReal hdis = -_R * temperature * temperature * Kh.derivatives()[_Tidx] / Kh / _Mncg;
400 
401  // Derivative of enthalpy of dissolution wrt temperature requires the second derivative of
402  // Henry's constant wrt temperature. For simplicity, approximate this numerically
403  const Real dT = temperature.value() * 1.0e-8;
404  const DualReal t2 = temperature + dT;
405  const DualReal Kh2 = _water97_fp.henryConstant(t2, _ncg_henry);
406 
407  const Real dhdis_dT =
408  (-_R * t2 * t2 * Kh2.derivatives()[_Tidx] / Kh2 / _Mncg - hdis).value() / dT;
409 
410  hdis.derivatives() = temperature.derivatives() * dhdis_dT;
411 
412  return hdis;
413 }
414 
415 Real
417  Real pressure, Real temperature, Real /* Xnacl */, Real saturation, unsigned int qp) const
418 {
419  // Check whether the input temperature is within the region of validity
421 
422  // As we do not require derivatives, we can simply ignore their initialisation
423  const DualReal p = pressure;
424  const DualReal T = temperature;
425 
426  // FluidStateProperties data structure
427  std::vector<FluidStateProperties> fsp(_num_phases, FluidStateProperties(_num_components));
428  auto & liquid = fsp[_aqueous_phase_number];
429  auto & gas = fsp[_gas_phase_number];
430 
431  // Calculate equilibrium mass fractions in the two-phase state
432  DualReal Xncg, Yh2o;
433  equilibriumMassFractions(p, T, Xncg, Yh2o);
434 
435  // Save the mass fractions in the FluidStateMassFractions object to calculate gas density
436  const DualReal Yncg = 1.0 - Yh2o;
437  liquid.mass_fraction[_aqueous_fluid_component] = 1.0 - Xncg;
438  liquid.mass_fraction[_gas_fluid_component] = Xncg;
439  gas.mass_fraction[_aqueous_fluid_component] = Yh2o;
440  gas.mass_fraction[_gas_fluid_component] = Yncg;
441 
442  // Gas density
443  const Real gas_density = gasDensity(p, T, fsp).value();
444 
445  // Liquid density
446  const DualReal liquid_pressure = p - _pc.capillaryPressure(1.0 - saturation, qp);
447  const Real liquid_density = liquidDensity(liquid_pressure, T).value();
448 
449  // The total mass fraction of ncg (Z) can now be calculated
450  const Real Z = (saturation * gas_density * Yncg.value() +
451  (1.0 - saturation) * liquid_density * Xncg.value()) /
452  (saturation * gas_density + (1.0 - saturation) * liquid_density);
453 
454  return Z;
455 }
PorousFlowWaterNCG::liquidDensity
DualReal liquidDensity(const DualReal &pressure, const DualReal &temperature) const
Density of the liquid phase Note: The pressure here is the gas pressure.
Definition: PorousFlowWaterNCG.C:274
SinglePhaseFluidProperties::rho_mu_from_p_T
virtual void rho_mu_from_p_T(Real p, Real T, Real &rho, Real &mu) const
Combined methods.
Definition: SinglePhaseFluidProperties.C:256
PorousFlowFluidStateBase::_empty_fsp
FluidStateProperties _empty_fsp
Empty FluidStateProperties object.
Definition: PorousFlowFluidStateBase.h:139
PorousFlowWaterNCG::moleFractionToMassFraction
DualReal moleFractionToMassFraction(const DualReal &xmol) const
Convert mole fraction to mass fraction.
Definition: PorousFlowWaterNCG.C:378
PorousFlowFluidStateBase::_gas_phase_number
unsigned int _gas_phase_number
Phase number of the gas phase.
Definition: PorousFlowFluidStateBase.h:125
SinglePhaseFluidProperties
Common class for single phase fluid properties.
Definition: SinglePhaseFluidProperties.h:89
PorousFlowWaterNCG::_ncg_fp
const SinglePhaseFluidProperties & _ncg_fp
Fluid properties UserObject for the NCG.
Definition: PorousFlowWaterNCG.h:190
PorousFlowFluidStateMultiComponentBase
Compositional flash routines for miscible multiphase flow classes with multiple fluid components.
Definition: PorousFlowFluidStateMultiComponentBase.h:23
PorousFlowFluidStateBase::_pc
const PorousFlowCapillaryPressure & _pc
Capillary pressure UserObject.
Definition: PorousFlowFluidStateBase.h:137
PorousFlowWaterNCG::saturation
DualReal saturation(const DualReal &pressure, const DualReal &temperature, const DualReal &Z, std::vector< FluidStateProperties > &fsp) const
Gas saturation in the two-phase region.
Definition: PorousFlowWaterNCG.C:300
FluidStateProperties::density
DualReal density
Definition: PorousFlowFluidStateBase.h:42
FluidStateProperties::pressure
DualReal pressure
Definition: PorousFlowFluidStateBase.h:37
PorousFlowWaterNCG::gasDensity
DualReal gasDensity(const DualReal &pressure, const DualReal &temperature, std::vector< FluidStateProperties > &fsp) const
Density of the gas phase.
Definition: PorousFlowWaterNCG.C:280
PorousFlowWaterNCG::twoPhaseProperties
void twoPhaseProperties(const DualReal &pressure, const DualReal &temperature, const DualReal &Z, unsigned int qp, std::vector< FluidStateProperties > &fsp) const
Gas and liquid properties in the two-phase region.
Definition: PorousFlowWaterNCG.C:334
SinglePhaseFluidProperties.h
PorousFlowWaterNCG::enthalpyOfDissolution
DualReal enthalpyOfDissolution(const DualReal &temperature) const
Enthalpy of dissolution of NCG in water calculated using Henry's constant From Himmelblau,...
Definition: PorousFlowWaterNCG.C:394
FluidStatePhaseEnum
FluidStatePhaseEnum
Phase state enum.
Definition: PorousFlowFluidStateBase.h:18
FluidStateProperties::enthalpy
DualReal enthalpy
Definition: PorousFlowFluidStateBase.h:44
PorousFlowWaterNCG::fluidStateName
virtual std::string fluidStateName() const override
Name of FluidState.
Definition: PorousFlowWaterNCG.C:66
FluidStateProperties::mass_fraction
std::vector< DualReal > mass_fraction
Definition: PorousFlowFluidStateBase.h:46
PorousFlowWaterNCG::_water_fp
const SinglePhaseFluidProperties & _water_fp
Fluid properties UserObject for water.
Definition: PorousFlowWaterNCG.h:186
registerMooseObject
registerMooseObject("PorousFlowApp", PorousFlowWaterNCG)
Water97FluidProperties::henryConstant
Real henryConstant(Real temperature, const std::vector< Real > &coeffs) const
IAPWS formulation of Henry's law constant for dissolution in water From Guidelines on the Henry's con...
Definition: Water97FluidProperties.C:1866
PorousFlowFluidStateMultiComponentBase::_Tidx
const unsigned int _Tidx
Index of derivative wrt temperature.
Definition: PorousFlowFluidStateMultiComponentBase.h:81
PorousFlowWaterNCG::liquidProperties
void liquidProperties(const DualReal &pressure, const DualReal &temperature, std::vector< FluidStateProperties > &fsp) const
Liquid properties - density, viscosity and enthalpy Note: The pressure here is the liquid pressure.
Definition: PorousFlowWaterNCG.C:243
PorousFlowFluidStateFlash::vaporMassFraction
Real vaporMassFraction(Real Z0, Real K0, Real K1) const
Solves Rachford-Rice equation to provide vapor mass fraction.
Definition: PorousFlowFluidStateFlash.C:81
PorousFlowWaterNCG::_Mh2o
const Real _Mh2o
Molar mass of water (kg/mol)
Definition: PorousFlowWaterNCG.h:192
PorousFlowFluidStateBase::_gas_fluid_component
unsigned int _gas_fluid_component
Fluid component number of the gas phase.
Definition: PorousFlowFluidStateBase.h:129
FluidStatePhaseEnum::LIQUID
PorousFlowFluidStateMultiComponentBase::_Zidx
const unsigned int _Zidx
Index of derivative wrt total mass fraction Z.
Definition: PorousFlowFluidStateMultiComponentBase.h:79
PorousFlowWaterNCG::_water_critical_temperature
const Real _water_critical_temperature
Critical temperature of water (K)
Definition: PorousFlowWaterNCG.h:198
PorousFlowWaterNCG::gasProperties
void gasProperties(const DualReal &pressure, const DualReal &temperature, std::vector< FluidStateProperties > &fsp) const
Gas properties - density, viscosity and enthalpy.
Definition: PorousFlowWaterNCG.C:203
FluidStateProperties
AD data structure to pass calculated thermophysical properties.
Definition: PorousFlowFluidStateBase.h:26
PorousFlowWaterNCG::checkVariables
void checkVariables(Real temperature) const
Check that the temperature is between the triple and critical values.
Definition: PorousFlowWaterNCG.C:384
PorousFlowCapillaryPressure::capillaryPressure
virtual Real capillaryPressure(Real saturation, unsigned qp=0) const
Capillary pressure is calculated as a function of true saturation.
Definition: PorousFlowCapillaryPressure.C:64
PorousFlowFluidStateBase::_aqueous_phase_number
const unsigned int _aqueous_phase_number
Phase number of the aqueous phase.
Definition: PorousFlowFluidStateBase.h:123
PorousFlowFluidStateBase::_num_phases
unsigned int _num_phases
Number of phases.
Definition: PorousFlowFluidStateBase.h:119
Water97FluidProperties
Water (H2O) fluid properties as a function of pressure (Pa) and temperature (K) from IAPWS-IF97: Revi...
Definition: Water97FluidProperties.h:42
PorousFlowWaterNCG::equilibriumMassFractions
void equilibriumMassFractions(const DualReal &pressure, const DualReal &temperature, DualReal &Xncg, DualReal &Yh2o) const
Mass fractions of NCG in liquid phase and H2O in gas phase at thermodynamic equilibrium.
Definition: PorousFlowWaterNCG.C:354
PorousFlowWaterNCG::totalMassFraction
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 ...
Definition: PorousFlowWaterNCG.C:416
SinglePhaseFluidProperties::vaporPressure
virtual Real vaporPressure(Real T) const
Vapor pressure.
Definition: SinglePhaseFluidProperties.C:177
name
const std::string name
Definition: Setup.h:21
PorousFlowWaterNCG::PorousFlowWaterNCG
PorousFlowWaterNCG(const InputParameters &parameters)
Definition: PorousFlowWaterNCG.C:29
PorousFlowWaterNCG
Specialized class for water and a non-condensable gas (NCG) Includes dissolution of gas in liquid wat...
Definition: PorousFlowWaterNCG.h:33
PorousFlowWaterNCG::_Mncg
const Real _Mncg
Molar mass of non-condensable gas (kg/mol)
Definition: PorousFlowWaterNCG.h:194
PorousFlowFluidStateBase::_num_components
unsigned int _num_components
Number of components.
Definition: PorousFlowFluidStateBase.h:121
validParams< PorousFlowFluidStateMultiComponentBase >
InputParameters validParams< PorousFlowFluidStateMultiComponentBase >()
Definition: PorousFlowFluidStateMultiComponentBase.C:14
PorousFlowWaterNCG::thermophysicalProperties
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.
Definition: PorousFlowWaterNCG.C:72
FluidStatePhaseEnum::TWOPHASE
PorousFlowWaterNCG::_water97_fp
const Water97FluidProperties & _water97_fp
Fluid properties UserObject for water (used to access Henry's law)
Definition: PorousFlowWaterNCG.h:188
PorousFlowFluidStateBase::clearFluidStateProperties
void clearFluidStateProperties(std::vector< FluidStateProperties > &fsp) const
Clears the contents of the FluidStateProperties data structure.
Definition: PorousFlowFluidStateBase.C:39
FluidStatePhaseEnum::GAS
PorousFlowWaterNCG.h
FluidStateProperties::internal_energy
DualReal internal_energy
Definition: PorousFlowFluidStateBase.h:45
PorousFlowFluidStateBase::_aqueous_fluid_component
const unsigned int _aqueous_fluid_component
Fluid component number of the aqueous component.
Definition: PorousFlowFluidStateBase.h:127
NS::temperature
const std::string temperature
Definition: NS.h:26
FluidStateProperties::viscosity
DualReal viscosity
Definition: PorousFlowFluidStateBase.h:43
PorousFlowWaterNCG::massFractions
void massFractions(const DualReal &pressure, const DualReal &temperature, const DualReal &Z, FluidStatePhaseEnum &phase_state, std::vector< FluidStateProperties > &fsp) const
Mass fractions of NCG and H2O in both phases, as well as derivatives wrt PorousFlow variables.
Definition: PorousFlowWaterNCG.C:139
Water97FluidProperties.h
FluidStateProperties::saturation
DualReal saturation
Definition: PorousFlowFluidStateBase.h:41
PorousFlowFluidStateMultiComponentBase::_pidx
const unsigned int _pidx
Index of derivative wrt pressure.
Definition: PorousFlowFluidStateMultiComponentBase.h:73
validParams< PorousFlowWaterNCG >
InputParameters validParams< PorousFlowWaterNCG >()
Definition: PorousFlowWaterNCG.C:19
PorousFlowFluidStateBase::_R
const Real _R
Universal gas constant (J/mol/K)
Definition: PorousFlowFluidStateBase.h:133
PorousFlowWaterNCG::_ncg_henry
const std::vector< Real > _ncg_henry
Henry's coefficients for the NCG.
Definition: PorousFlowWaterNCG.h:200
NS::pressure
const std::string pressure
Definition: NS.h:25
PorousFlowFluidStateMultiComponentBase::phaseState
void phaseState(Real Zi, Real Xi, Real Yi, FluidStatePhaseEnum &phase_state) const
Determines the phase state gven the total mass fraction and equilibrium mass fractions.
Definition: PorousFlowFluidStateMultiComponentBase.C:28