www.mooseframework.org
RichardsRelPermMonomial.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 // "Monomial" form of relative permeability
11 //
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^n");
26  "n",
27  "n >= 0",
28  "Exponent. Must be >= 0. Define s = (seff - simm)/(1 - simm). Then relperm = s^n");
29  params.addParam<Real>(
30  "zero_to_the_zero", 0.0, "If n=0, this is the value of relative permeability for s<=simm");
31  params.addClassDescription("Monomial form of relative permeability. Define s = (seff - simm)/(1 "
32  "- simm). Then relperm = s^n if s<simm, otherwise relperm=1");
33  return params;
34 }
35 
37  : RichardsRelPerm(parameters),
38  _simm(getParam<Real>("simm")),
39  _n(getParam<Real>("n")),
40  _zero_to_the_zero(getParam<Real>("zero_to_the_zero"))
41 {
42 }
43 
44 Real
46 {
47  if (seff >= 1.0)
48  return 1.0;
49 
50  if (_n == 0 && seff <= _simm)
51  return _zero_to_the_zero;
52 
53  if (seff <= _simm)
54  return 0.0;
55 
56  Real s_internal = (seff - _simm) / (1.0 - _simm);
57  Real krel = std::pow(s_internal, _n);
58 
59  // bound, just in case
60  if (krel < 0)
61  {
62  krel = 0;
63  }
64  if (krel > 1)
65  {
66  krel = 1;
67  }
68  return krel;
69 }
70 
71 Real
73 {
74  if (seff >= 1.0)
75  return 0.0;
76 
77  if (seff <= _simm)
78  return 0.0;
79 
80  if (_n == 0)
81  return 0.0;
82 
83  Real s_internal = (seff - _simm) / (1.0 - _simm);
84  Real krelp = _n * std::pow(s_internal, _n - 1);
85  return krelp / (1.0 - _simm);
86 }
87 
88 Real
90 {
91  if (seff >= 1.0)
92  return 0.0;
93 
94  if (seff <= _simm)
95  return 0.0;
96 
97  if (_n == 0)
98  return 0.0;
99 
100  Real s_internal = (seff - _simm) / (1.0 - _simm);
101  Real krelpp = _n * (_n - 1) * std::pow(s_internal, _n - 2);
102  return krelpp / std::pow(1.0 - _simm, 2);
103 }
static InputParameters validParams()
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
Base class for Richards relative permeability classes that provide relative permeability as a functio...
Real _n
exponent, must be >= 0
registerMooseObject("RichardsApp", RichardsRelPermMonomial)
Real drelperm(Real seff) const
Derivative of elative permeability wrt seff.
Real _simm
immobile saturation
Monomial form of relative permeability relperm = Seff^n for 0<Seff<=1, where S = (S - simm)/(1 - simm...
Real _zero_to_the_zero
0^0, which is used if _n=0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
MooseUnits pow(const MooseUnits &, int)
Real relperm(Real seff) const
Relative permeability.
RichardsRelPermMonomial(const InputParameters &parameters)
Real d2relperm(Real seff) const
Second derivative of elative permeability wrt seff.