www.mooseframework.org
Q2PRelPermPowerGas.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 //
10 #include "Q2PRelPermPowerGas.h"
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/(1 - simm). Then relperm = 1 - (n+1)s^n + ns^(n+1)");
22  params.addRequiredRangeCheckedParam<Real>("n",
23  "n >= 2",
24  "Exponent. Must be >= 2. Define s = "
25  "(eff/(1 - simm). Then relperm = 1 - "
26  "(n+1)s^n + ns^(n+1)");
27  params.addClassDescription("Power form of relative permeability that might be useful for gases "
28  "as a function of water saturation in Q2P models. Define s = seff/(1 "
29  "- simm). Then relperm = 1 - (n+1)s^n + ns^(n+1) if seff<1-simm, "
30  "otherwise relperm=1. Here seff is the water saturation");
31  return params;
32 }
33 
34 Q2PRelPermPowerGas::Q2PRelPermPowerGas(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 - _simm)
43  return 0.0;
44 
45  if (seff <= 0)
46  return 1.0;
47 
48  Real s_internal = seff / (1.0 - _simm);
49  Real krel = 1 - (_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 - _simm)
67  return 0.0;
68 
69  if (seff <= 0)
70  return 0.0;
71 
72  Real s_internal = seff / (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 - _simm)
82  return 0.0;
83 
84  if (seff <= 0)
85  return 0.0;
86 
87  Real s_internal = seff / (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...
Q2PRelPermPowerGas(const InputParameters &parameters)
InputParameters validParams< Q2PRelPermPowerGas >()
Real drelperm(Real seff) const
Derivative of relative permeability wrt seff.
Real relperm(Real seff) const
Relative permeability.
Real d2relperm(Real seff) const
Second derivative of relative permeability wrt seff.
InputParameters validParams< RichardsRelPerm >()
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real _simm
immobile saturation