www.mooseframework.org
RichardsRelPermVG.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 #include "RichardsRelPermVG.h"
9 #include "libmesh/utility.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<RichardsRelPerm>();
16  params.addRequiredRangeCheckedParam<Real>(
17  "simm",
18  "simm >= 0 & simm < 1",
19  "Immobile saturation. Must be between 0 and 1. Define s = "
20  "(seff - simm)/(1 - simm). Then relperm = s^(1/2) * (1 - (1 "
21  "- s^(1/m))^m)^2");
22  params.addRequiredRangeCheckedParam<Real>(
23  "m",
24  "m > 0 & m < 1",
25  "van-Genuchten m parameter. Must be between 0 and 1, and optimally "
26  "should be set >0.5. Define s = (seff - simm)/(1 - simm). Then "
27  "relperm = s^(1/2) * (1 - (1 - s^(1/m))^m)^2");
28  params.addClassDescription("VG form of relative permeability. Define s = (seff - simm)/(1 - "
29  "simm). Then relperm = s^(1/2) * (1 - (1 - s^(1/m))^m)^2, if s>0, "
30  "and relperm=0 otherwise");
31  return params;
32 }
33 
34 RichardsRelPermVG::RichardsRelPermVG(const InputParameters & parameters)
35  : RichardsRelPerm(parameters), _simm(getParam<Real>("simm")), _m(getParam<Real>("m"))
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 = std::sqrt(s_internal) *
50  Utility::pow<2>(1.0 - std::pow(1.0 - std::pow(s_internal, 1.0 / _m), _m));
51 
52  // bound, just in case
53  if (krel < 0.0)
54  krel = 0.0;
55  if (krel > 1.0)
56  krel = 1.0;
57 
58  return krel;
59 }
60 
61 Real
63 {
64  if (seff >= 1.0)
65  return 0.0;
66 
67  if (seff <= _simm)
68  return 0.0;
69 
70  Real s_internal = (seff - _simm) / (1.0 - _simm);
71  Real tmp = 1.0 - std::pow(s_internal, 1.0 / _m);
72  Real tmpp = -1.0 / _m * std::pow(s_internal, 1.0 / _m - 1.0);
73  Real tmp2 = 1.0 - std::pow(tmp, _m);
74  Real tmp2p = -_m * std::pow(tmp, _m - 1.0) * tmpp;
75  // Real krel = std::sqrt(s_internal)*std::pow(tmp2, 2);
76  Real krelp =
77  0.5 * std::pow(s_internal, -0.5) * tmp2 * tmp2 + 2.0 * std::sqrt(s_internal) * tmp2 * tmp2p;
78  return krelp / (1.0 - _simm);
79 }
80 
81 Real
83 {
84  if (seff >= 1.0)
85  return 0.0;
86 
87  if (seff <= _simm)
88  return 0.0;
89 
90  Real s_internal = (seff - _simm) / (1.0 - _simm);
91  Real tmp = 1.0 - std::pow(s_internal, 1.0 / _m);
92  Real tmpp = -1.0 / _m * std::pow(s_internal, 1.0 / _m - 1.0);
93  Real tmppp = -1.0 / _m * (1.0 / _m - 1.0) * std::pow(s_internal, 1.0 / _m - 2);
94  Real tmp2 = 1.0 - std::pow(tmp, _m);
95  Real tmp2p = -_m * std::pow(tmp, _m - 1.0) * tmpp;
96  Real tmp2pp = -_m * (_m - 1.0) * std::pow(tmp, _m - 2.0) * tmpp * tmpp -
97  _m * std::pow(tmp, _m - 1.0) * tmppp;
98  // Real krel = std::sqrt(s_internal)*std::pow(tmp2, 2);
99  // Real krelp = 0.5 * std::pow(s_internal, -0.5)*std::pow(tmp2, 2) +
100  // 2*std::sqrt(s_internal)*tmp2*tmp2p;
101  Real krelpp = -0.25 * std::pow(s_internal, -1.5) * tmp2 * tmp2 +
102  2.0 * 0.5 * std::pow(s_internal, -0.5) * 2.0 * tmp2 * tmp2p +
103  2.0 * std::sqrt(s_internal) * (tmp2p * tmp2p + tmp2 * tmp2pp);
104 
105  return krelpp / Utility::pow<2>(1.0 - _simm);
106 }
RichardsRelPermVG(const InputParameters &parameters)
Base class for Richards relative permeability classes that provide relative permeability as a functio...
Real _simm
immobile saturation
InputParameters validParams< RichardsRelPermVG >()
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)
Real drelperm(Real seff) const
derivative of relative permeability wrt effective saturation
Real _m
van Genuchten m parameter
Real relperm(Real seff) const
relative permeability as a function of effective saturation