www.mooseframework.org
PorousFlowRelativePermeabilityVG.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 
11 #include "libmesh/utility.h"
12 
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<PorousFlowRelativePermeabilityBase>();
20  params.addRequiredRangeCheckedParam<Real>(
21  "m", "m > 0 & m < 1", "The van Genuchten exponent of the phase");
22  params.addRangeCheckedParam<Real>("seff_turnover",
23  1.0,
24  "seff_turnover > 0 & seff_turnover <= 1",
25  "The relative permeability will be a cubic for seff > "
26  "seff_turnover. The cubic is chosen so that its derivative "
27  "and value matche the VG function at seff=seff_turnover");
28  params.addParam<bool>("zero_derivative",
29  false,
30  "Employ a cubic for seff>seff_turnover that has zero derivative at seff=1");
31  params.addParam<bool>("wetting",
32  true,
33  "If true, use the van Genuchten form appropriate for a wetting (liquid) "
34  "phase. If false, use the non-wetting (gas) expression.");
35  params.addClassDescription("This Material calculates relative permeability of a phase "
36  "using the van Genuchten model");
37  return params;
38 }
39 
41  const InputParameters & parameters)
43  _m(getParam<Real>("m")),
44  _wetting(getParam<bool>("wetting")),
45  _cut(getParam<Real>("seff_turnover")),
46  _cub0(_wetting ? PorousFlowVanGenuchten::relativePermeability(_cut, _m)
48  _cub1(_wetting ? PorousFlowVanGenuchten::dRelativePermeability(_cut, _m)
50  _cub2(_cut < 1.0
51  ? (getParam<bool>("zero_derivative")
52  ? 3.0 * (1.0 - _cub0 - _cub1 * (1.0 - _cut)) / Utility::pow<2>(1.0 - _cut) +
53  _cub1 / (1.0 - _cut)
54  : (_wetting ? PorousFlowVanGenuchten::d2RelativePermeability(_cut, _m)
56  : 0.0),
57  _cub3(_cut < 1.0
58  ? (getParam<bool>("zero_derivative")
59  ? -2.0 * (1.0 - _cub0 - _cub1 * (1.0 - _cut)) / Utility::pow<3>(1.0 - _cut) -
60  _cub1 / Utility::pow<2>(1.0 - _cut)
61  : (1.0 - _cub0 - _cub1 * (1.0 - _cut) - _cub2 * Utility::pow<2>(1.0 - _cut)) /
62  Utility::pow<3>(1.0 - _cut))
63  : 0.0)
64 {
65 }
66 
67 Real
69 {
70  if (seff < _cut)
71  {
72  if (_wetting)
74  else
76  }
77 
78  return _cub0 + _cub1 * (seff - _cut) + _cub2 * Utility::pow<2>(seff - _cut) +
79  _cub3 * Utility::pow<3>(seff - _cut);
80 }
81 
82 Real
84 {
85  if (seff < _cut)
86  {
87  if (_wetting)
89  else
91  }
92 
93  return _cub1 + 2.0 * _cub2 * (seff - _cut) + 3.0 * _cub3 * Utility::pow<2>(seff - _cut);
94 }
PorousFlowBrooksCorey::relativePermeabilityNW
Real relativePermeabilityNW(Real seff, Real lambda)
Relative permeability of the non-wetting phase as a function of effective saturation.
Definition: PorousFlowBrooksCorey.C:104
PorousFlowVanGenuchten::relativePermeability
Real relativePermeability(Real seff, Real m)
Relative permeability as a function of effective saturation.
Definition: PorousFlowVanGenuchten.C:114
PorousFlowBrooksCorey::dRelativePermeabilityNW
Real dRelativePermeabilityNW(Real seff, Real lambda)
Derivative of relative permeability of the non-wetting phase wrt to effective saturation.
Definition: PorousFlowBrooksCorey.C:115
pow
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Definition: ExpressionBuilder.h:673
PorousFlowBroadbridgeWhite::d2RelativePermeability
Real d2RelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks)
Second derivative of relative permeability with respect to saturation.
Definition: PorousFlowBroadbridgeWhite.C:155
PorousFlowRelativePermeabilityVG::_cub2
const Real _cub2
Parameter of the cubic.
Definition: PorousFlowRelativePermeabilityVG.h:55
PorousFlowRelativePermeabilityVG::_wetting
const bool _wetting
Whether to use the wetting or non-wetting van Genuchten expression.
Definition: PorousFlowRelativePermeabilityVG.h:45
PorousFlowRelativePermeabilityVG
Material to calculate van Genuchten-type relative permeability of an arbitrary phase given the satura...
Definition: PorousFlowRelativePermeabilityVG.h:32
PorousFlowRelativePermeabilityBase
Base class for PorousFlow relative permeability materials.
Definition: PorousFlowRelativePermeabilityBase.h:24
PorousFlowRelativePermeabilityVG::dRelativePermeability
virtual Real dRelativePermeability(Real seff) const override
Derivative of relative permeability with respect to effective saturation.
Definition: PorousFlowRelativePermeabilityVG.C:83
PorousFlowVanGenuchten::relativePermeabilityNW
Real relativePermeabilityNW(Real seff, Real m)
Relative permeability for a non-wetting phase as a function of effective saturation.
Definition: PorousFlowVanGenuchten.C:161
PorousFlowBroadbridgeWhite::dRelativePermeability
Real dRelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks)
Derivative of relative permeability with respect to saturation.
Definition: PorousFlowBroadbridgeWhite.C:140
registerMooseObject
registerMooseObject("PorousFlowApp", PorousFlowRelativePermeabilityVG)
PorousFlowVanGenuchten::d2RelativePermeabilityNW
Real d2RelativePermeabilityNW(Real seff, Real m)
Second derivative of relative permeability for a non-wetting phase with respect to effective saturati...
Definition: PorousFlowVanGenuchten.C:190
PorousFlowRelativePermeabilityVG.h
PorousFlowRelativePermeabilityVG::_m
const Real _m
van Genuchten exponent m for the specified phase
Definition: PorousFlowRelativePermeabilityVG.h:42
validParams< PorousFlowRelativePermeabilityVG >
InputParameters validParams< PorousFlowRelativePermeabilityVG >()
Definition: PorousFlowRelativePermeabilityVG.C:17
PorousFlowVanGenuchten
van Genuchten effective saturation, capillary pressure and relative permeability functions.
Definition: PorousFlowVanGenuchten.h:29
PorousFlowRelativePermeabilityVG::_cub0
const Real _cub0
Parameter of the cubic.
Definition: PorousFlowRelativePermeabilityVG.h:51
PorousFlowRelativePermeabilityVG::_cub1
const Real _cub1
Parameter of the cubic.
Definition: PorousFlowRelativePermeabilityVG.h:53
PorousFlowBroadbridgeWhite::relativePermeability
Real relativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks)
Relative permeability as a function of saturation.
Definition: PorousFlowBroadbridgeWhite.C:125
PorousFlowVanGenuchten::dRelativePermeability
Real dRelativePermeability(Real seff, Real m)
Derivative of relative permeability with respect to effective saturation.
Definition: PorousFlowVanGenuchten.C:128
PorousFlowRelativePermeabilityVG::_cut
const Real _cut
Start of cubic smoothing.
Definition: PorousFlowRelativePermeabilityVG.h:48
PorousFlowRelativePermeabilityVG::PorousFlowRelativePermeabilityVG
PorousFlowRelativePermeabilityVG(const InputParameters &parameters)
Definition: PorousFlowRelativePermeabilityVG.C:40
validParams< PorousFlowRelativePermeabilityBase >
InputParameters validParams< PorousFlowRelativePermeabilityBase >()
Definition: PorousFlowRelativePermeabilityBase.C:14
PorousFlowRelativePermeabilityVG::_cub3
const Real _cub3
Parameter of the cubic.
Definition: PorousFlowRelativePermeabilityVG.h:57
PorousFlowVanGenuchten::dRelativePermeabilityNW
Real dRelativePermeabilityNW(Real seff, Real m)
Derivative of relative permeability for a non-wetting phase with respect to effective saturation.
Definition: PorousFlowVanGenuchten.C:175
PorousFlowRelativePermeabilityVG::relativePermeability
virtual Real relativePermeability(Real seff) const override
Relative permeability equation (must be overriden in derived class)
Definition: PorousFlowRelativePermeabilityVG.C:68