Commit Graph

14756 Commits

Author SHA1 Message Date
Bård Skaflestad
cc4928dfc7 Extract Facility to Form CSR Representations of Graphs
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.
2023-10-18 13:50:31 +02:00
Bård Skaflestad
2d33b520f1
Merge pull request #3684 from vkip/wsegvalv_uda_item4
Facilitate UDA for WSEGVALV item 4
2023-10-17 15:14:22 +02:00
Bård Skaflestad
0567d9b09b
Merge pull request #3713 from blattms/prevent-segfault-for-actiony-without-condition
[fix] AggregateActionX: Do not assume an ACTIONX condition exists
2023-10-16 17:26:39 +02:00
Markus Blatt
a53d8559a6 [fix] AggregateActionX: Do not assume an ACTIONX condition exists
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.
2023-10-16 15:39:58 +02:00
Kai Bao
9da481e609
Merge pull request #3714 from GitPaean/adding_headerfile_cmake_files
adding ThreeComponentFluidSystem.hh to CMakeLists_files
2023-10-16 12:15:18 +02:00
Kai Bao
1d8d503b69 adding ThreeComponentFluidSystem.hh to CMakeLists_files
to let other modules be able to access it.
2023-10-16 10:39:01 +02:00
Vegard Kippe
078a987124 Post review update 2023-10-16 10:04:20 +02:00
Bård Skaflestad
8f5ec261ec
Merge pull request #3704 from GitPaean/ptflash_simpletest
various correction to prepare for the PTFlash simulation
2023-10-13 17:56:03 +02:00
Bård Skaflestad
49be8698cc
Merge pull request #3705 from daavid00/sgwfnTable
Support for SGWFN sat functions (format type 2)
2023-10-13 10:30:41 +02:00
Markus Blatt
d1cb233b04
Merge pull request #3709 from blattms/bump-version
Bump version to 2024.04
2023-10-13 09:19:18 +02:00
Kai Bao
f807281c15 cleaning up and small corrections related to PTFlash 2023-10-12 15:25:32 +02:00
Kai Bao
c3e061cab1 default max iteration number of SSI to be 100
10 was too small.
2023-10-12 14:04:11 +02:00
Trine Mykkeltvedt
cdae1534de various corrections related to component proerties
and viscosity model.
2023-10-12 14:04:11 +02:00
Markus Blatt
4d7b0bb773
Merge pull request #3708 from bska/dont-reference-non-existent-wgnames
Don't Reference Non-Existent W/G Names From UDQ Set
2023-10-12 12:26:06 +02:00
Bård Skaflestad
39b9689339 Don't Reference Non-Existent W/G Names From UDQ Set
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'.
2023-10-12 11:33:00 +02:00
Markus Blatt
b3f4816f07
Merge pull request #3699 from akva2/wlist_in_actionx
Add support for WLIST in ACTIONX
2023-10-12 11:15:23 +02:00
David Landa Marban
5f22fb9bd0 Support for SGWFN sat functions (format type 2) 2023-10-11 23:38:42 +02:00
Markus Blatt
8ec7378dd4 Make CMake fail on non-64bit systems.
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.
2023-10-11 21:53:54 +02:00
Markus Blatt
c80ddf4b6f Bump version to 2024.04 2023-10-11 21:20:51 +02:00
Markus Blatt
a4f9fb1dd8
Merge pull request #3706 from blattms/fix-missing-functional-gcc12
Include missing functional header to fix compilation with g++-12
2023-10-11 12:40:09 +02:00
Markus Blatt
f3bd34df71 Sort header includes as requested.
Sorting criteria is not 100% clear to me though. I hope this does not
break anything...
2023-10-11 11:41:40 +02:00
Markus Blatt
a309dbb4d0 Include missing functional header for g++-12
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;
      |              ^~~~~~~~
```
2023-10-10 21:12:15 +02:00
Markus Blatt
9e3fa794ce
Merge pull request #3587 from bska/trigger-assign-from-actionx
Track Pending Assignments in UDQ Configuration Object
2023-10-10 12:41:33 +02:00
Bård Skaflestad
09ffacb5bf Track Pending Assignments in UDQ Configuration Object
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.
2023-10-09 15:32:48 +02:00
Arne Morten Kvarving
54bdca66e1 added: enable WLIST in ACTIONX 2023-10-09 08:50:46 +02:00
Arne Morten Kvarving
a18b799468 changed: pass matching_wells in handleWLIST 2023-10-09 08:50:46 +02:00
Arne Morten Kvarving
396bc10db4 changed: Schedule::handleWELOPEN
allow operation on empty well lists. in particular
this will be necessary supporting WLIST modifications
by ACTIONX
2023-10-09 08:50:46 +02:00
Arne Morten Kvarving
a7a84f6f2f added: allowEmpty parameter to Schedule::wellNames
allows bypassing exception if there are no matches.
2023-10-09 08:50:46 +02:00
Arne Morten Kvarving
3f40960469 added: utility function Schedule::isWList
checks if the given pattern is the name of a WList
2023-10-09 08:50:46 +02:00
Tor Harald Sandve
8ed1b4c21e
Merge pull request #3656 from svenn-t/co2store_enthalpy_reference
CO2STORE new reference state for enthalpy
2023-10-06 17:52:25 +02:00
Markus Blatt
4c511b788c
Merge pull request #3375 from bska/eval-seg-udq
Compute Segment Level UDQ Values
2023-10-06 15:35:23 +02:00
Bård Skaflestad
2be2063906
Merge pull request #3700 from blattms/prominent-toplevel-topology-errors
Make top level section errors more prominent / Allow global keywords before RUNSPEC
2023-10-06 11:18:07 +02:00
Markus Blatt
4daaf493cb Fix documentation of isGlobalKeyword. 2023-10-06 10:55:03 +02:00
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