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