www.mooseframework.org
PorousFlowVanGenuchten.h
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 #pragma once
11 
12 #include "MooseTypes.h"
13 #include "libmesh/utility.h"
14 
31 {
41 
50 
59 
69 Real capillaryPressure(Real seff, Real alpha, Real m, Real pc_max);
70 
80 Real dCapillaryPressure(Real seff, Real alpha, Real m, Real pc_max);
81 
91 Real d2CapillaryPressure(Real seff, Real alpha, Real m, Real pc_max);
92 
99 template <typename T>
100 T
101 relativePermeability(const T & seff, Real m)
102 {
103  if (MetaPhysicL::raw_value(seff) <= 0.0)
104  return 0.0;
105  else if (MetaPhysicL::raw_value(seff) >= 1.0)
106  return 1.0;
107 
108  const T a = 1.0 - std::pow(seff, 1.0 / m);
109  const T b = 1.0 - std::pow(a, m);
110 
111  return std::sqrt(seff) * Utility::pow<2>(b);
112 }
113 
120 Real dRelativePermeability(Real seff, Real m);
121 
128 Real d2RelativePermeability(Real seff, Real m);
129 
136 template <typename T>
137 T
138 relativePermeabilityNW(const T & seff, Real m)
139 {
140  if (MetaPhysicL::raw_value(seff) <= 0.0)
141  return 0.0;
142  else if (MetaPhysicL::raw_value(seff) >= 1.0)
143  return 1.0;
144 
145  const T a = std::pow(1.0 - seff, 1.0 / m);
146  const T b = std::pow(1.0 - a, 2.0 * m);
147 
148  return std::sqrt(seff) * b;
149 }
150 
157 Real dRelativePermeabilityNW(Real seff, Real m);
158 
166 Real d2RelativePermeabilityNW(Real seff, Real m);
167 
177 {
179  {
183  };
188 
191  S(0.0),
192  Pc(std::numeric_limits<Real>::max()),
193  dPc(std::numeric_limits<Real>::lowest()){};
194 
196  : strategy(strategy), S(S), Pc(Pc), dPc(dPc){};
197 };
198 
208 {
210  {
213  };
218 
221  S(1.0),
222  Pc(0.0),
223  dPc(std::numeric_limits<Real>::lowest()){};
224 
226  : strategy(strategy), S(S), Pc(Pc), dPc(dPc){};
227 };
228 
246  Real sl,
247  Real slmin,
248  Real sgrdel,
249  Real alpha,
250  Real n,
251  const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
252  const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
253 
270  Real sl,
271  Real slmin,
272  Real sgrdel,
273  Real alpha,
274  Real n,
275  const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
276  const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
277 
293  Real sl,
294  Real slmin,
295  Real sgrdel,
296  Real alpha,
297  Real n,
298  const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
299  const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
300 
315 Real
316 saturationHys(Real pc,
317  Real slmin,
318  Real sgrdel,
319  Real alpha,
320  Real n,
321  const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
322  const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
323 
337 Real
338 dsaturationHys(Real pc,
339  Real slmin,
340  Real sgrdel,
341  Real alpha,
342  Real n,
343  const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
344  const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
345 
359 Real
360 d2saturationHys(Real pc,
361  Real slmin,
362  Real sgrdel,
363  Real alpha,
364  Real n,
365  const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
366  const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
367 
391  Real slr,
392  Real sgrdel,
393  Real sgrmax,
394  Real sldel,
395  Real m,
396  Real upper_liquid_param,
397  Real y0,
398  Real y0p,
399  Real y1,
400  Real y1p);
401 
425  Real slr,
426  Real sgrdel,
427  Real sgrmax,
428  Real sldel,
429  Real m,
430  Real upper_liquid_param,
431  Real y0,
432  Real y0p,
433  Real y1,
434  Real y1p);
435 
456  Real slr,
457  Real sgrdel,
458  Real sgrmax,
459  Real sldel,
460  Real m,
461  Real gamma,
462  Real k_rg_max,
463  Real y0p);
464 
485  Real slr,
486  Real sgrdel,
487  Real sgrmax,
488  Real sldel,
489  Real m,
490  Real gamma,
491  Real k_rg_max,
492  Real y0p);
493 }
Real dcapillaryPressureHys(Real sl, Real slmin, Real sgrdel, Real alpha, Real n, const LowCapillaryPressureExtension &low_ext=LowCapillaryPressureExtension(), const HighCapillaryPressureExtension &high_ext=HighCapillaryPressureExtension())
Derivative of capillaryPressureHys with respect to sl.
Real d2capillaryPressureHys(Real sl, Real slmin, Real sgrdel, Real alpha, Real n, const LowCapillaryPressureExtension &low_ext=LowCapillaryPressureExtension(), const HighCapillaryPressureExtension &high_ext=HighCapillaryPressureExtension())
Second derivative of capillaryPressureHys with respect to sl.
Real drelativePermeabilityHys(Real sl, Real slr, Real sgrdel, Real sgrmax, Real sldel, Real m, Real upper_liquid_param, Real y0, Real y0p, Real y1, Real y1p)
Derivative of Hysteretic relative permeability for liquid, with respect to liquid saturation...
Real relativePermeabilityNWHys(Real sl, Real slr, Real sgrdel, Real sgrmax, Real sldel, Real m, Real gamma, Real k_rg_max, Real y0p)
Hysteretic relative permeability for gas.
Parameters associated with the extension of the hysteretic wetting capillary pressure function to hig...
T relativePermeabilityNW(const T &seff, Real m)
Relative permeability for a non-wetting phase as a function of effective saturation.
auto raw_value(const Eigen::Map< T > &in)
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
van Genuchten effective saturation, capillary pressure and relative permeability functions.
auto max(const L &left, const R &right)
Real capillaryPressureHys(Real sl, Real slmin, Real sgrdel, Real alpha, Real n, const LowCapillaryPressureExtension &low_ext=LowCapillaryPressureExtension(), const HighCapillaryPressureExtension &high_ext=HighCapillaryPressureExtension())
Hysteretic capillary pressure function (Eqn(1) of Doughty2007) with extensions (page5 and Fig1 of Dou...
Real drelativePermeabilityNWHys(Real sl, Real slr, Real sgrdel, Real sgrmax, Real sldel, Real m, Real gamma, Real k_rg_max, Real y0p)
Derivative of hysteretic relative permeability for gas with respect to the liquid saturation...
Parameters associated with the extension of the hysteretic capillary pressure function to low saturat...
Real d2RelativePermeabilityNW(Real seff, Real m)
Second derivative of relative permeability for a non-wetting phase with respect to effective saturati...
Real relativePermeabilityHys(Real sl, Real slr, Real sgrdel, Real sgrmax, Real sldel, Real m, Real upper_liquid_param, Real y0, Real y0p, Real y1, Real y1p)
Hysteretic relative permeability for liquid.
Real d2CapillaryPressure(Real seff, Real alpha, Real m, Real pc_max)
Second derivative of capillary pressure wrt effective saturation.
Real dRelativePermeability(Real seff, Real m)
Derivative of relative permeability with respect to effective saturation.
T relativePermeability(const T &seff, Real m)
Relative permeability as a function of effective saturation.
Real effectiveSaturation(Real p, Real alpha, Real m)
Effective saturation as a function of porepressure.
LowCapillaryPressureExtension(const ExtensionStrategy &strategy, Real S, Real Pc, Real dPc)
HighCapillaryPressureExtension(const ExtensionStrategy &strategy, Real S, Real Pc, Real dPc)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string alpha
Definition: NS.h:126
Real dCapillaryPressure(Real seff, Real alpha, Real m, Real pc_max)
Derivative of capillary pressure wrt effective saturation.
Real d2EffectiveSaturation(Real p, Real alpha, Real m)
Second derivative of effective saturation wrt porepressure.
Real dsaturationHys(Real pc, Real slmin, Real sgrdel, Real alpha, Real n, const LowCapillaryPressureExtension &low_ext=LowCapillaryPressureExtension(), const HighCapillaryPressureExtension &high_ext=HighCapillaryPressureExtension())
Derivative of Hysteretic saturation function with respect to pc.
Real d2RelativePermeability(Real seff, Real m)
Second derivative of relative permeability with respect to effective saturation.
Real d2saturationHys(Real pc, Real slmin, Real sgrdel, Real alpha, Real n, const LowCapillaryPressureExtension &low_ext=LowCapillaryPressureExtension(), const HighCapillaryPressureExtension &high_ext=HighCapillaryPressureExtension())
Second derivative of Hysteretic saturation function with respect to pc.
Real dEffectiveSaturation(Real p, Real alpha, Real m)
Derivative of effective saturation wrt porepressure.
Real dRelativePermeabilityNW(Real seff, Real m)
Derivative of relative permeability for a non-wetting phase with respect to effective saturation...
MooseUnits pow(const MooseUnits &, int)
Real saturationHys(Real pc, Real slmin, Real sgrdel, Real alpha, Real n, const LowCapillaryPressureExtension &low_ext=LowCapillaryPressureExtension(), const HighCapillaryPressureExtension &high_ext=HighCapillaryPressureExtension())
Hysteretic saturation function (Eqn(1) of Doughty2007) with extensions (page5 and Fig1 of Doughty2008...
Real capillaryPressure(Real seff, Real alpha, Real m, Real pc_max)
Capillary pressure as a function of effective saturation.