www.mooseframework.org
PorousFlowBroadbridgeWhite.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 "MooseError.h"
14 #include "libmesh/utility.h"
15 
25 {
32 Real LambertW(Real z);
33 
44 Real effectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las);
45 
55 Real dEffectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las);
56 
66 Real d2EffectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las);
67 
78 template <typename T>
79 T
80 relativePermeability(const T & s, Real c, Real sn, Real ss, Real kn, Real ks)
81 {
82  if (MetaPhysicL::raw_value(s) <= sn)
83  return kn;
84 
85  if (MetaPhysicL::raw_value(s) >= ss)
86  return ks;
87 
88  const T coef = (ks - kn) * (c - 1.0);
89  const T th = (s - sn) / (ss - sn);
90  const T krel = kn + coef * Utility::pow<2>(th) / (c - th);
91  return krel;
92 }
93 
104 Real dRelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks);
105 
116 Real d2RelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks);
117 }
Real d2RelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks)
Second derivative of relative permeability with respect to saturation.
Real dEffectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las)
Derivative of effective saturation wrt capillary pressure.
Real LambertW(Real z)
Provides the Lambert W function, which satisfies W(z) * exp(W(z)) = z.
auto raw_value(const Eigen::Map< T > &in)
T relativePermeability(const T &s, Real c, Real sn, Real ss, Real kn, Real ks)
Relative permeability as a function of saturation.
Real d2EffectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las)
Second derivative of effective saturation wrt capillary pressure.
Real effectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las)
Effective saturation as a function of capillary pressure If pc>=0 this will yield 1...
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
Broadbridge-White version of relative permeability, and effective saturation as a function of capilla...