RichardsRelPermPower.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 // "Power" form of relative permeability
9 //
10 #include "RichardsRelPermPower.h"
11
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<RichardsRelPerm>();
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 = (n+1)s^n - "
22  "ns^(n+1)");
24  "n >= 2",
25  "Exponent. Must be >= 2. Define s = "
26  "(seff - simm)/(1 - simm). Then "
27  "relperm = (n+1)s^n - ns^(n+1)");
28  params.addClassDescription("Power form of relative permeability. Define s = (seff - simm)/(1 - "
29  "simm). Then relperm = (n+1)s^n - ns^(n+1) if s<simm, otherwise "
30  "relperm=1");
31  return params;
32 }
33
34 RichardsRelPermPower::RichardsRelPermPower(const InputParameters & parameters)
35  : RichardsRelPerm(parameters), _simm(getParam<Real>("simm")), _n(getParam<Real>("n"))
36 {
37 }
38
39 Real
41 {
42  if (seff >= 1.0)
43  return 1.0;
44
45  if (seff <= _simm)
46  return 0.0;
47
48  Real s_internal = (seff - _simm) / (1.0 - _simm);
49  Real krel = (_n + 1) * std::pow(s_internal, _n) - _n * std::pow(s_internal, _n + 1);
50
51  // bound, just in case
52  if (krel < 0)
53  {
54  krel = 0;
55  }
56  if (krel > 1)
57  {
58  krel = 1;
59  }
60  return krel;
61 }
62
63 Real
65 {
66  if (seff >= 1.0)
67  return 0.0;
68
69  if (seff <= _simm)
70  return 0.0;
71
72  Real s_internal = (seff - _simm) / (1.0 - _simm);
73  Real krelp =
74  (_n + 1) * _n * std::pow(s_internal, _n - 1) - _n * (_n + 1) * std::pow(s_internal, _n);
75  return krelp / (1.0 - _simm);
76 }
77
78 Real
80 {
81  if (seff >= 1.0)
82  return 0.0;
83
84  if (seff <= _simm)
85  return 0.0;
86
87  Real s_internal = (seff - _simm) / (1.0 - _simm);
88  Real krelpp = (_n + 1) * _n * (_n - 1) * std::pow(s_internal, _n - 2) -
89  _n * (_n + 1) * _n * std::pow(s_internal, _n - 1);
90  return krelpp / std::pow(1.0 - _simm, 2);
91 }
Base class for Richards relative permeability classes that provide relative permeability as a functio...
Real relperm(Real seff) const
relative permeability as a function of effective saturation
Real d2relperm(Real seff) const
second derivative of relative permeability wrt effective saturation
InputParameters validParams< RichardsRelPerm >()
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
InputParameters validParams< RichardsRelPermPower >()
Real drelperm(Real seff) const
derivative of relative permeability wrt effective saturation
Real _n
exponent used in the power relationship
Real _simm
immobile saturation
RichardsRelPermPower(const InputParameters &parameters)