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'.
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.
This commit adds parser and evaluation logic necessary to handle
ASSIGN statements for segment level UDQs. This requires a segment
matching facility in UDQConfig::add_assign() which, in turn, must be
passed from the calling context in Schedule::handleUDQ(). Update
APIs accordingly.
We also split handling segment level UDQ assignments to a new helper
function, UDQConfig::add_enumerated_assign(), which might be
generalised to handle block level UDQs in the future.
This commit adds support for calculating UDQs at the segment level,
i.e., UDQs named 'SU*'. This necessitates an API change for the UDQ
context constructor and, transitively, every function that forms UDQ
context objects. We pass a factory function that will create
segment matcher objects on demand, and provide a default
implementation of this factory function in the Schedule class.
An assignment of the form
ASSIGN WUPPERTAL 354.572 /
should create a UDQ set of size equal to the number of wells in
the model, not just the wells already flowing-especially if the
assignment happens on the very first report step before any wells
are flowing.
Needed in order to support segment sets which, potentially, have
both a well name pattern and a segment number.
This change also means that we now support *parsing* block (cell)
UDQ sets like
BPR 11 22 33
and that, in turn, means we detect unsupported UDQ types later than
we used to. That also means that the error detection exception type
changes, so update affected unit tests accordingly.
This commit adds support for constructing UDQ ASSIGN records for
enumerated well items such as those encountered in UDQs at the
segment level, e.g.,
ASSIGN SUSPECT PROD01 123.456 /
ASSIGN SUSPECT PROD02 17 654.321 /
We do not support this syntax quite yet, but this is a step on the
way there.
This commit extends the set of supported UDQ enumators to include
those of the WELTARG keyword. This is in preparation of adding
restart file support for such cases.
The UDQDefine::input_string() function will return normalized input which is
equivalent to the deck input string, but not necessarily identical. Normalizing
which might give rise to differences:
- All selectors/qualifiers in expressions like "WWCT '*'" are quoted.
- Whether to pad operators with space like "170 + FU_PAR10" or "170+FU_PAR10" is
hardcoded and independent of the space used in the input.
- Floating point numbers is output with format "%g" - no trailing zeros.
This commit adds UDA items for the GCONINJE keyword. This is in
preparation of tracking UDA status in this context. While here,
also add unit tests for the expected values of UDQ::keyword() and
UDQ::udaCode().