www.mooseframework.org
Q2PRelPermPowerGas.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 //
12 #include "Q2PRelPermPowerGas.h"
13 
15 
18 {
21  "simm",
22  "simm >= 0 & simm < 1",
23  "Immobile saturation. Must be between 0 and 1. Define s = "
24  "seff/(1 - simm). Then relperm = 1 - (n+1)s^n + ns^(n+1)");
26  "n >= 2",
27  "Exponent. Must be >= 2. Define s = "
28  "(eff/(1 - simm). Then relperm = 1 - "
29  "(n+1)s^n + ns^(n+1)");
30  params.addClassDescription("Power form of relative permeability that might be useful for gases "
31  "as a function of water saturation in Q2P models. Define s = seff/(1 "
32  "- simm). Then relperm = 1 - (n+1)s^n + ns^(n+1) if seff<1-simm, "
33  "otherwise relperm=1. Here seff is the water saturation");
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 - _simm)
46  return 0.0;
47 
48  if (seff <= 0)
49  return 1.0;
50 
51  Real s_internal = seff / (1.0 - _simm);
52  Real krel = 1 - (_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 - _simm)
70  return 0.0;
71 
72  if (seff <= 0)
73  return 0.0;
74 
75  Real s_internal = seff / (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 - _simm)
85  return 0.0;
86 
87  if (seff <= 0)
88  return 0.0;
89 
90  Real s_internal = seff / (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()
Base class for Richards relative permeability classes that provide relative permeability as a functio...
static InputParameters validParams()
Real relperm(Real seff) const
Relative permeability.
Q2PRelPermPowerGas(const InputParameters &parameters)
registerMooseObject("RichardsApp", Q2PRelPermPowerGas)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real drelperm(Real seff) const
Derivative of relative permeability wrt seff.
PowerGas form of relative permeability Define s = seff/(1 - simm).
void addClassDescription(const std::string &doc_string)
Real _simm
immobile saturation
MooseUnits pow(const MooseUnits &, int)
Real d2relperm(Real seff) const
Second derivative of relative permeability wrt seff.