For dual porosity models, use PORV from the matrix part.
Also guard all conversion of 1-based to 0-based indexing to avoid potential undefined behaviour.
This commit introduces a new static function
ECLGraph::load(const ecl_grid_type*, const ECLInitFileData&)
This is in order to simplify constructing the backing graph from
ResInsight's .EGRID input--especially to have consistent view of
a model's active cells irrespective of which simulator created
the result set.
This commit refines the error message emitted if a particular
phase does not have a PVT interpolant--e.g., if the INIT file
does not provide PVT data. Previously we would generate a
message akin to
Region Index 0 Outside Valid Range (0 .. (size_t)-1)
which is not very helpful to users in diagnosing the issue. The
new message does at least indicate that there is no interpolant
for the accompanying phase and also emits the (1-based) region
index for context.
This commit captures the result set's availability of EPS data
in a new data member,
bool ECLSaturationFunc::Impl::haveEPSData_
We need this piece of information to identify whether a null
'eps_' data member corresponds to missing EPS data or failure to
form the backing EPS data object. In the first case, it is fine
to output the unscaled curves while throwing an exception in the
latter case is more appropriate.
This restores ResInsight's ability to show unscaled saturation
function curves if the backing EPS data is not output to the
result set's INIT file.
A simulation run might not activate all three phases. We therefore
must guard against querying the connate saturations of the missing
phase.
Pointy hat: Bard.Skaflestad@sintef.no
Thanks to: Magne Sjåstad
Recent developments have rendered this parameter unused. Remove
it to make API simpler. The library now always loads arrays as
if the caller requests end-point scaling behaviour and we defer
effects of actual end-point scaling until client code queries
the flux calculator at run time.
This simplifies the implementation of the 'phaseProperties' member
function and, in particular, restores the original code symmetry
amongst the individual phase cases.
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.
This commit introduces a new (private) predicate function
ECLFluxCalc::phaseIsActive(const ECLPhaseIndex phase) const
that identifies whether or not 'phase' is active in the current
simulation model/result set. This enables returning an empty result
vector from flux() and/or masssflux() in the case of the caller
requesting fluxes for inactive phases. That, in turn, mirrors the
behaviour of ECLGraph::flux() on inactive phases and promotes
uniform phase treatment in calling code irrespective of using stored
or calculated flux values.
A previous commit changed the reverse mapping behaviour in the case
of coincident tabulated scaled displacing saturation and maximum
phase saturation in the two-phase systems. Bring the corresponding
unit test in line with the changed behaviour (now maps high
saturation values to scaled critical displacing saturation Sr rather
than Smax in this situation).
Pointy Hat: [at]bska
Thanks to: [at]atgeirr
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.