https://mooseframework.inl.gov
PorousFlowWaterNCG.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 
16 
30 {
31 public:
33 
35 
36  virtual std::string fluidStateName() const override;
37 
40  Real Xnacl,
41  Real Z,
42  unsigned int qp,
43  std::vector<FluidStateProperties> & fsp) const override;
44 
46  const ADReal & temperature,
47  const ADReal & Xnacl,
48  const ADReal & Z,
49  unsigned int qp,
50  std::vector<FluidStateProperties> & fsp) const override;
62  const ADReal & temperature,
63  ADReal & Xncg,
64  ADReal & Yh2o) const;
65 
76  void massFractions(const ADReal & pressure,
77  const ADReal & temperature,
78  const ADReal & Z,
79  FluidStatePhaseEnum & phase_state,
80  std::vector<FluidStateProperties> & fsp) const;
81 
89  void gasProperties(const ADReal & pressure,
90  const ADReal & temperature,
91  std::vector<FluidStateProperties> & fsp) const;
105  void liquidProperties(const ADReal & pressure,
106  const ADReal & temperature,
107  std::vector<FluidStateProperties> & fsp) const;
108 
121  ADReal liquidDensity(const ADReal & pressure, const ADReal & temperature) const;
122 
131  const ADReal & temperature,
132  std::vector<FluidStateProperties> & fsp) const;
133 
144  const ADReal & temperature,
145  const ADReal & Z,
146  std::vector<FluidStateProperties> & fsp) const;
147 
157  void twoPhaseProperties(const ADReal & pressure,
158  const ADReal & temperature,
159  const ADReal & Z,
160  unsigned int qp,
161  std::vector<FluidStateProperties> & fsp) const;
162 
172 
173  virtual Real totalMassFraction(
174  Real pressure, Real temperature, Real Xnacl, Real saturation, unsigned int qp) const override;
175 
176 protected:
182  ADReal moleFractionToMassFraction(const ADReal & xmol) const;
183 
188  void checkVariables(Real temperature) const;
189 
197  const Real _Mh2o;
199  const Real _Mncg;
205  const std::vector<Real> _ncg_henry;
206 };
void massFractions(const ADReal &pressure, const ADReal &temperature, const ADReal &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...
virtual std::string fluidStateName() const override
Name of FluidState.
void equilibriumMassFractions(const ADReal &pressure, const ADReal &temperature, ADReal &Xncg, ADReal &Yh2o) const
Mass fractions of NCG in liquid phase and H2O in gas phase at thermodynamic equilibrium.
const std::vector< Real > _ncg_henry
Henry&#39;s coefficients for the NCG.
void liquidProperties(const ADReal &pressure, const ADReal &temperature, std::vector< FluidStateProperties > &fsp) const
Liquid properties - density, viscosity and enthalpy Note: The pressure here is the liquid pressure...
ADReal moleFractionToMassFraction(const ADReal &xmol) const
Convert mole fraction to mass fraction.
Compositional flash routines for miscible multiphase flow classes with multiple fluid components...
static const std::string temperature
Definition: NS.h:59
void twoPhaseProperties(const ADReal &pressure, const ADReal &temperature, const ADReal &Z, unsigned int qp, std::vector< FluidStateProperties > &fsp) const
Gas and liquid properties in the two-phase region.
ADReal saturation(const ADReal &pressure, const ADReal &temperature, const ADReal &Z, std::vector< FluidStateProperties > &fsp) const
Gas saturation in the two-phase region.
const SinglePhaseFluidProperties & _water_fp
Fluid properties UserObject for water.
PorousFlowWaterNCG(const InputParameters &parameters)
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...
const Water97FluidProperties & _water97_fp
Fluid properties UserObject for water (used to access Henry&#39;s law)
Common class for single phase fluid properties.
FluidStatePhaseEnum
Phase state enum.
ADReal enthalpyOfDissolution(const ADReal &temperature) const
Enthalpy of dissolution of NCG in water calculated using Henry&#39;s constant From Himmelblau, Partial molal heats and entropies of solution for gases dissolved in water from the freezing to the near critical point, J.
ADReal gasDensity(const ADReal &pressure, const ADReal &temperature, std::vector< FluidStateProperties > &fsp) const
Density of the gas phase.
const Real _Mh2o
Molar mass of water (kg/mol)
Specialized class for water and a non-condensable gas (NCG) Includes dissolution of gas in liquid wat...
const Real _water_triple_temperature
Triple point temperature of water (K)
const Real _water_critical_temperature
Critical temperature of water (K)
static const std::string Z
Definition: NS.h:169
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
void checkVariables(Real temperature) const
Check that the temperature is between the triple and critical values.
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 ...
Water (H2O) fluid properties as a function of pressure (Pa) and temperature (K) from IAPWS-IF97: Revi...
static const std::string pressure
Definition: NS.h:56
ADReal liquidDensity(const ADReal &pressure, const ADReal &temperature) const
Density of the liquid phase Note: The pressure here is the gas pressure.
const Real _Mncg
Molar mass of non-condensable gas (kg/mol)
const InputParameters & parameters() const
void gasProperties(const ADReal &pressure, const ADReal &temperature, std::vector< FluidStateProperties > &fsp) const
Gas properties - density, viscosity and enthalpy.
const SinglePhaseFluidProperties & _ncg_fp
Fluid properties UserObject for the NCG.