https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowHystereticRelativePermeabilityLiquid.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
12
14
17{
19 params.addRangeCheckedParam<Real>(
20 "liquid_modification_range",
21 0.9,
22 "liquid_modification_range > 0 & liquid_modification_range <= 1",
23 "The wetting liquid relative permeability will be a cubic between S_l = "
24 "liquid_modification_range * (1 - S_gr_Del) and S_l = 1.0 - 0.5 * S_gr_Del");
26 "PorousFlow material that computes relative permeability of the liquid phase in 1-phase or "
27 "2-phase models that include hysteresis. You should ensure that the 'phase' for this "
28 "Material does indeed represent the liquid phase");
29 return params;
30}
31
33 const InputParameters & parameters)
35 _liquid_phase(_phase_num),
36 _liquid_modification_range(getParam<Real>("liquid_modification_range")),
37 _kl_begin(_nodal_material ? declareProperty<Real>("PorousFlow_hysteresis_kr_l_begin_nodal")
38 : declareProperty<Real>("PorousFlow_hysteresis_kr_l_begin_qp")),
39 _klp_begin(_nodal_material ? declareProperty<Real>("PorousFlow_hysteresis_krp_l_begin_nodal")
40 : declareProperty<Real>("PorousFlow_hysteresis_krp_l_begin_qp")),
41 _kl_end(_nodal_material ? declareProperty<Real>("PorousFlow_hysteresis_kr_l_end_nodal")
42 : declareProperty<Real>("PorousFlow_hysteresis_kr_l_end_qp")),
43 _klp_end(_nodal_material ? declareProperty<Real>("PorousFlow_hysteresis_krp_l_end_nodal")
44 : declareProperty<Real>("PorousFlow_hysteresis_krp_l_end_qp"))
45{
46}
47
48void
50{
51 const Real sl = _saturation[_qp][_liquid_phase];
52
53 if (_hys_order[_qp] == 0)
54 {
56 sl, _s_lr, 0.0, _s_gr_max, 1.0, _m, _liquid_modification_range, 0.0, 0.0, 0.0, 0.0);
58 sl, _s_lr, 0.0, _s_gr_max, 1.0, _m, _liquid_modification_range, 0.0, 0.0, 0.0, 0.0);
59 }
60 else
61 {
62 // following ternary deals with the case where the turning-point saturation occurs in the
63 // low-saturation region (tp_sat < _s_lr). There is "no hysteresis along the extension"
64 // according to Doughty2008, so assume that the wetting curve is the same as would occur if
65 // the turning-point saturation occured at _s_lr
66 const Real effective_liquid_tp =
67 (_hys_sat_tps[_qp].at(0) < _s_lr) ? _s_lr : _hys_sat_tps[_qp].at(0);
68 const Real s_gas_max = (_hys_sat_tps[_qp].at(0) < _s_lr) ? _s_gr_max : _s_gr_tp0[_qp];
71 _s_lr,
72 s_gas_max,
74 effective_liquid_tp,
75 _m,
77 _kl_begin[_qp],
78 _klp_begin[_qp],
79 _kl_end[_qp],
80 _klp_end[_qp]);
83 _s_lr,
84 s_gas_max,
86 effective_liquid_tp,
87 _m,
89 _kl_begin[_qp],
90 _klp_begin[_qp],
91 _kl_end[_qp],
92 _klp_end[_qp]);
93 }
94}
95
96void
98{
100
101 // following ternaries deal with the case where the turning-point saturation occurs in the
102 // low-saturation region (tp_sat < _s_lr). There is "no hysteresis along the extension"
103 // according to Doughty2008, so assume that the wetting curve is the same as would occur if
104 // the turning-point saturation occured at _s_lr
105 const Real effective_liquid_tp = (tp_sat < _s_lr) ? _s_lr : tp_sat;
106 const Real s_gas_max = (tp_sat < _s_lr) ? _s_gr_max : _s_gr_tp0[_qp];
107
108 // compute and record the wetting-curve value and derivative at s_begin
109 const Real s_begin = _liquid_modification_range * (1.0 - s_gas_max);
111 _s_lr,
112 s_gas_max,
113 _s_gr_max,
114 effective_liquid_tp,
115 _m,
117 0.0,
118 0.0,
119 0.0,
120 0.0);
122 _s_lr,
123 s_gas_max,
124 _s_gr_max,
125 effective_liquid_tp,
126 _m,
128 0.0,
129 0.0,
130 0.0,
131 0.0);
132 // compute and record the drying curve information at s_end (the drying curve is used because
133 // s_end = 1.0 - 0.5 * s_gas_max in PorousFlowVanGenuchten::relativePermeabilityHys)
134 const Real s_end = 1.0 - 0.5 * s_gas_max;
136 _s_lr,
137 s_gas_max,
138 _s_gr_max,
139 effective_liquid_tp,
140 _m,
142 0.0,
143 0.0,
144 0.0,
145 0.0);
147 _s_lr,
148 s_gas_max,
149 _s_gr_max,
150 effective_liquid_tp,
151 _m,
153 0.0,
154 0.0,
155 0.0,
156 0.0);
157}
registerMooseObject("PorousFlowApp", PorousFlowHystereticRelativePermeabilityLiquid)
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
Base material for computing relative permeability for 1-phase and 2-phase hysteretic models.
const Real _s_lr
Liquid saturation at which the liquid relperm is zero and the gas relperm is k_rg_max.
const MaterialProperty< std::vector< Real > > & _saturation
Saturation material property.
const MaterialProperty< std::array< Real, PorousFlowConstants::MAX_HYSTERESIS_ORDER > > & _hys_sat_tps
Saturation values at the turning points, as computed by PorousFlowHysteresisOrder.
MaterialProperty< Real > & _s_gr_tp0
Computed nodal or quadpoint values the Land expression, at the turning point from primary drying to f...
MaterialProperty< Real > & _relative_permeability
Computed relative permeability.
const MaterialProperty< unsigned > & _hys_order
Hysteresis order, as computed by PorousFlowHysteresisOrder.
virtual void computeTurningPoint0Info(Real tp_sat)
Compute all relevant quantities at the zeroth turning point (the transition from primary drying to fi...
MaterialProperty< Real > & _drelative_permeability_ds
Derivative of relative permeability wrt the saturation of _phase_num (which is not necessarily the li...
Material to compute liquid relative permeability for 1-phase and 2-phase hysteretic models.
MaterialProperty< Real > & _klp_end
Computed derivative of the liquid wetting relative permeability at 1 - 0.5 * _s_gr_tp0.
MaterialProperty< Real > & _kl_begin
Computed value of the liquid wetting relative permeability at liquid_modification_range * (1 - _s_gr_...
virtual void computeTurningPoint0Info(Real tp_sat) override
Compute all relevant quantities at the zeroth turning point (the transition from primary drying to fi...
virtual void computeRelPermQp() override
Compute the relative permeability and its derivative wrt the _phase_num saturation,...
MaterialProperty< Real > & _kl_end
Computed value of the liquid wetting relative permeability at 1 - 0.5 * _s_gr_tp0.
MaterialProperty< Real > & _klp_begin
Computed derivative of the liquid wetting relative permeability at liquid_modification_range * (1 - _...
const Real _liquid_modification_range
Wetting liquid relative permeability is a cubic between liquid_modification_range * (1 - _s_gr_tp0) a...
Real drelativePermeabilityHys(Real sl, Real slr, Real sgrdel, Real sgrmax, Real sldel, Real m, Real upper_liquid_param, Real y0, Real y0p, Real y1, Real y1p)
Derivative of Hysteretic relative permeability for liquid, with respect to liquid saturation.
Real relativePermeabilityHys(Real sl, Real slr, Real sgrdel, Real sgrmax, Real sldel, Real m, Real upper_liquid_param, Real y0, Real y0p, Real y1, Real y1p)
Hysteretic relative permeability for liquid.