This is needed for distributed wells to save most of the code
from checking whether a perforation is in the interior.
We add new methods compressedIndexForInterior that return -1
for non-interior cells and use that for the wells. This restores
the old behaviour before 1cfe3e0aad
We used to tie reporting these quantities to whether or not a group
had any guide rates for production (GuideRate::has()), but this is
clearly insufficient for injection guide rates.
This commit adds an overload set named
loadRestartGuideRates
which, collectively, initialises the contained GuideRate object
using guide rate values from the restart file. This is necessary,
but not quite sufficient, to restart models in prediction mode with
group-level constraints.
Mostly for readability in preparation of initialising the guide rate
object with values from the restart file. The new stages, each with
its own 'loadRestart*Data()' member function are
- Connection
- Segment
- Well
- Group
While here, also switch to using std::any_of() in place of a raw
loop.
The output layer expects its input values to be strictly SI, but we
know that the GuideRate container's values are in output units.
Forgotten in PR #3467 (commit 517db198f8).
This commit moves the bodies of the various 'dynamicDispatch_<>()'
cases out to separate helper functions. Not only does this reduce
the number of nested conditionals, it also helps reasoning about
each case in isolation and aids future maintenance.
As multisegment wells may throw in applyUMFPack this is now needed and
the exception needs to communicated to all processes. We do this in
the linearize method of the well model.
Before this change this is what could happen:
- The process with the exception would have chopped the time step
- The others would have successfully setup the systems and entered the
linear solve
This poduced a deadlock. One processes was waiting in
OPM_END_PARALLEL_TRY during the setup of the shorter time step and in
collective communication during the setup of the linear solver for the
unchopped time step.