www.mooseframework.org
PorousFlowRelativePermeabilityBW.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 
14 
15 template <bool is_ad>
18 {
21  "Sn",
22  "Sn >= 0",
23  "Low saturation. This must be < Ss, and non-negative. This is BW's "
24  "initial effective saturation, below which effective saturation never goes "
25  "in their simulations/models. If Kn=0 then Sn is the immobile saturation. "
26  "This form of effective saturation is only correct for Kn small.");
27  params.addRangeCheckedParam<Real>(
28  "Ss",
29  1.0,
30  "Ss <= 1",
31  "High saturation. This must be > Sn and <= 1. Effective saturation "
32  "where porepressure = 0. Effective saturation never exceeds this "
33  "value in BW's simulations/models.");
35  "Kn", "Kn >= 0", "Low relative permeability. This must be < Ks, and non-negative.");
37  "Ks", "Ks <= 1", "High relative permeability. This must be > Kn and less than unity");
39  "C", "C > 1", "BW's C parameter. Must be > 1. Typical value would be 1.05.");
40  params.addClassDescription("Broadbridge-White form of relative permeability");
41  return params;
42 }
43 
44 template <bool is_ad>
46  const InputParameters & parameters)
47  : PorousFlowRelativePermeabilityBaseTempl<is_ad>(parameters),
48  _sn(this->template getParam<Real>("Sn")),
49  _ss(this->template getParam<Real>("Ss")),
50  _kn(this->template getParam<Real>("Kn")),
51  _ks(this->template getParam<Real>("Ks")),
52  _c(this->template getParam<Real>("C"))
53 {
54  if (_ss <= _sn)
55  mooseError("In BW relative permeability Sn set to ",
56  _sn,
57  " and Ss set to ",
58  _ss,
59  " but these must obey Ss > Sn");
60  if (_ks <= _kn)
61  mooseError("In BW relative permeability Kn set to ",
62  _kn,
63  " and Ks set to ",
64  _ks,
65  " but these must obey Ks > Kn");
66 }
67 
68 template <bool is_ad>
71 {
72  return PorousFlowBroadbridgeWhite::relativePermeability(seff, _c, _sn, _ss, _kn, _ks);
73 }
74 
75 template <bool is_ad>
76 Real
78 {
79  return PorousFlowBroadbridgeWhite::dRelativePermeability(seff, _c, _sn, _ss, _kn, _ks);
80 }
81 
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void mooseError(Args &&... args)
Material that calculates the Broadbridge-White relative permeability P Broadbridge, I White `‘Constant rate rainfall infiltration: A versatile nonlinear model, 1 Analytical solution’&#39;.
PorousFlowRelativePermeabilityBWTempl(const InputParameters &parameters)
T relativePermeability(const T &s, Real c, Real sn, Real ss, Real kn, Real ks)
Relative permeability as a function of saturation.
const Real _kn
BW&#39;s low relative permeability.
virtual GenericReal< is_ad > relativePermeability(GenericReal< is_ad > seff) const override
Relative permeability equation (must be overriden in derived class)
Base class for PorousFlow relative permeability materials.
virtual Real dRelativePermeability(Real seff) const override
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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
const Real _ks
BW&#39;s high relative permeability.
typename Moose::GenericType< Real, is_ad > GenericReal
registerMooseObject("PorousFlowApp", PorousFlowRelativePermeabilityBW)