www.mooseframework.org
RichardsRelPermPower.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 // "Power" form of relative permeability
11 //
12 #include "RichardsRelPermPower.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 = (n+1)s^n - "
25  "ns^(n+1)");
27  "n >= 2",
28  "Exponent. Must be >= 2. Define s = "
29  "(seff - simm)/(1 - simm). Then "
30  "relperm = (n+1)s^n - ns^(n+1)");
31  params.addClassDescription("Power form of relative permeability. Define s = (seff - simm)/(1 - "
32  "simm). Then relperm = (n+1)s^n - ns^(n+1) if s<simm, otherwise "
33  "relperm=1");
34  return params;
35 }
36 
38  : RichardsRelPerm(parameters), _simm(getParam<Real>("simm")), _n(getParam<Real>("n"))
39 {
40 }
41 
42 Real
44 {
45  if (seff >= 1.0)
46  return 1.0;
47 
48  if (seff <= _simm)
49  return 0.0;
50 
51  Real s_internal = (seff - _simm) / (1.0 - _simm);
52  Real krel = (_n + 1) * std::pow(s_internal, _n) - _n * std::pow(s_internal, _n + 1);
53 
54  // bound, just in case
55  if (krel < 0)
56  {
57  krel = 0;
58  }
59  if (krel > 1)
60  {
61  krel = 1;
62  }
63  return krel;
64 }
65 
66 Real
68 {
69  if (seff >= 1.0)
70  return 0.0;
71 
72  if (seff <= _simm)
73  return 0.0;
74 
75  Real s_internal = (seff - _simm) / (1.0 - _simm);
76  Real krelp =
77  (_n + 1) * _n * std::pow(s_internal, _n - 1) - _n * (_n + 1) * std::pow(s_internal, _n);
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 krelpp = (_n + 1) * _n * (_n - 1) * std::pow(s_internal, _n - 2) -
92  _n * (_n + 1) * _n * std::pow(s_internal, _n - 1);
93  return krelpp / std::pow(1.0 - _simm, 2);
94 }
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
static InputParameters validParams()
Real d2relperm(Real seff) const
second derivative of relative permeability wrt effective saturation
Base class for Richards relative permeability classes that provide relative permeability as a functio...
Real drelperm(Real seff) const
derivative of relative permeability wrt effective saturation
Real relperm(Real seff) const
relative permeability as a function of effective saturation
Power form of relative permeability, usually used for water.
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _n
exponent used in the power relationship
void addClassDescription(const std::string &doc_string)
registerMooseObject("RichardsApp", RichardsRelPermPower)
MooseUnits pow(const MooseUnits &, int)
Real _simm
immobile saturation
RichardsRelPermPower(const InputParameters &parameters)