https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowBroadbridgeWhite.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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{
32Real LambertW(Real z);
33
44Real effectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las);
45
55Real dEffectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las);
56
66Real d2EffectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las);
67
78template <typename T>
79T
80relativePermeability(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
104Real dRelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks);
105
116Real d2RelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks);
117}
const double T
auto raw_value(const Eigen::Map< T > &in)
Broadbridge-White version of relative permeability, and effective saturation as a function of capilla...
Real dRelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks)
Derivative of relative permeability with respect to saturation.
T relativePermeability(const T &s, Real c, Real sn, Real ss, Real kn, Real ks)
Relative permeability as a function of saturation.
Real d2RelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks)
Second derivative of relative permeability with respect to saturation.
Real d2EffectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las)
Second derivative of effective saturation wrt capillary pressure.
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.
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,...