www.mooseframework.org
RichardsRelPermBW.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
19 template <>
20 InputParameters
22 {
23  InputParameters params = validParams<RichardsRelPerm>();
24  params.addRequiredRangeCheckedParam<Real>(
25  "Sn",
26  "Sn >= 0",
27  "Low saturation. This must be < Ss, and non-negative. This is BW's "
28  "initial effective saturation, below which effective saturation never goes "
29  "in their simulations/models. If Kn=0 then Sn is the immobile saturation.");
30  params.addRangeCheckedParam<Real>(
31  "Ss",
32  1.0,
33  "Ss <= 1",
34  "High saturation. This must be > Sn and <= 1. Effective saturation "
35  "where porepressure = 0. Effective saturation never exceeds this "
36  "value in BW's simulations/models.");
37  params.addRangeCheckedParam<Real>(
38  "Kn", 0.0, "Kn >= 0", "Relative permeability at Seff = Sn. Must be < Ks");
39  params.addRangeCheckedParam<Real>(
40  "Ks", 1.0, "Ks <= 1", "Relative permeability at Seff = Ss. Must be > Kn");
41  params.addRequiredRangeCheckedParam<Real>(
42  "C",
43  "C > 1",
44  "BW's C parameter. Must be > 1. Define s = (seff - Sn)/(Ss - Sn). Then "
45  "relperm = Kn + s^2(c-1)(Kn-Ks)/(c-s) if 0<s<1, otherwise relperm = Kn if "
46  "s<=0, otherwise relperm = Ks if s>=1.");
47  params.addClassDescription("Broadbridge-White form of relative permeability. Define s = (seff - "
48  "Sn)/(Ss - Sn). Then relperm = Kn + s^2(c-1)(Kn-Ks)/(c-s) if 0<s<1, "
49  "otherwise relperm = Kn if s<=0, otherwise relperm = Ks if s>=1.");
50  return params;
51 }
52 
53 RichardsRelPermBW::RichardsRelPermBW(const InputParameters & parameters)
54  : RichardsRelPerm(parameters),
55  _sn(getParam<Real>("Sn")),
56  _ss(getParam<Real>("Ss")),
57  _kn(getParam<Real>("Kn")),
58  _ks(getParam<Real>("Ks")),
59  _c(getParam<Real>("C"))
60 {
61  if (_ss <= _sn)
62  mooseError("In BW relative permeability Sn set to ",
63  _sn,
64  " and Ss set to ",
65  _ss,
66  " but these must obey Ss > Sn");
67  if (_ks <= _kn)
68  mooseError("In BW relative permeability Kn set to ",
69  _kn,
70  " and Ks set to ",
71  _ks,
72  " but these must obey Ks > Kn");
73  _coef = (_ks - _kn) * (_c - 1); // shorthand coefficient
74 }
75 
76 Real
78 {
79  if (seff <= _sn)
80  return _kn;
81 
82  if (seff >= _ss)
83  return _ks;
84 
85  const Real s_internal = (seff - _sn) / (_ss - _sn);
86  const Real krel = _kn + _coef * Utility::pow<2>(s_internal) / (_c - s_internal);
87  return krel;
88 }
89 
90 Real
92 {
93  if (seff <= _sn)
94  return 0.0;
95 
96  if (seff >= _ss)
97  return 0.0;
98 
99  const Real s_internal = (seff - _sn) / (_ss - _sn);
100  const Real krelp = _coef * (2.0 * s_internal / (_c - s_internal) +
101  Utility::pow<2>(s_internal) / Utility::pow<2>(_c - s_internal));
102  return krelp / (_ss - _sn);
103 }
104 
105 Real
107 {
108  if (seff <= _sn)
109  return 0.0;
110 
111  if (seff >= _ss)
112  return 0.0;
113 
114  const Real s_internal = (seff - _sn) / (_ss - _sn);
115  const Real krelpp =
116  _coef * (2.0 / (_c - s_internal) + 4.0 * s_internal / Utility::pow<2>(_c - s_internal) +
117  2.0 * Utility::pow<2>(s_internal) / Utility::pow<3>(_c - s_internal));
118  return krelpp / Utility::pow<2>(_ss - _sn);
119 }
RichardsRelPermBW::_ks
Real _ks
Definition: RichardsRelPermBW.h:58
RichardsRelPerm
Base class for Richards relative permeability classes that provide relative permeability as a functio...
Definition: RichardsRelPerm.h:23
RichardsRelPermBW::_coef
Real _coef
Definition: RichardsRelPermBW.h:64
RichardsRelPermBW::_ss
Real _ss
Definition: RichardsRelPermBW.h:52
RichardsRelPermBW::RichardsRelPermBW
RichardsRelPermBW(const InputParameters &parameters)
Definition: RichardsRelPermBW.C:53
RichardsRelPermBW::_sn
Real _sn
Definition: RichardsRelPermBW.h:49
validParams< RichardsRelPermBW >
InputParameters validParams< RichardsRelPermBW >()
Definition: RichardsRelPermBW.C:21
RichardsRelPermBW
"Broadbridge-White" form of relative permeability as a function of effective saturation P Broadbridge...
Definition: RichardsRelPermBW.h:24
RichardsRelPermBW.h
registerMooseObject
registerMooseObject("RichardsApp", RichardsRelPermBW)
RichardsRelPermBW::d2relperm
Real d2relperm(Real seff) const
second derivative of relative permeability wrt effective saturation
Definition: RichardsRelPermBW.C:106
RichardsRelPermBW::drelperm
Real drelperm(Real seff) const
derivative of relative permeability wrt effective saturation
Definition: RichardsRelPermBW.C:91
validParams< RichardsRelPerm >
InputParameters validParams< RichardsRelPerm >()
Definition: RichardsRelPerm.C:16
RichardsRelPermBW::_c
Real _c
Definition: RichardsRelPermBW.h:61
RichardsRelPermBW::_kn
Real _kn
Definition: RichardsRelPermBW.h:55
RichardsRelPermBW::relperm
Real relperm(Real seff) const
relative permeability as a function of effective saturation
Definition: RichardsRelPermBW.C:77