This commit ensures that the field, group, and well level cumulative
production curves of solution/free oil and gas are continuous in a
restarted simulation run.
Thanks to Torbjørn Skille for identifying the appropriate locations
in XGRP/XWEL for outputting these items.
This is a quick fix.
The problem that occurs is the following. After loadbalancing the
FieldPropsManager only has a non-nullptr to the FieldProperties on
the process with rank=0. Therefore most of the calls to it will
segfault. This has not been problem before changeset
2921838895. We did not make any calls to e.g.
FieldProperties::apply_schedule_keywords during a simulation.
Now we do via [eclproblem.hh#L1021-L1022](/OPM/opm-simulators/blob/3e4e62bc4f6f6f8a02eb2d2e4976dc2e2d956313/ebos/eclproblem.hh#L1021-L1022))
The maximum supply of lift gas and/or the maximum total gas flow
rate of a group may be defaulted in the context of lift gas
optimisation. In that case, the std::optional<> objects will be
empty and we must not access the contained object through the
value() member function. We output the sentinel value "-10" in this
case.
This is more self-documenting that numeric item indices. While
here, also switch to constructing the EQUIL record in place instead
of forming a temporary and moving it into the vector.
This commit ensures that we do not access the well's BHP reference
depth unless that value is well defined. If the input deck does not
define an explicit BHP reference depth (WELSPECS(5)), and if the
well does not have any active reservoir connections, then we are
supposed to output the usual sentinel value (-1.0E+20) as the datum
depth in 'SWEL'.
Account for this altered semantics in the restart reader too.
This commit adds a new member function,
bool Well::hasRefDepth() const
that allows the caller to query whether or not a particular well has
an active value for the well BHP reference depth. The most common
cause of this value being missing is that the depth item of WELSPECS
is defaulted while the well is not connected to any active cells.
This predicate allows client code, e.g., the restart output module,
to safely access reference depth values in the case of potentially
missing reference depths.