www.mooseframework.org
RichardsRelPermPowerGas.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 // "PowerGas" 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 = 1 - (n+1)(1-s)^n "
25  "+ n(1-s)^(n+1)");
27  "n",
28  "n >= 2",
29  "Exponent. Must be >= 2. Define s = (seff - simm)/(1 - simm). Then "
30  "relperm = 1 - (n+1)(1-s)^n + n(1-s)^(n+1)");
31  params.addClassDescription("Power form of relative permeability that might be useful for gases. "
32  "Define s = (seff - simm)/(1 - simm). Then relperm = 1 - "
33  "(n+1)(1-s)^n + n(1-s)^(n+1) if s<simm, otherwise 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 = 1 - (_n + 1) * std::pow(1 - s_internal, _n) + _n * std::pow(1 - 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 = (_n + 1) * _n * std::pow(1 - s_internal, _n - 1) -
77  _n * (_n + 1) * std::pow(1 - 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(1 - s_internal, _n - 2) +
92  _n * (_n + 1) * _n * std::pow(1 - s_internal, _n - 1);
93  return krelpp / std::pow(1.0 - _simm, 2);
94 }
RichardsRelPermPowerGas(const InputParameters &parameters)
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
Real relperm(Real seff) const
Relative permeability.
static InputParameters validParams()
Base class for Richards relative permeability classes that provide relative permeability as a functio...
Real d2relperm(Real seff) const
Second derivative of relative permeability wrt seff.
static InputParameters validParams()
PowerGas form of relative permeability Define s = (seff - simm)/(1 - simm).
Real _simm
immobile saturation
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
registerMooseObject("RichardsApp", RichardsRelPermPowerGas)
MooseUnits pow(const MooseUnits &, int)
Real drelperm(Real seff) const
Derivative of relative permeability wrt seff.