We don't need to reimplement logic that's already present and it is
always an error to pass a 'report_step' argument that exceeds
Schedule::size().
Pointed out by: [at]blattms.
If there are errors at the top level (e.g. RUNSPEC comes after
NOECHO), we might get very many errors and the user might miss
the relevant ones on top.
To fix this we will now print those errors last just before exiting
the simulator because of these errors.
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.
In particular, use a single loop over the 'input_index' instead of
one separate loop for each supported variable type. This is in
preparation of adding suport for segment level UDQ ASSIGN statements.
This commit adds logic that enables recognizing segment level UDQs
in the summary output writer. We calculate all segment level UDQs
and add the values to the summary state for possible use in ACTIONX
too. The latter is not yet tested.
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.
The existing algorithm was a little too fragile and dependent on
branch numbers. This new version starts at segment 1/branch 1 and
follows Segment::inletSegments() in depth-first order, taking care
to enqueue new branches as they're encountered instead of in
numerical order. We search to the end of each branch before
switching to the next branch. This ensures determinism regardless
of branch numbering and input ordering.
While here, switch iLBR_ to a WindowedMatrix<int> to simplify branch
references in the output table.
The value in ISEG[0] does not necessarily correspond to the search
order of that segment. Rather, ISEG[0] is the depth-first ordering
of the segment search tree when traversing kick-off branches before
the main stem from which those branches kick off.
This is in preparation of revising the algorithm for ILBR/ILBS.
Mostly splitting long lines, adding missing headers, passing scalars
by value, and making three helper structures private to the
implementation file. There are no external users of these types.
If one WELSEGS keyword does not redefine every existing segment,
then we risk adding the same inlet segment multiple times. If that
happens, we get a segment structure for which there might appear to
be multiple inlet segments on the same branch which is not possible
in a tree structure. This commit prevents that situation by only
adding the new segment number if it is not already listed in
'm_inlet_segments'.
The simulator reports data::Connection objects tied to global
Cartesian cell indices whence using the 'active_index' leads to
match failures and incorrect rate attribution at the region level.
In one field case we got region level rates and cumulatives, e.g.,
ROPR and ROPT, of zero reported to the summary file when the
expected values should be non-zero.
This commit switches the region set tag matching algorithm to using
unique prefixes. This enables the parser to recognise that the
summary vector
ROPR_UNI
should match up with the user defined region set 'FIPUNIT'. In the
current master sources, the above summary vector would produce a
diagnostic message saying that the region set 'FIPUNI' (without the
final 'T') does not exist.
We add a prefix-to-canonical region set name translation table to
the FieldProps class and funnel all FIP-like requests through this
translation table. In the case of non-unique prefixes-e.g., FIPUNIT
and FIPUNIX, we currently elect to have the last keyword entered in
the simulation model "win". This behaviour may be altered in the
future if deemed appropriate/necessary.
In particular, add support for outputting the following vectors
- WOGR -- Well level oil/gas ratio
- WWGRH -- Well level water/gas ratio (observed rates)
- FPRH -- Field level average pressure (hydrocarbon volume)
- FHPV -- Field level total hydrocarbon pore-volume
This commit switches the existing, somewhat spotty, support for
matching region set tags on region level summary vector keywords.
We leverage the recent support for 'deck_name_regex_suffix' keys in
the JSON keyword model to extend the keyword matching algorithm to
also account for these region set tags.
There is a potential for false positives here, but we'll use this
as an initial proof-of-concept implementation.
If multiple records, from different region sets and region
IDs--e.g., both regions 1/2 in 'M' (MULTNUM) and regions 2/3 in 'F'
(FLUXNUM) applies to the same connection as might be the case in
MULTREGT
1 2 0.5 1* 'NNC' 'F' /
2 3 0.1 1* 'NNC' 'M' /
/
then the total multiplier value is the product of the values from
each record.
This commit revises the region set loop to accumulate the total
multiplier value instead of "just" returning the first match.
The simulator already calculates the requisite values, but due to
the requisite summary keyword RPRH not being listed among the known
region level vectors the output layer did not write the values to
the summary file. This commit adds the requisite table entry.