The oil-water capillary pressure is a non-increasing function of
water saturation so we need to ensure that we use the capillary
pressure value at the minimum tabulated water saturation. Add
special purpose code to enforce this rule. This adds a certain
amount of computational overhead because we now compute function
values at two saturation points instead of just one for the case of
pure vertical scaling. Most of the time those extra function values
will just be subsequently discarded.
Note that this is a bit of hack, because it relies on the fact that
the current implementation assigns
TableEndPoints::disp = TableEndPoints::low
in the case of two-point horizontal scaling. We may wish to make
that rule more explicit.
These were meant for consistency checking, but would occasionally
fail due to round-off error when doing arithmetic on values
converted from 'float' to 'double'. The actual scaling procedure
does not rely on those relations as long as we ensure that 'fmax' is
the maximum function value, so add a measure of robustness here.
Note that this is at best a work-around for a deeper problem and
that a more refined solution would probably be needed here.
This commit ensures that we use the scaled connate water/gas
saturations (SWL/SGL) in place of the scaled capillary pressure
saturations (SWLPC/SGLPC) when the latter are undefined (set to a
sentinel value; -1.0E+20). We would previously fall directly back
to the connate saturations from the input table in this case and
this would lead to inconsistent curves for the scaled capillary
pressure functions.
The three-point vertical scaling option will usually change the
shape of the relative permeability function in the saturation
interval between the scaled critical displacing saturation and the
maximum phase saturation. In particular, we usually replace a
general, non-linear function with a linear approximation when
applying three-point vertical scaling.
Add a comment to that effect.
Fixes incorrect horizontal and vertical end-point scaling of model's
saturation functions.
API Change: No longer supports user-selected behaviour for treating
scaled end-points with a sentinel value (-1.0E+20). That option was
introduced due to incomplete understanding of the semantics of the
sentinel value. Now that we understand the meaning (use actual,
unscaled end-point value from input table), we no longer need the
option. Update the calling code in RigFlowDiagSolverInterface.cpp
accordingly.