Commit Graph

14723 Commits

Author SHA1 Message Date
Markus Blatt
3a63c1723b Allow global keywords before RUNSPEC in input file. 2023-10-05 22:33:08 +02:00
Bård Skaflestad
7d16924f06 Defer Bounds Checking to Schedule::operator[]()
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.
2023-10-05 18:25:49 +02:00
Bård Skaflestad
0f1f2f74f0 Highlight Deferred Initialisation in EvalAssign::operator()
The logic and the reasoning behind it was too obtuse.
2023-10-05 18:23:38 +02:00
Bård Skaflestad
c93243f939 Rename Segment Matcher Factory Data Member
Invoking the factory creates a segment matcher object, not a new
factory.

Suggested by: [at]blattms
2023-10-05 18:22:07 +02:00
Markus Blatt
4caa693d71 Make top level section error more prominent to help users.
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.
2023-10-05 17:09:38 +02:00
Bård Skaflestad
381ab825b1 Support Segment Level UDQ ASSIGN Statements
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.
2023-10-04 10:44:49 +02:00
Bård Skaflestad
f3245ad88a Refactor Assignment Evaluation Routine
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.
2023-10-04 10:44:49 +02:00
Bård Skaflestad
cf9b66d8ec Make Derivation of Enumerated Well Items Public
We need this ability to handle segment level UDQ ASSIGN statements
too, so give the operation a well defined home and call it where
applicable.
2023-10-04 10:44:49 +02:00
Bård Skaflestad
72519e3e1f Add Support for Outputting Segment Level UDQs to Summary
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.
2023-10-04 10:44:49 +02:00
Bård Skaflestad
adab33ac60 Compute Segment Level UDQ Values
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.
2023-10-04 10:44:49 +02:00
Bård Skaflestad
a8d3dff2a4
Merge pull request #3696 from bska/msw-rst-fixup
Fix Multiple Issues in MSW Output Array Creation Logic
2023-10-04 09:55:02 +02:00
Bård Skaflestad
6d3ee57dd5 Define ILBR/ILBS in Terms of Depth First Traversal
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.
2023-10-02 14:59:55 +02:00
Bård Skaflestad
d7edd7c2ee Fix ISEG[0] Output Order
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.
2023-10-02 14:25:40 +02:00
Bård Skaflestad
1d5ae49cdc Set ISEG Open/Shut Flag for Valves
Missing in earlier editions of the segment output code.
2023-10-02 14:25:40 +02:00
Bård Skaflestad
d3bf44ce87 Tidy up Implementation of Aggregate MSW Data Module
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.
2023-10-02 14:25:40 +02:00
Bård Skaflestad
fea67594b8 Tidy up AggregateMSW Test Code
In preparation of adding more test cases.
2023-10-02 14:25:40 +02:00
Kai Bao
f10399bb77
Merge pull request #3697 from bska/prevent-duplicate-inlet-segments
Prevent Duplicate Inlet Segments
2023-10-02 14:09:39 +02:00
Bård Skaflestad
006b65e054 Prevent Duplicate Inlet Segments
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'.
2023-10-02 13:20:56 +02:00
Svenn Tveit
4769fa7bd6 Fix errors when Scalar = float 2023-09-29 08:27:52 +02:00
Svenn Tveit
6d300b8d13 Ensure that default reference state is used.
Throw error if STCOND is not default or classes are instantiated with (T, P) other than reference values.
2023-09-29 08:27:51 +02:00
Svenn Tveit
34024bfabe Update unit tests with new reference state.
New reference state (T, P)=(288.71 K, 101325.0 Pa) =(15.56 C, 1 atm).
2023-09-29 08:25:24 +02:00
Svenn Tveit
e690d06b54 Update enthalpy to same reference state.
New reference state (T, P) = (288.71 K, 101325.0 Pa) = (15.56 C, 1 atm).
2023-09-29 08:25:24 +02:00
Atgeirr Flø Rasmussen
8ff141a592
Merge pull request #3692 from hnil/more_timing
More timing
2023-09-28 15:40:33 +02:00
Markus Blatt
f66b713d0c
Merge pull request #3693 from akva2/buildsystem_cleanups
Some buildsystem cleanup
2023-09-28 12:23:46 +02:00
Bård Skaflestad
da793e23fc
Merge pull request #3689 from bska/reg-cache-global-ix
Match Connection-to-Region in Terms of Global Cell Indices
2023-09-28 11:48:56 +02:00
hnil
b6a0821992 added timing on co2store evaluation and new timing macros 2023-09-28 10:42:20 +02:00
Bård Skaflestad
ae2f052b37 Match Connection-to-Region in Terms of Global Cell Indices
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.
2023-09-28 10:36:43 +02:00
Markus Blatt
e3fd90f965
Merge pull request #3680 from bska/support-truncated-region-names-revised
Match Region Sets by Unique Prefix
2023-09-28 10:16:08 +02:00
Bård Skaflestad
9342040dbe Match Region Sets by Unique Prefix
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.
2023-09-26 15:31:20 +02:00
Arne Morten Kvarving
9d8826c2e5 fixed typo in status message 2023-09-26 14:53:45 +02:00
Arne Morten Kvarving
4041f9cc69 remove prereqs file for opm-vertex
this module is defunct and has been defunct for
10 years by now.
2023-09-26 14:53:45 +02:00
Arne Morten Kvarving
ca864e4be9 changed: remove generation of .pc files
this has been broken for a long time, yielding files
containing cmake target names in the linker lines.
2023-09-26 14:53:45 +02:00
Bård Skaflestad
b8816b474b
Merge pull request #3690 from vkip/msw_no_conn
Allow multi-segment wells with no grid connections
2023-09-26 13:53:08 +02:00
Vegard Kippe
30a92cca1e Updated after review input 2023-09-26 13:30:43 +02:00
Vegard Kippe
776597e00b Allow multi-segment wells with no grid connections - warning is already issued. 2023-09-26 13:30:43 +02:00
Bård Skaflestad
53301b78d4
Merge pull request #3687 from bska/more-summary-vectors
Support More Summary Vectors
2023-09-25 12:44:32 +02:00
Bård Skaflestad
ad9ebd730d Support More Summary Vectors
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
2023-09-22 10:44:44 +02:00
Bård Skaflestad
44cd3eafe2
Merge pull request #3679 from bska/rsmry-udef-regset
Support Region Set Tags For All Region Level Summary Vectors
2023-09-22 10:39:51 +02:00
Bård Skaflestad
fb37bf5db5
Merge pull request #3682 from bska/region-avgpress-hcvol
Emit Region Level Average Pressure Weighted by HC Volume
2023-09-22 10:39:00 +02:00
Bård Skaflestad
e366a940bf
Merge pull request #3688 from bska/wpix-smry-vectors
Add Support for WPIx Summary Vectors
2023-09-22 10:38:24 +02:00
Vegard Kippe
1594680f35 Take default UDQ value from UDQPARAM 2023-09-21 21:13:47 +02:00
Bård Skaflestad
ecbfd4e9c4 Support Region Set Tags For All Region Level Summary Vectors
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.
2023-09-21 18:26:36 +02:00
Markus Blatt
4f52acdc0f
Merge pull request #3685 from bska/multregt-multiple-regsets
Accumulate Total Multiplier From All Region Sets
2023-09-21 17:37:26 +02:00
Vegard Kippe
cadbcda982 Fixed 1-based indexing in segment summary vector lookup 2023-09-21 13:22:52 +02:00
Vegard Kippe
33a27e4e88 Facilitate UDA for WSEGVALV item 4 2023-09-21 13:20:52 +02:00
Bård Skaflestad
ca7fbea637 Accumulate Total Multiplier From All Region Sets
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.
2023-09-21 13:04:09 +02:00
Bård Skaflestad
7dd3c344cd Emit Region Level Average Pressure Weighted by HC Volume
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.
2023-09-21 11:53:13 +02:00
Bård Skaflestad
d225901733 Add Support for WPIx Summary Vectors
We calculate these, for now, as

   WPIx = WOPR / (WBPx - WBHP)

but it is possible that we may have to revise this definition,
especially for injectors.
2023-09-21 11:52:47 +02:00
Tor Harald Sandve
8ea35f2d0d
Merge pull request #3683 from svenn-t/h2store_updates
H2STORE updates
2023-09-21 09:19:57 +02:00
Bård Skaflestad
e5bd4129a1
Merge pull request #3686 from vkip/aquifer_celldepths_bugfix
Fixing segfault due to use of uninitialized grid properties
2023-09-19 14:46:01 +02:00