{Spline,PiecewiseLinear}TwoPhaseMaterial: limit the relperms to [0, 1]
it used to be the range of the sampling points. If for some reason the sampling points describe a subset of the full range, the material laws use extrapolation outside of the table and properly limit the values of that operation. In the real world, the effect of this change is rather limited because all tested tables used the range... TODO: adapt the evalDerivative() methods. This is not very urgent, though because they are usually not used...
This commit is contained in:
parent
34f50e6613
commit
883f032aa0
@ -310,14 +310,7 @@ public:
|
||||
{ return twoPhaseSatKrw(params, fs.saturation(Traits::wettingPhaseIdx)); }
|
||||
|
||||
static Scalar twoPhaseSatKrw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
if (Sw < params.SwSamples().front())
|
||||
return params.krwSamples().front();
|
||||
else if (Sw > params.SwSamples().back())
|
||||
return params.krwSamples().back();
|
||||
|
||||
return eval_(params.SwSamples(), params.krwSamples(), Sw);
|
||||
}
|
||||
{ return std::max(0.0, std::min(1.0, eval_(params.SwSamples(), params.krwSamples(), Sw))); }
|
||||
|
||||
/*!
|
||||
* \brief The derivative of the relative permeability of the
|
||||
@ -330,11 +323,6 @@ public:
|
||||
|
||||
static Scalar twoPhaseSatDKrw_dSw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
if (Sw < params.SwSamples().front())
|
||||
return 0;
|
||||
else if (Sw > params.SwSamples().back())
|
||||
return 0;
|
||||
|
||||
return evalDeriv_(params.SwSamples(),
|
||||
params.krwSamples(),
|
||||
Sw);
|
||||
@ -350,14 +338,9 @@ public:
|
||||
|
||||
static Scalar twoPhaseSatKrn(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
if (Sw < params.SwSamples().front())
|
||||
return params.krnSamples().front();
|
||||
else if (Sw > params.SwSamples().back())
|
||||
return params.krnSamples().back();
|
||||
|
||||
return eval_(params.SwSamples(),
|
||||
params.krnSamples(),
|
||||
Sw);
|
||||
return std::max(0.0, std::min(1.0, eval_(params.SwSamples(),
|
||||
params.krnSamples(),
|
||||
Sw)));
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -371,11 +354,6 @@ public:
|
||||
|
||||
static Scalar twoPhaseSatDKrn_dSw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
if (Sw < params.SwSamples().front())
|
||||
return 0;
|
||||
else if (Sw > params.SwSamples().back())
|
||||
return 0;
|
||||
|
||||
return evalDeriv_(params.SwSamples(),
|
||||
params.krnSamples(),
|
||||
Sw);
|
||||
|
@ -307,7 +307,7 @@ public:
|
||||
{ return twoPhaseSatKrw(params, fs.saturation(Traits::wettingPhaseIdx)); }
|
||||
|
||||
static Scalar twoPhaseSatKrw(const Params ¶ms, Scalar Sw)
|
||||
{ return params.krwSpline().eval(Sw, /*extrapolate=*/true); }
|
||||
{ return std::max(0.0, std::min(1.0, params.krwSpline().eval(Sw, /*extrapolate=*/true))); }
|
||||
|
||||
/*!
|
||||
* \brief The derivative of the relative permeability of the
|
||||
@ -330,7 +330,7 @@ public:
|
||||
{ return twoPhaseSatKrn(params, 1.0 - fs.saturation(Traits::nonWettingPhaseIdx)); }
|
||||
|
||||
static Scalar twoPhaseSatKrn(const Params ¶ms, Scalar Sw)
|
||||
{ return params.krnSpline().eval(Sw, /*extrapolate=*/true); }
|
||||
{ return std::max(0.0, std::min(1.0, params.krnSpline().eval(Sw, /*extrapolate=*/true))); }
|
||||
|
||||
/*!
|
||||
* \brief The derivative of the relative permeability for the
|
||||
|
Loading…
Reference in New Issue
Block a user