This commit switches to using the 'welpi_wells' information from the
SimulatorUpdate structure as a basis to decide the wells for which
it is safe/sufficient to update only the CTFs in response to an
ACTIONX block running WELPI. To this end, we split the actions of
the existing member function updateEclWells() into two parts,
1. updateEclWellsConstraints()
2. updateEclWellsCTFFromAction()
in which the first handles well status and well control updates
while the second deals with CTF updates in response to WELPI. We do
not run the second part if the well structure has changed--e.g., due
to COMPDAT or WELOPEN--since the update loop depends on a static
connection topology.
We add a new member function wellUpdateLoop() which will traverse a
sequence of well names and invoke a loop body on those wells which
exist in wells_ecl_. This collects common operations needed for
both the constraints and the CTF updates.
The new parameter CheckSatfuncConsistency, command line option
--check-satfunc-consistency, allows users to opt into running the
checks. The option currently defaults to 'false' to reflect the
somewhat experimental nature of the new facility.
The new parameter --num-satfunc-consistency-sample-points allows the
user to select the maximum number of reported failures for each
individual consistency check. By default, the simulator will report
at most five failures for each check.
We check the unscaled curves if the run does not activate the
end-point scaling option and the scaled curves otherwise. At
present we're limited to reversible and non-directional saturation
functions for the drainage process, but those restrictions will be
lifted in due time.
This commit introduces a new top-level "manager" for all saturation
function consistency checks. This component associates collections
of saturation function curves with per-cell or per-region end-point
definitions and provides an interface to run all checks for all
interior entities (i.e., active cells) in a DUNE grid view. We form
one set of SatfuncConsistencyChecks objects for each
SatfuncCheckPointInterface<> object, thereby enabling running the
same set of consistency checks for both the unscaled, tabulated,
per-region saturation functions and the per-cell scaled saturation
functions. The latter is executed only if the run enables end-point
scaling for the saturation functions while the former is executed
only if the run does not enable end-point scaling.
At present we're limited to reversible and non-directional
saturation functions for the drainage process only, but those
restrictions will be lifted in due time.
As an aid to enabling the pertinent individual checks, we add a
private factory function which considers the run's active phases and
whether or not the run uses the alternative, three-point horizontal
scaling method ("SCALECRS = YES").
The 'globalIdx' generated by localIdxToGlobalIdx() is in the range
zero to number of active cells in global model, not zero to number
of active cells on rank. Using 'globalIdx' as an argument to
set*TracerConcentration() therefore ends up indexing out-of-bounds
for the internal arrays in the tracer model object in parallel
restarted simulation runs.
The problem has been present since the restart support for tracers
was added in commit e9c45f4ca (PR #3708).
This commit switches to using the 'elemIdx' instead, as we already
do when calling the output module's setRestart() member function.
Following this, we are able to restart the standard Norne benchmark
case (NORNE_ATW2013.DATA) in parallel. The numerical results for
the tracer concentrations are, however, a little questionable and
will warrant further investigation. Nevertheless, the tracer values
are now the same in a parallel restarted run as in a sequential
restarted run.
This commit introduces a set of callback functions, packaged in an
abstract base class SatfuncCheckPointInterface<Scalar>, for querying
and populating the saturation function end-points that get probed by
the individual consistency checks. Member function
SatfuncCheckPointInterface::pointID(cellIdx)
translates the active cell index 'cellIdx' into a point ID, assumed
to be unique on at least the current MPI rank. This function will
return 'nullopt' if the 'cellIdx' is not eligible for this
particular end-point. This typically happens for the region based
tabulated (unscaled) saturation function checks when the 'cellIdx'
happens to be in a region that's already been visited. Member
function
SatfuncCheckPointInterface::populateCheckPoint(cellIdx, endPoints)
fills in (assigns) all data members of the 'endPoints' structure
with the pertinent values for the active cell 'cellIdx'.
We implement this interface for the tabulated/unscaled end-points in
derived class UnscaledSatfuncCheckPoint<Scalar> and for the scaled
end-points in derived class ScaledSatfuncCheckPoint<Scalar>. The
former keeps track of which saturation regions have been visited
and short-circuits its 'pointID()' member function based on that
information while the latter uses an instance of the former in order
initialise the 'endPoints' structure in its populateCheckPoint()
member function.