https://mooseframework.inl.gov
RichardsRelPermBW.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 
10 // "Broadbridge-White" form of relative permeability (P Broadbridge and I White ``Constant rate
11 // rainfall infiltration: A versatile nonlinear model 1. Analytic Solution'', Water Resources
12 // Research 24 (1988) 145-154)
13 //
14 #include "RichardsRelPermBW.h"
15 #include "libmesh/utility.h"
16 
18 
21 {
24  "Sn",
25  "Sn >= 0",
26  "Low saturation. This must be < Ss, and non-negative. This is BW's "
27  "initial effective saturation, below which effective saturation never goes "
28  "in their simulations/models. If Kn=0 then Sn is the immobile saturation.");
29  params.addRangeCheckedParam<Real>(
30  "Ss",
31  1.0,
32  "Ss <= 1",
33  "High saturation. This must be > Sn and <= 1. Effective saturation "
34  "where porepressure = 0. Effective saturation never exceeds this "
35  "value in BW's simulations/models.");
36  params.addRangeCheckedParam<Real>(
37  "Kn", 0.0, "Kn >= 0", "Relative permeability at Seff = Sn. Must be < Ks");
38  params.addRangeCheckedParam<Real>(
39  "Ks", 1.0, "Ks <= 1", "Relative permeability at Seff = Ss. Must be > Kn");
41  "C",
42  "C > 1",
43  "BW's C parameter. Must be > 1. Define s = (seff - Sn)/(Ss - Sn). Then "
44  "relperm = Kn + s^2(c-1)(Kn-Ks)/(c-s) if 0<s<1, otherwise relperm = Kn if "
45  "s<=0, otherwise relperm = Ks if s>=1.");
46  params.addClassDescription("Broadbridge-White form of relative permeability. Define s = (seff - "
47  "Sn)/(Ss - Sn). Then relperm = Kn + s^2(c-1)(Kn-Ks)/(c-s) if 0<s<1, "
48  "otherwise relperm = Kn if s<=0, otherwise relperm = Ks if s>=1.");
49  return params;
50 }
51 
53  : RichardsRelPerm(parameters),
54  _sn(getParam<Real>("Sn")),
55  _ss(getParam<Real>("Ss")),
56  _kn(getParam<Real>("Kn")),
57  _ks(getParam<Real>("Ks")),
58  _c(getParam<Real>("C"))
59 {
60  if (_ss <= _sn)
61  mooseError("In BW relative permeability Sn set to ",
62  _sn,
63  " and Ss set to ",
64  _ss,
65  " but these must obey Ss > Sn");
66  if (_ks <= _kn)
67  mooseError("In BW relative permeability Kn set to ",
68  _kn,
69  " and Ks set to ",
70  _ks,
71  " but these must obey Ks > Kn");
72  _coef = (_ks - _kn) * (_c - 1); // shorthand coefficient
73 }
74 
75 Real
77 {
78  if (seff <= _sn)
79  return _kn;
80 
81  if (seff >= _ss)
82  return _ks;
83 
84  const Real s_internal = (seff - _sn) / (_ss - _sn);
85  const Real krel = _kn + _coef * Utility::pow<2>(s_internal) / (_c - s_internal);
86  return krel;
87 }
88 
89 Real
91 {
92  if (seff <= _sn)
93  return 0.0;
94 
95  if (seff >= _ss)
96  return 0.0;
97 
98  const Real s_internal = (seff - _sn) / (_ss - _sn);
99  const Real krelp = _coef * (2.0 * s_internal / (_c - s_internal) +
100  Utility::pow<2>(s_internal) / Utility::pow<2>(_c - s_internal));
101  return krelp / (_ss - _sn);
102 }
103 
104 Real
106 {
107  if (seff <= _sn)
108  return 0.0;
109 
110  if (seff >= _ss)
111  return 0.0;
112 
113  const Real s_internal = (seff - _sn) / (_ss - _sn);
114  const Real krelpp =
115  _coef * (2.0 / (_c - s_internal) + 4.0 * s_internal / Utility::pow<2>(_c - s_internal) +
116  2.0 * Utility::pow<2>(s_internal) / Utility::pow<3>(_c - s_internal));
117  return krelpp / Utility::pow<2>(_ss - _sn);
118 }
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
static InputParameters validParams()
Base class for Richards relative permeability classes that provide relative permeability as a functio...
RichardsRelPermBW(const InputParameters &parameters)
Real d2relperm(Real seff) const
second derivative of relative permeability wrt effective saturation
Real drelperm(Real seff) const
derivative of relative permeability wrt effective saturation
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
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)
registerMooseObject("RichardsApp", RichardsRelPermBW)
static InputParameters validParams()
"Broadbridge-White" form of relative permeability as a function of effective saturation P Broadbridge...
Real relperm(Real seff) const
relative permeability as a function of effective saturation