www.mooseframework.org
RichardsRelPermMonomial.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 // "Monomial" form of relative permeability
9 //
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<RichardsRelPerm>();
17  params.addRequiredRangeCheckedParam<Real>(
18  "simm",
19  "simm >= 0 & simm < 1",
20  "Immobile saturation. Must be between 0 and 1. Define s = "
21  "(seff - simm)/(1 - simm). Then relperm = s^n");
22  params.addRequiredRangeCheckedParam<Real>(
23  "n",
24  "n >= 0",
25  "Exponent. Must be >= 0. Define s = (seff - simm)/(1 - simm). Then relperm = s^n");
26  params.addParam<Real>(
27  "zero_to_the_zero", 0.0, "If n=0, this is the value of relative permeability for s<=simm");
28  params.addClassDescription("Monomial form of relative permeability. Define s = (seff - simm)/(1 "
29  "- simm). Then relperm = s^n if s<simm, otherwise relperm=1");
30  return params;
31 }
32 
33 RichardsRelPermMonomial::RichardsRelPermMonomial(const InputParameters & parameters)
34  : RichardsRelPerm(parameters),
35  _simm(getParam<Real>("simm")),
36  _n(getParam<Real>("n")),
37  _zero_to_the_zero(getParam<Real>("zero_to_the_zero"))
38 {
39 }
40 
41 Real
43 {
44  if (seff >= 1.0)
45  return 1.0;
46 
47  if (_n == 0 && seff <= _simm)
48  return _zero_to_the_zero;
49 
50  if (seff <= _simm)
51  return 0.0;
52 
53  Real s_internal = (seff - _simm) / (1.0 - _simm);
54  Real krel = std::pow(s_internal, _n);
55 
56  // bound, just in case
57  if (krel < 0)
58  {
59  krel = 0;
60  }
61  if (krel > 1)
62  {
63  krel = 1;
64  }
65  return krel;
66 }
67 
68 Real
70 {
71  if (seff >= 1.0)
72  return 0.0;
73 
74  if (seff <= _simm)
75  return 0.0;
76 
77  if (_n == 0)
78  return 0.0;
79 
80  Real s_internal = (seff - _simm) / (1.0 - _simm);
81  Real krelp = _n * std::pow(s_internal, _n - 1);
82  return krelp / (1.0 - _simm);
83 }
84 
85 Real
87 {
88  if (seff >= 1.0)
89  return 0.0;
90 
91  if (seff <= _simm)
92  return 0.0;
93 
94  if (_n == 0)
95  return 0.0;
96 
97  Real s_internal = (seff - _simm) / (1.0 - _simm);
98  Real krelpp = _n * (_n - 1) * std::pow(s_internal, _n - 2);
99  return krelpp / std::pow(1.0 - _simm, 2);
100 }
Real drelperm(Real seff) const
Derivative of elative permeability wrt seff.
Base class for Richards relative permeability classes that provide relative permeability as a functio...
Real _n
exponent, must be >= 0
Real _simm
immobile saturation
Real relperm(Real seff) const
Relative permeability.
InputParameters validParams< RichardsRelPermMonomial >()
Real d2relperm(Real seff) const
Second derivative of elative permeability wrt seff.
Real _zero_to_the_zero
0^0, which is used if _n=0
InputParameters validParams< RichardsRelPerm >()
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
RichardsRelPermMonomial(const InputParameters &parameters)