Line data Source code
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 : #include "PorousFlowHystereticRelativePermeabilityGas.h"
11 : #include "PorousFlowVanGenuchten.h"
12 :
13 : registerMooseObject("PorousFlowApp", PorousFlowHystereticRelativePermeabilityGas);
14 :
15 : InputParameters
16 178 : PorousFlowHystereticRelativePermeabilityGas::validParams()
17 : {
18 178 : InputParameters params = PorousFlowHystereticRelativePermeabilityBase::validParams();
19 534 : params.addRangeCheckedParam<Real>(
20 356 : "gamma", 0.33, "gamma > 0", "Gamma parameter that is used for the gas relative permeability");
21 534 : params.addRangeCheckedParam<Real>(
22 : "k_rg_max",
23 356 : 1.0,
24 : "k_rg_max > 0 & k_rg_max <= 1",
25 : "Value of the gas relative permeability at liquid saturation = S_lr");
26 356 : MooseEnum low_ext_enum("linear_like cubic", "linear_like");
27 356 : 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 178 : 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 178 : return params;
41 178 : }
42 :
43 138 : PorousFlowHystereticRelativePermeabilityGas::PorousFlowHystereticRelativePermeabilityGas(
44 138 : const InputParameters & parameters)
45 : : PorousFlowHystereticRelativePermeabilityBase(parameters),
46 276 : _liquid_phase(_phase_num == 0 ? 1 : 0),
47 276 : _gamma(getParam<Real>("gamma")),
48 276 : _k_rg_max(getParam<Real>("k_rg_max")),
49 414 : _krel_gas_prime((getParam<MooseEnum>("gas_low_extension_type") == "linear_like")
50 138 : ? ((_s_lr > 0) ? (_k_rg_max - 1.0) / _s_lr : 0.0)
51 30 : : PorousFlowVanGenuchten::drelativePermeabilityNWHys(
52 168 : _s_lr, _s_lr, 0.0, _s_gr_max, 1.0, _m, _gamma, _k_rg_max, 0.0))
53 : {
54 138 : }
55 :
56 : void
57 16848 : PorousFlowHystereticRelativePermeabilityGas::computeRelPermQp()
58 : {
59 16848 : const Real sl = _saturation[_qp][_liquid_phase];
60 :
61 16848 : if (_hys_order[_qp] == 0)
62 : {
63 9064 : _relative_permeability[_qp] = PorousFlowVanGenuchten::relativePermeabilityNWHys(
64 9064 : 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)
66 9064 : _drelative_permeability_ds[_qp] = -PorousFlowVanGenuchten::drelativePermeabilityNWHys(
67 9064 : 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 7784 : (_hys_sat_tps[_qp].at(0) < _s_lr) ? _s_lr : _hys_sat_tps[_qp].at(0);
77 7784 : const Real s_gas_max = (_hys_sat_tps[_qp].at(0) < _s_lr) ? _s_gr_max : _s_gr_tp0[_qp];
78 7784 : _relative_permeability[_qp] =
79 7784 : PorousFlowVanGenuchten::relativePermeabilityNWHys(sl,
80 : _s_lr,
81 : s_gas_max,
82 7784 : _s_gr_max,
83 : effective_liquid_tp,
84 7784 : _m,
85 7784 : _gamma,
86 7784 : _k_rg_max,
87 7784 : _krel_gas_prime);
88 : // negative in the following from d(liquid_saturation)/d(gas_saturation)
89 7784 : _drelative_permeability_ds[_qp] =
90 7784 : -PorousFlowVanGenuchten::drelativePermeabilityNWHys(sl,
91 7784 : _s_lr,
92 : s_gas_max,
93 7784 : _s_gr_max,
94 : effective_liquid_tp,
95 7784 : _m,
96 7784 : _gamma,
97 7784 : _k_rg_max,
98 7784 : _krel_gas_prime);
99 : }
100 16848 : }
|