https://mooseframework.inl.gov
PorousFlowHystereticRelativePermeabilityGas.C
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 
11 #include "PorousFlowVanGenuchten.h"
12 
14 
17 {
19  params.addRangeCheckedParam<Real>(
20  "gamma", 0.33, "gamma > 0", "Gamma parameter that is used for the gas relative permeability");
21  params.addRangeCheckedParam<Real>(
22  "k_rg_max",
23  1.0,
24  "k_rg_max > 0 & k_rg_max <= 1",
25  "Value of the gas relative permeability at liquid saturation = S_lr");
26  MooseEnum low_ext_enum("linear_like cubic", "linear_like");
27  params.addParam<MooseEnum>(
28  "gas_low_extension_type",
29  low_ext_enum,
30  "Type of extension to use for liquid saturation < S_lr for the gas relative permeability. "
31  "All extensions employ a cubic whose value is 1.0 at liquid saturation = 0, and whose "
32  "derivative is zero at liquid saturation = 0, and whose value is k_rg_max at liquid "
33  "saturation = S_lr. linear_like: the derivative at liquid_saturation = S_lr is equal to "
34  "(k_rg_max - 1) / S_lr. cubic: the derivative at liquid_saturation = S_lr equals the "
35  "derivative of the unextended drying curve at that point");
36  params.addClassDescription(
37  "PorousFlow material that computes relative permeability of the gas phase in 1-phase or "
38  "2-phase models that include hysteresis. You should ensure that the 'phase' for this "
39  "Material does indeed represent the gas phase");
40  return params;
41 }
42 
44  const InputParameters & parameters)
46  _liquid_phase(_phase_num == 0 ? 1 : 0),
47  _gamma(getParam<Real>("gamma")),
48  _k_rg_max(getParam<Real>("k_rg_max")),
49  _krel_gas_prime((getParam<MooseEnum>("gas_low_extension_type") == "linear_like")
50  ? ((_s_lr > 0) ? (_k_rg_max - 1.0) / _s_lr : 0.0)
52  _s_lr, _s_lr, 0.0, _s_gr_max, 1.0, _m, _gamma, _k_rg_max, 0.0))
53 {
54 }
55 
56 void
58 {
59  const Real sl = _saturation[_qp][_liquid_phase];
60 
61  if (_hys_order[_qp] == 0)
62  {
64  sl, _s_lr, 0.0, _s_gr_max, 1.0, _m, _gamma, _k_rg_max, _krel_gas_prime);
65  // negative in the following from d(liquid_saturation)/d(gas_saturation)
67  sl, _s_lr, 0.0, _s_gr_max, 1.0, _m, _gamma, _k_rg_max, _krel_gas_prime);
68  }
69  else
70  {
71  // following ternary deals with the case where the turning-point saturation occurs in the
72  // low-saturation region (tp_sat < _s_lr). There is "no hysteresis along the extension"
73  // according to Doughty2008, so assume that the wetting curve is the same as would occur if
74  // the turning-point saturation occured at _s_lr
75  const Real effective_liquid_tp =
76  (_hys_sat_tps[_qp].at(0) < _s_lr) ? _s_lr : _hys_sat_tps[_qp].at(0);
77  const Real s_gas_max = (_hys_sat_tps[_qp].at(0) < _s_lr) ? _s_gr_max : _s_gr_tp0[_qp];
80  _s_lr,
81  s_gas_max,
82  _s_gr_max,
83  effective_liquid_tp,
84  _m,
85  _gamma,
86  _k_rg_max,
88  // negative in the following from d(liquid_saturation)/d(gas_saturation)
91  _s_lr,
92  s_gas_max,
93  _s_gr_max,
94  effective_liquid_tp,
95  _m,
96  _gamma,
97  _k_rg_max,
99  }
100 }
const Real _s_lr
Liquid saturation at which the liquid relperm is zero and the gas relperm is k_rg_max.
const Real _krel_gas_prime
Value of the derivative of the cubic extension to the gas relative permeability at liquid saturation ...
Base material for computing relative permeability for 1-phase and 2-phase hysteretic models...
virtual void computeRelPermQp() override
Compute the relative permeability and its derivative wrt the _phase_num saturation, at the quadpoints, and store the result in _relative_permeability[_qp] and _drelative_permeability_ds[_qp].
const Real _gamma
gamma parameter used in the gas relative permeability
Real relativePermeabilityNWHys(Real sl, Real slr, Real sgrdel, Real sgrmax, Real sldel, Real m, Real gamma, Real k_rg_max, Real y0p)
Hysteretic relative permeability for gas.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
registerMooseObject("PorousFlowApp", PorousFlowHystereticRelativePermeabilityGas)
MaterialProperty< Real > & _s_gr_tp0
Computed nodal or quadpoint values the Land expression, at the turning point from primary drying to f...
van Genuchten effective saturation, capillary pressure and relative permeability functions.
Real drelativePermeabilityNWHys(Real sl, Real slr, Real sgrdel, Real sgrmax, Real sldel, Real m, Real gamma, Real k_rg_max, Real y0p)
Derivative of hysteretic relative permeability for gas with respect to the liquid saturation...
const MaterialProperty< unsigned > & _hys_order
Hysteresis order, as computed by PorousFlowHysteresisOrder.
const MaterialProperty< std::vector< Real > > & _saturation
Saturation material property.
Material to compute gas relative permeability for 1-phase and 2-phase hysteretic models.
MaterialProperty< Real > & _relative_permeability
Computed relative permeability.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
MaterialProperty< Real > & _drelative_permeability_ds
Derivative of relative permeability wrt the saturation of _phase_num (which is not necessarily the li...
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
const Real _k_rg_max
Value of the gas relative permeability at liquid saturation = _s_lr.
const MaterialProperty< std::array< Real, PorousFlowConstants::MAX_HYSTERESIS_ORDER > > & _hys_sat_tps
Saturation values at the turning points, as computed by PorousFlowHysteresisOrder.