OGS
BrooksCoreyCapillaryPressureSaturation.cpp
Go to the documentation of this file.
1
14
15#include <algorithm>
16#include <cmath>
17
18namespace MaterialLib
19{
20namespace PorousMedium
21{
23 const double saturation) const
24{
25 const double S = std::clamp(saturation, _saturation_r + _minor_offset,
27 const double Se = (S - _saturation_r) / (_saturation_max - _saturation_r);
28 const double pc = _pb * std::pow(Se, -1.0 / _m);
29 return std::clamp(pc, _minor_offset, _pc_max);
30}
31
33 const double capillary_pressure) const
34{
35 const double pc =
36 (capillary_pressure < 0.0) ? _minor_offset : capillary_pressure;
37 const double Se = std::pow(pc / _pb, -_m);
38 const double S = Se * (_saturation_max - _saturation_r) + _saturation_r;
39 return std::clamp(S, _saturation_r + _minor_offset,
41}
42
44 const double saturation) const
45{
46 const double S = std::clamp(saturation, _saturation_r + _minor_offset,
48 const double val = std::pow(
49 ((S - _saturation_r) / (_saturation_max - _saturation_r)), -1.0 / _m);
50 return (_pb * val) / (_m * (_saturation_r - S));
51}
52
53} // namespace PorousMedium
54} // namespace MaterialLib
double getCapillaryPressure(const double saturation) const override
Get capillary pressure.
double getSaturation(const double capillary_pressure) const override
Get saturation.
double getdPcdS(const double saturation) const override
Get the derivative of the capillary pressure with respect to saturation.