www.mooseframework.org
PorousFlowRelativePermeabilityVG.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 #include "libmesh/utility.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<PorousFlowRelativePermeabilityBase>();
16  params.addRequiredRangeCheckedParam<Real>(
17  "m", "m > 0 & m < 1", "The van Genuchten exponent of the phase");
18  params.addRangeCheckedParam<Real>("seff_turnover",
19  1.0,
20  "seff_turnover > 0 & seff_turnover <= 1",
21  "The relative permeability will be a cubic for seff > "
22  "seff_turnover. The cubic is chosen so that its derivative "
23  "and value matche the VG function at seff=seff_turnover");
24  params.addParam<bool>("zero_derivative",
25  false,
26  "Employ a cubic for seff>seff_turnover that has zero derivative at seff=1");
27  params.addClassDescription(
28  "This Material calculates relative permeability of a phase using the van Genuchten model");
29  return params;
30 }
31 
33  const InputParameters & parameters)
35  _m(getParam<Real>("m")),
36  _cut(getParam<Real>("seff_turnover")),
39  _cub2(_cut < 1.0
40  ? (getParam<bool>("zero_derivative")
41  ? 3.0 * (1.0 - _cub0 - _cub1 * (1.0 - _cut)) / Utility::pow<2>(1.0 - _cut) +
42  _cub1 / (1.0 - _cut)
44  : 0.0),
45  _cub3(_cut < 1.0
46  ? (getParam<bool>("zero_derivative")
47  ? -2.0 * (1.0 - _cub0 - _cub1 * (1.0 - _cut)) / Utility::pow<3>(1.0 - _cut) -
48  _cub1 / Utility::pow<2>(1.0 - _cut)
49  : (1.0 - _cub0 - _cub1 * (1.0 - _cut) - _cub2 * Utility::pow<2>(1.0 - _cut)) /
50  Utility::pow<3>(1.0 - _cut))
51  : 0.0)
52 {
53 }
54 
55 Real
57 {
58  if (seff < _cut)
60 
61  return _cub0 + _cub1 * (seff - _cut) + _cub2 * Utility::pow<2>(seff - _cut) +
62  _cub3 * Utility::pow<3>(seff - _cut);
63 }
64 
65 Real
67 {
68  if (seff < _cut)
70 
71  return _cub1 + 2.0 * _cub2 * (seff - _cut) + 3.0 * _cub3 * Utility::pow<2>(seff - _cut);
72 }
Real relativePermeability(Real seff, Real m)
Relative permeability as a function of effective saturation.
Real d2RelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks)
Second derivative of relative permeability with respect to saturation.
virtual Real relativePermeability(Real seff) const override
Relative permeability equation (must be overriden in derived class)
InputParameters validParams< PorousFlowRelativePermeabilityVG >()
const Real _cub2
Parameter of the cubic.
van Genuchten effective saturation, capillary pressure and relative permeability functions.
const Real _cub1
Parameter of the cubic.
Base class for PorousFlow relative permeability materials.
const Real _m
van Genuchten exponent m for the specified phase
virtual Real dRelativePermeability(Real seff) const override
Derivative of relative permeability with respect to effective saturation.
Real dRelativePermeability(Real seff, Real m)
Derivative of relative permeability with respect to effective saturation.
Real dRelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks)
Derivative of relative permeability with respect to saturation.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
InputParameters validParams< PorousFlowRelativePermeabilityBase >()
Real relativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks)
Relative permeability as a function of saturation.
PorousFlowRelativePermeabilityVG(const InputParameters &parameters)
const Real _cub3
Parameter of the cubic.
const Real _cut
start of cubic smoothing
const Real _cub0
Parameter of the cubic.