www.mooseframework.org
RichardsRelPermVG1.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 // "VG1" form of relative permeability
11 //
12 #include "RichardsRelPermVG1.h"
13 
15 
18 {
21  "simm",
22  "simm >=0 & simm < 1",
23  "Immobile saturation. Must be between 0 and 1. Define s = "
24  "(seff - simm)/(1 - simm). Then relperm = s^(1/2) * (1 - (1 "
25  "- s^(1/m))^m)^2");
27  "m",
28  "m > 0 & m < 1",
29  "van-Genuchten m parameter. Must be between 0 and 1, and optimally "
30  "should be set >0.5. Define s = (seff - simm)/(1 - simm). Then "
31  "relperm = s^(1/2) * (1 - (1 - s^(1/m))^m)^2");
33  "scut", "scut > 0 & scut < 1", "cutoff in effective saturation.");
34  params.addClassDescription("VG1 form of relative permeability. Define s = (seff - simm)/(1 - "
35  "simm). Then relperm = s^(1/2) * (1 - (1 - s^(1/m))^m)^2, if s>0, "
36  "and relperm=0 otherwise");
37  return params;
38 }
39 
41  : RichardsRelPermVG(parameters),
42  _simm(getParam<Real>("simm")),
43  _m(getParam<Real>("m")),
44  _scut(getParam<Real>("scut")),
45  _vg1_const(0),
46  _vg1_linear(0),
47  _vg1_quad(0),
48  _vg1_cub(0)
49 {
53  _vg1_cub = (1 - _vg1_const - _vg1_linear * (1 - _scut) - _vg1_quad * std::pow(1 - _scut, 2)) /
54  std::pow(1 - _scut, 3);
55 }
56 
57 void
59 {
60  _console << "Relative permeability of VG1 type has cubic coefficients " << _vg1_const << " "
61  << _vg1_linear << " " << _vg1_quad << " " << _vg1_cub << std::endl;
62 }
63 
64 Real
66 {
67  if (seff >= 1.0)
68  return 1.0;
69 
70  if (seff <= _simm)
71  return 0.0;
72 
73  Real s_internal = (seff - _simm) / (1.0 - _simm);
74 
75  if (s_internal < _scut)
76  return RichardsRelPermVG::relperm(seff);
77 
78  Real krel = _vg1_const + _vg1_linear * (s_internal - _scut) +
79  _vg1_quad * std::pow(s_internal - _scut, 2) +
80  _vg1_cub * std::pow(s_internal - _scut, 3);
81 
82  // bound, just in case
83  if (krel < 0)
84  {
85  krel = 0;
86  }
87  if (krel > 1)
88  {
89  krel = 1;
90  }
91  return krel;
92 }
93 
94 Real
96 {
97  if (seff >= 1.0)
98  return 0.0;
99 
100  if (seff <= _simm)
101  return 0.0;
102 
103  Real s_internal = (seff - _simm) / (1.0 - _simm);
104 
105  if (s_internal < _scut)
106  return RichardsRelPermVG::drelperm(seff);
107 
108  Real krelp = _vg1_linear + 2 * _vg1_quad * (s_internal - _scut) +
109  3 * _vg1_cub * std::pow(s_internal - _scut, 2);
110  return krelp / (1.0 - _simm);
111 }
112 
113 Real
115 {
116  if (seff >= 1.0)
117  return 0.0;
118 
119  if (seff <= _simm)
120  return 0.0;
121 
122  Real s_internal = (seff - _simm) / (1.0 - _simm);
123 
124  if (s_internal < _scut)
125  return RichardsRelPermVG::d2relperm(seff);
126 
127  Real krelpp = 2 * _vg1_quad + 6 * _vg1_cub * (s_internal - _scut);
128  return krelpp / std::pow(1.0 - _simm, 2);
129 }
Real d2relperm(Real seff) const
second derivative of relative permeability wrt effective saturation
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
static InputParameters validParams()
registerMooseObject("RichardsApp", RichardsRelPermVG1)
Van-Genuchten form of relative permeability as a function of effective saturation.
Real drelperm(Real seff) const
derivative of relative permeability wrt effective saturation
Real drelperm(Real seff) const
derivative of relative permeability wrt effective saturation
Real _vg1_quad
coefficient of quadratic term in cubic relperm relation
static InputParameters validParams()
Van-Genuchten form of relative permeability when seff <= _scut cubic relative permeability for seff >...
Real _vg1_cub
coefficient of cubic term in cubic relperm relation
RichardsRelPermVG1(const InputParameters &parameters)
Real _simm
immobile saturation
Real d2relperm(Real seff) const
second derivative of relative permeability wrt effective saturation
Real relperm(Real seff) const
relative permeability as a function of effective saturation
void initialSetup()
just prints some (maybe) useful info to the console
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _vg1_linear
coefficient of linear term in cubic relperm relation
Real _scut
for seff > _scut use cubic relative permeability, otherwise use van Genuchten
void addClassDescription(const std::string &doc_string)
const ConsoleStream _console
Real _vg1_const
constant in cubic relperm relation
Real relperm(Real seff) const
relative permeability as a function of effective saturation
MooseUnits pow(const MooseUnits &, int)