www.mooseframework.org
RichardsRelPermVG1.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 // "VG1" form of relative permeability
9 //
10 #include "RichardsRelPermVG1.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<RichardsRelPermVG>();
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^(1/2) * (1 - (1 "
22  "- s^(1/m))^m)^2");
23  params.addRequiredRangeCheckedParam<Real>(
24  "m",
25  "m > 0 & m < 1",
26  "van-Genuchten m parameter. Must be between 0 and 1, and optimally "
27  "should be set >0.5. Define s = (seff - simm)/(1 - simm). Then "
28  "relperm = s^(1/2) * (1 - (1 - s^(1/m))^m)^2");
29  params.addRequiredRangeCheckedParam<Real>(
30  "scut", "scut > 0 & scut < 1", "cutoff in effective saturation.");
31  params.addClassDescription("VG1 form of relative permeability. Define s = (seff - simm)/(1 - "
32  "simm). Then relperm = s^(1/2) * (1 - (1 - s^(1/m))^m)^2, if s>0, "
33  "and relperm=0 otherwise");
34  return params;
35 }
36 
37 RichardsRelPermVG1::RichardsRelPermVG1(const InputParameters & parameters)
38  : RichardsRelPermVG(parameters),
39  _simm(getParam<Real>("simm")),
40  _m(getParam<Real>("m")),
41  _scut(getParam<Real>("scut")),
42  _vg1_const(0),
43  _vg1_linear(0),
44  _vg1_quad(0),
45  _vg1_cub(0)
46 {
50  _vg1_cub = (1 - _vg1_const - _vg1_linear * (1 - _scut) - _vg1_quad * std::pow(1 - _scut, 2)) /
51  std::pow(1 - _scut, 3);
52 }
53 
54 void
56 {
57  _console << "Relative permeability of VG1 type has cubic coefficients " << _vg1_const << " "
58  << _vg1_linear << " " << _vg1_quad << " " << _vg1_cub << std::endl;
59 }
60 
61 Real
63 {
64  if (seff >= 1.0)
65  return 1.0;
66 
67  if (seff <= _simm)
68  return 0.0;
69 
70  Real s_internal = (seff - _simm) / (1.0 - _simm);
71 
72  if (s_internal < _scut)
73  return RichardsRelPermVG::relperm(seff);
74 
75  Real krel = _vg1_const + _vg1_linear * (s_internal - _scut) +
76  _vg1_quad * std::pow(s_internal - _scut, 2) +
77  _vg1_cub * std::pow(s_internal - _scut, 3);
78 
79  // bound, just in case
80  if (krel < 0)
81  {
82  krel = 0;
83  }
84  if (krel > 1)
85  {
86  krel = 1;
87  }
88  return krel;
89 }
90 
91 Real
93 {
94  if (seff >= 1.0)
95  return 0.0;
96 
97  if (seff <= _simm)
98  return 0.0;
99 
100  Real s_internal = (seff - _simm) / (1.0 - _simm);
101 
102  if (s_internal < _scut)
103  return RichardsRelPermVG::drelperm(seff);
104 
105  Real krelp = _vg1_linear + 2 * _vg1_quad * (s_internal - _scut) +
106  3 * _vg1_cub * std::pow(s_internal - _scut, 2);
107  return krelp / (1.0 - _simm);
108 }
109 
110 Real
112 {
113  if (seff >= 1.0)
114  return 0.0;
115 
116  if (seff <= _simm)
117  return 0.0;
118 
119  Real s_internal = (seff - _simm) / (1.0 - _simm);
120 
121  if (s_internal < _scut)
122  return RichardsRelPermVG::d2relperm(seff);
123 
124  Real krelpp = 2 * _vg1_quad + 6 * _vg1_cub * (s_internal - _scut);
125  return krelpp / std::pow(1.0 - _simm, 2);
126 }
InputParameters validParams< RichardsRelPermVG1 >()
Real relperm(Real seff) const
relative permeability as a function of effective saturation
Van-Genuchten form of relative permeability as a function of effective saturation.
Real _vg1_quad
coefficient of quadratic term in cubic relperm relation
InputParameters validParams< RichardsRelPermVG >()
Real _vg1_cub
coefficient of cubic term in cubic relperm relation
Real d2relperm(Real seff) const
second derivative of relative permeability wrt effective saturation
RichardsRelPermVG1(const InputParameters &parameters)
Real _simm
immobile saturation
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
void initialSetup()
just prints some (maybe) useful info to the console
Real drelperm(Real seff) const
derivative of relative permeability wrt effective saturation
Real _vg1_linear
coefficient of linear term in cubic relperm relation
Real drelperm(Real seff) const
derivative of relative permeability wrt effective saturation
Real _scut
for seff > _scut use cubic relative permeability, otherwise use van Genuchten
Real _vg1_const
constant in cubic relperm relation
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