Commit Graph

3056 Commits

Author SHA1 Message Date
Bård Skaflestad
2d3fe6061e Revise Branch Discovery Order for MSW Output
This commit places more conditions on the branch discovery order
than the previous work in commit 6d3ee57dd.  In particular, we now
ensure that branches are discovered ("created") in the order of
increasing segment number of the branch outlet segment.
Furthermore, if multiple branches have the same outlet segment, then
we sort those branches on their increasing branch IDs.

To this end, switch from using a std::queue<int> to using a
std::priority_queue<KickOffPoint>, with the KickOffPoint being a
custom structure holding the kick-off segment, the branch outlet
segment, and the branch ID and a custom operator<() to plug into the
priority_queue<> heap mechanism.

This new sort order changes the result of certain unit tests, but
those changes are expected and desired.
2023-11-24 16:01:46 +01:00
Bård Skaflestad
be048ca063
Merge pull request #3781 from totto82/wdfac_fix
Add return of wdfac type
2023-11-22 14:53:14 +01:00
Tor Harald Sandve
08b41f09d8 Remove trans multiplier from the dake model 2023-11-22 13:59:25 +01:00
Tor Harald Sandve
9c680a0dcf Output C[OG]FRF and C[OG]FRS 2023-11-22 10:17:44 +01:00
Tor Harald Sandve
e362e1018d refactoring wdfac getDfactor 2023-11-22 09:17:59 +01:00
Tor Harald Sandve
98220372eb Add return of wdfac type 2023-11-21 17:49:08 +01:00
Bård Skaflestad
7502808265
Merge pull request #3778 from akva2/fix_boost_version_check
fixed: adjust boost version check
2023-11-17 14:16:52 +01:00
Arne Morten Kvarving
fc5a2fbea6 fixed: adjust boost version check
1.66 already has the boost::fpc scope
2023-11-17 13:01:57 +01:00
Bård Skaflestad
8a4735efcb Make Self Connection Behaviour Configurable
This commit adds a new class template argument,

    bool PermitSelfConnections

with a default value of 'false', that enables client code to
configure whether or not function

    addConnection(v1, v2)

creates a connection from v1 to v2 if v1 == v2.  The default state
preserves the current behaviour which ignores such connections.

Permitting self connections makes the class slightly more general to
uses cases outside inter-region flow accumulation.
2023-11-16 15:10:59 +01:00
Vegard Kippe
1d8c5640a2 Resolve test failures 2023-11-14 18:05:40 +01:00
Vegard Kippe
aaf61d429d Updating NetworkTests from root() to roots() 2023-11-13 12:24:01 +01:00
Arne Morten Kvarving
fa670d7042 fixed: earlier boosts did not support command line parameter separation
for older versions we will thus see '--' as argv[1] and the actual
parameter as argv[2].
2023-11-10 10:23:30 +01:00
Arne Morten Kvarving
2fec8a3c16 fixed: adjust compare_at_tolerance namespace for earlier boost 2023-11-10 10:23:30 +01:00
Arne Morten Kvarving
f8781f276e fixed: adjust include path of float_point_comparison for earlier boost 2023-11-10 10:23:30 +01:00
Arne Morten Kvarving
e2c20a6712 fixed: BOOST_DATA_TEST_CASE was added in boost 1.67
use a loop for earlier versions
2023-11-10 10:23:30 +01:00
Arne Morten Kvarving
f1fc44563a fixed: earlier boosts only accepts boost::mpl::list for BOOST_AUTO_TEST_TEMPLATE 2023-11-10 10:23:30 +01:00
Bård Skaflestad
7ba929f1d0
Merge pull request #3753 from akva2/fipconfig
added: FIPConfig class
2023-11-09 12:10:40 +01:00
Arne Morten Kvarving
47122446e6 use strong enum for FIP output fields 2023-11-09 10:44:23 +01:00
Arne Morten Kvarving
3f08071eae added: FIPConfig class
this parses FIP related flags from RPT(SCHED|SOL)
2023-11-09 10:35:21 +01:00
Kai Bao
16c6ee3bbb
Merge pull request #3695 from vkip/grupnet_reroute_hack
Allow rerouting in standard and extended network
2023-11-08 19:58:07 +01:00
Vegard Kippe
96b0b09b14 Addressing final comments and test failures. 2023-11-08 11:58:01 +01:00
Arne Morten Kvarving
3875736795 implement support for FBHPDEF 2023-11-07 10:32:38 +01:00
Tor Harald Sandve
80dd2c33a1 Implement support for keyword WDFAC and WDFACCOR
Implement support for DFactor in COMPDAT

Add output of CDFAC
2023-10-31 14:10:45 +01:00
Arne Morten Kvarving
db0f99de77 UDQ: add UDT support 2023-10-30 11:18:58 +01:00
Bård Skaflestad
96b3799eee
Merge pull request #3712 from blattms/actionx-condition-errors
Better error handling for problems in conditions of ACTIONX.
2023-10-25 16:22:34 +02:00
Markus Blatt
48bbc2dc2b Introduces method parseActionX returning the action and error strings.
This way there is no constructor with an output parameter and we
prevent introducing an additional member in ActionX that is only used
in one constructor.
2023-10-25 14:04:10 +02:00
Markus Blatt
f3668e0a37 Better error handling for problems in conditions of ACTIONX.
When encountering these (e.g. a number instead of an expression on
the left hand side) the simulator would immediately abort with an
error message like:
```
Error: An error occurred while creating the reservoir schedule
Internal error: Extra unhandled data starting with token[0] = 135

Error: Unrecoverable errors while loading input: Extra unhandled data starting with token[0] = 135
```
(The message above is for the number 135 on the left hand side)

With this change we now use the usual way of handling errors and
warnings in the parser and continue parsing.

The error message for the problem above is now
```
Error: condition of action EX1 has the following error: Left side of comparsion (135) has to be an expression!

Error: Problem with keyword ACTIONX
In model.schedule line 562
condition of action EX1 has the following error: Left side of comparsion (135) has to be an expression!

Error: Unrecoverable errors while loading input: Problem with keyword ACTIONX
In model.schedule line 562
condition of action EX1 has the following error: Left side of comparsion (135) has to be an expression!
2023-10-25 14:04:10 +02:00
Arne Morten Kvarving
2a2c59ca26 added: parsing of UDT keyword 2023-10-25 10:02:44 +02:00
Markus Blatt
a606753230
Merge pull request #3703 from bska/welspecs-extension
Support Changing Selected Well Properties Through WELSPECS
2023-10-25 09:51:51 +02:00
Bård Skaflestad
416dadd33f Support Changing Selected Well Properties Through WELSPECS
This commit enables updating individual well properties for one or
more wells using the WELSPECS keyword.  In particular, this revised
logic enables changing the controlling group without affecting any
other well property such as the location of the well head or the
well reference depth.

Defaulted properties do not affect change in Well::update*().  This,
in turn, begets a change to the logic of how we update the reference
depths.  Previously, we always interpreted a defaulted reference
depth item as

    Compute the reference depth from the location of the well's
    reservoir connections

We now alter this interpretation slightly to mean

    Don't recompute the reference depth if the input has already
    assigned a numerical value for this property

If the input has never assigned an explicit numerical value for the
reference depth, then we continue using the original interpretation
of a defaulted reference depth item--e.g., to update the reference
depth as a result of new reservoir connections.

The simulation can request the original interpretation even after
having assigned a numeric reference depth, by entering a new
WELSPECS keyword specifying a negative value for the the reference
depth item.

To this end, introduce a new data member in the Well class,

    bool Well::derive_refdepth_from_conns_

which tracks whether or not the reference depth has been assigned an
explicit numeric value.

As an example, this new WELSPECS behaviour enables using something
like

    ACTIONX
      A  1 /
      WOPR 'P*' < 123.4 /
    /
    WELSPECS
      '?' 'LOWPRESS' /
    /
    ENDACTIO

as a way to move all wells matching the pattern 'P*', and with a low
oil production rate, to the group 'LOWPRESS'.  This could, in turn,
apply a different set of group-level production controls to those
wells.
2023-10-25 09:19:00 +02:00
Arne Morten Kvarving
80b8a7e90a added: put UDTs in UDQContext 2023-10-23 20:29:40 +02:00
Arne Morten Kvarving
d1b6c8de12 add class for representing UDTs
this is limited to 1D UDTs for now
2023-10-23 20:29:40 +02:00
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
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
Kai Bao
f807281c15 cleaning up and small corrections related to PTFlash 2023-10-12 15:25:32 +02:00
Trine Mykkeltvedt
cdae1534de various corrections related to component proerties
and viscosity model.
2023-10-12 14:04:11 +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
David Landa Marban
5f22fb9bd0 Support for SGWFN sat functions (format type 2) 2023-10-11 23:38:42 +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
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
3a63c1723b Allow global keywords before RUNSPEC in input file. 2023-10-05 22:33:08 +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
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
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
fea67594b8 Tidy up AggregateMSW Test Code
In preparation of adding more test cases.
2023-10-02 14:25:40 +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