OGS
CapillaryPressureSaturationCurve.h
Go to the documentation of this file.
1
13#pragma once
14
15#include <algorithm>
16#include <memory>
17
20
21namespace MaterialLib
22{
23namespace PorousMedium
24{
27{
28public:
30 std::unique_ptr<MathLib::PiecewiseLinearMonotonicCurve>&& curve_data)
32 curve_data->getSupportMin(),
33 1.0 - curve_data->getSupportMax(),
34 curve_data->getSupportMax(),
35 curve_data->getValue(curve_data->getSupportMin())),
36 _curve_data(std::move(curve_data))
37 {
38 }
39
41 std::string getName() const override
42 {
43 return "Capillary pressure saturation curve.";
44 }
45
47 double getCapillaryPressure(const double saturation) const override
48 {
49 const double S = std::clamp(saturation, _saturation_r + _minor_offset,
51
52 return _curve_data->getValue(S);
53 }
54
56 double getSaturation(const double capillary_pressure) const override
57 {
58 const double pc =
59 std::clamp(capillary_pressure, _minor_offset, _pc_max);
60 return _curve_data->getInverseVariable(pc);
61 }
62
64 double getdPcdS(const double saturation) const override
65 {
66 const double S = std::clamp(saturation, _saturation_r + _minor_offset,
68
69 return _curve_data->getDerivative(S);
70 }
71
75 double getd2PcdS2(const double /*saturation*/) const override { return 0; }
76
77private:
78 std::unique_ptr<MathLib::PiecewiseLinearMonotonicCurve> _curve_data;
79};
80
81} // namespace PorousMedium
82} // namespace MaterialLib
std::string getValue(std::string const &line, std::string const &val_name, bool is_string)
double getdPcdS(const double saturation) const override
Get the derivative of the capillary pressure with respect to saturation.
double getCapillaryPressure(const double saturation) const override
Get capillary pressure.
double getSaturation(const double capillary_pressure) const override
Get saturation.
CapillaryPressureSaturationCurve(std::unique_ptr< MathLib::PiecewiseLinearMonotonicCurve > &&curve_data)
std::unique_ptr< MathLib::PiecewiseLinearMonotonicCurve > _curve_data