Go to the documentation of this file.
16 InputParameters params = validParams<DiscreteElementUserObject>();
17 params.addRangeCheckedParam<Real>(
20 "sat_lr >= 0 & sat_lr < 1",
21 "Liquid residual saturation. Must be between 0 and 1. Default is 0");
22 params.addRangeCheckedParam<Real>(
"pc_max",
25 "Maximum capillary pressure (Pa). Must be > 0. Default is 1e9");
26 params.addParam<
bool>(
"log_extension",
28 "Use a logarithmic extension for low saturation to avoid capillary "
29 "pressure going to infinity. Default is true. Set to false if your "
30 "capillary pressure depends on spatially-dependent variables other than "
31 "saturation, as the log-extension C++ code for this case has yet to be "
33 params.addClassDescription(
"Capillary pressure base class");
38 : DiscreteElementUserObject(parameters),
39 _sat_lr(getParam<Real>(
"sat_lr")),
40 _dseff_ds(1.0 / (1.0 - _sat_lr)),
41 _log_ext(getParam<bool>(
"log_extension")),
42 _pc_max(getParam<Real>(
"pc_max")),
46 _log10(std::log(10.0))
141 const unsigned int max_its = 20;
142 const Real nr_tol = 1.0e-8;
143 unsigned int iter = 0;
182 DualReal result = Pc;
183 result.derivatives() =
saturation.derivatives() * dPc_ds;
Real dSaturation(Real pc, unsigned qp=0) const
Derivative of saturation wrt capillary pressure.
PorousFlowCapillaryPressure(const InputParameters ¶meters)
virtual Real capillaryPressureCurve(Real saturation, unsigned qp=0) const =0
Raw capillary pressure curve (does not include logarithmic extension)
Real d2CapillaryPressureLogExt(Real s) const
The second derivative of capillary pressure in the logarithmic extension This implementation assumes ...
virtual Real d2EffectiveSaturation(Real pc, unsigned qp=0) const =0
Second derivative of effective saturation wrt capillary pressure.
Real _slope_ext
Gradient of the logarithmic extension This is computed only for qp=0.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real interceptFunction(Real s) const
Calculates the saturation where the logarithmic extension to capillary pressure at low saturation.
Real _sat_ext
Saturation where the logarithmic extension meets the raw curve This is computed only for qp=0.
virtual Real d2CapillaryPressureCurve(Real saturation, unsigned qp=0) const =0
Second derivative of raw capillary pressure wrt true saturation.
Real effectiveSaturationFromSaturation(Real saturation) const
Effective saturation of liquid phase given liquid saturation and residual liquid saturation.
Real _pc_ext
Capillary pressure where the extension meets the raw curve.
Real dCapillaryPressureLogExt(Real s) const
The derivative of capillary pressure in the logarithmic extension This implementation assumes capilla...
virtual Real effectiveSaturation(Real pc, unsigned qp=0) const =0
Effective saturation as a function of capillary pressure.
virtual Real dEffectiveSaturation(Real pc, unsigned qp=0) const =0
Derivative of effective saturation wrt capillary pressure.
virtual Real capillaryPressure(Real saturation, unsigned qp=0) const
Capillary pressure is calculated as a function of true saturation.
virtual Real dCapillaryPressure(Real saturation, unsigned qp=0) const
Derivative of capillary pressure wrt true saturation.
const Real _sat_lr
Liquid residual saturation.
const Real _pc_max
Maximum capillary pressure (Pa). Note: must be <= 0.
InputParameters validParams< PorousFlowCapillaryPressure >()
Real interceptFunctionDeriv(Real s) const
Calculates the saturation where the logarithmic extension to capillary pressure at low saturation.
Real d2Saturation(Real pc, unsigned qp=0) const
Second derivative of saturation wrt capillary pressure.
Real extensionSaturation() const
Calculates the saturation where the logarithmic extension to capillary pressure meets the raw curve u...
virtual Real d2CapillaryPressure(Real saturation, unsigned qp=0) const
Second derivative of capillary pressure wrt true saturation.
Real capillaryPressureLogExt(Real s) const
The capillary pressure in the logarithmic extension This implementation assumes capillary-pressure is...
bool _log_ext
Flag to use a logarithmic extension for low saturation.
virtual void initialSetup() override
Real saturation(Real pc, unsigned qp=0) const
Saturation as a function of capillary pressure.
virtual Real dCapillaryPressureCurve(Real saturation, unsigned qp=0) const =0
Derivative of raw capillary pressure wrt true saturation.