www.mooseframework.org
RichardsRelPermPowerGas.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 // "PowerGas" 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 = 1 - (n+1)(1-s)^n "
22  "+ n(1-s)^(n+1)");
23  params.addRequiredRangeCheckedParam<Real>(
24  "n",
25  "n >= 2",
26  "Exponent. Must be >= 2. Define s = (seff - simm)/(1 - simm). Then "
27  "relperm = 1 - (n+1)(1-s)^n + n(1-s)^(n+1)");
28  params.addClassDescription("Power form of relative permeability that might be useful for gases. "
29  "Define s = (seff - simm)/(1 - simm). Then relperm = 1 - "
30  "(n+1)(1-s)^n + n(1-s)^(n+1) if s<simm, otherwise relperm=1");
31  return params;
32 }
33 
34 RichardsRelPermPowerGas::RichardsRelPermPowerGas(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 = 1 - (_n + 1) * std::pow(1 - s_internal, _n) + _n * std::pow(1 - 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 = (_n + 1) * _n * std::pow(1 - s_internal, _n - 1) -
74  _n * (_n + 1) * std::pow(1 - 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(1 - s_internal, _n - 2) +
89  _n * (_n + 1) * _n * std::pow(1 - s_internal, _n - 1);
90  return krelpp / std::pow(1.0 - _simm, 2);
91 }
RichardsRelPermPowerGas(const InputParameters &parameters)
Real drelperm(Real seff) const
Derivative of relative permeability wrt seff.
InputParameters validParams< RichardsRelPermPowerGas >()
Real d2relperm(Real seff) const
Second derivative of relative permeability wrt seff.
Base class for Richards relative permeability classes that provide relative permeability as a functio...
Real relperm(Real seff) const
Relative permeability.
InputParameters validParams< RichardsRelPerm >()
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real _simm
immobile saturation