Some SCHEDULE keywords can set a well to be OPEN to open a reviouly STOP or SHUT well.
The well is SHUT/STOP due to various causes (SCHEDULE, economical, physical, etc.)
For now, the WELOPEN, WCONPROD and WCONINJE keywords are considered with this event.
In the future, other keywords can be involved if found to have the
similar OPENing functionality.
This commit extracts the internal helpers of class
InterRegFlowMap
out to a new public helper class template, CSRGraphFromCoordinates.
Client code can, at the expense of one additional data member and
some dynamic memory, elect to track the index pairs. This enables
O(1) assembly per element when used as part of a CSR matrix with a
value array, SA.
Class CSRGraphFromCoordinates does not track values. It is purely
for the sake of forming the IA and JA structure arrays. Upon
calling 'compress()', column indices are sorted per row and
duplicate column indices condensed to a single, unique,
representative.
The rest of the code allows an ACTIONX keyword without any
condition (Such an action will never be evaluated). Yet
AggregateActionXData assumed that there is always at least one
condition. This lead to a segmentation fault if that was not the case.
It seemed like iAC[offset + Ix::FirstGreater] is used nowhere and
therefore we now always use 0 there. I was not brave enouogh to remove
the storage for it, because I fear this might break backwards
compatibility of the output layer.
Member function SummaryState::update_udq() did not take into account
the possibility that wells or groups might not yet have come online.
In particular, UDQSet::operator[](const string&) will throw an
exception if the argument string does not name an existing member of
the UDQ set.
This commit makes the call to operator[]() conditional on the named
entity existing and thereby enables updating well and group level
UDQs before these names have been entered in, e.g., WELSPECS or
GRUPTREE. Missing entities get the 'undefined_value'.
Running simulations on those does not make sense as it seriously
limits the time span that can be simulated. In addition the OPM code
neglects 32bit issues at various places as it was written at a time
where 64bit was already ubiquitous.
Currently, we would fail in some regression tests on 32bit
systems. With this change CMake will already check whether it is run
on a 64bit system and already fail if this is not the case.
Fixes
```
/opm/input/eclipse/Schedule/Schedule.hpp:241:14: error: ‘function’ in namespace ‘std’ does not name a template type
241 | std::function<std::unique_ptr<SegmentMatcher>()> segmentMatcherFactory(std::size_t report_step) const;
| ^~~~~~~~
```
The existing implementation used the UDQ State object to track
pending ASSIGN operations, mainly in terms of the report step index,
but this implies that the logic implicitly assumes an ASSIGN
operation can run at most once per report step. That assumption
usually holds, but fails if the ASSIGN operation is triggered from
an ACTIONX block that happens to run multiple times within a report
step.
This commit instead introduces a new data member,
UDQConfig::pending_assignments_
that keeps track of all ASSIGN operations that have been added for
the current report step. We clear those pending assignments when
forming a new Schedule block (ScheduleState object), under the
assumption that all pending ASSIGN operations have been affected at
the previous time level (report step).
In effect, this new data member assumes the role of
UDQState::assignments
and we therefore remove that data member and update the signature of
UDQState::add_assign()
to account for the fact that the 'report_step' parameter is no
longer needed.