Commit Graph

167 Commits

Author SHA1 Message Date
Arne Morten Kvarving
db0f99de77 UDQ: add UDT support 2023-10-30 11:18:58 +01:00
Arne Morten Kvarving
80b8a7e90a added: put UDTs in UDQContext 2023-10-23 20:29:40 +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
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
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
c33b94ca3a Default UDQ Assignments to All Wells in Model
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.
2023-06-14 09:46:10 +02:00
Arne Morten Kvarving
651693e623 avoid unused expression warning 2023-05-09 10:35:40 +02:00
Bård Skaflestad
2109552335 Recognise Numbers as Part of UDQ Set Selector
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.
2023-02-07 09:47:46 +01:00
Bård Skaflestad
b1f3b3b4cf Adjust Whitespace in UDQ Tests Implementation File
In preparation of adding tests for segment level UDQs.
2023-02-03 17:59:10 +01:00
Bård Skaflestad
2b2330ab24 Prepare for Handling UDQ ASSIGN for Segments
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.
2023-02-02 12:43:16 +01:00
Arne Morten Kvarving
ddef6302e6 ParseContext: forward InputErrorAction 2023-01-16 22:17:50 +01:00
Arne Morten Kvarving
edf937e2e5 InputErrorAction: convert to enum class 2023-01-16 22:17:50 +01:00
Arne Morten Kvarving
ba2ec8957f UDQContext.hpp: forward WellMatcher
make member a const reference to enable this
2023-01-10 12:25:35 +01:00
Arne Morten Kvarving
7b903660a0 UDQState: remove unused serialization code 2022-09-07 10:08:54 +02:00
Arne Morten Kvarving
ef6d448077 changed: remove include of EclipseState.hpp in header
and deal with the consequences
2022-07-26 16:03:52 +02:00
Bård Skaflestad
f4fde15e67 Support Recognizing UDAs in WELTARG Keyword
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.
2022-05-09 11:33:07 +02:00
Bård Skaflestad
f467ed7251 Identify More UDA Integer Values
In particular, identify UDA control codes for RESV, BHP, and THP in
WCONPROD as well as BHP and THP in WCONINJE.
2022-05-09 11:33:07 +02:00
Bård Skaflestad
d9ca1fe86f Increase Integer Literal Readability
Use C++14's digit separator character (single quote).
2022-05-09 11:33:07 +02:00
Bård Skaflestad
d08b7292bf Use Uppercase Exponents in UDQDefine::input_string
Needed for compatibility reasons.
2022-03-24 16:10:21 +01:00
Bård Skaflestad
a0d9a04470 UDQ Tests: Make Utility Functions Private
Mostly to avoid diagnostics of the form "no previous declaration
for...".  While here, also sort includes
2022-03-24 16:10:21 +01:00
Joakim Hove
0a59bd8f61 Filesystem rename EclipseState/Schedule/ Schedule/ 2022-01-02 14:32:14 +01:00
Joakim Hove
aede532b9a Filesystem rename parser/eclipse/ input/eclipse 2022-01-02 14:32:14 +01:00
Daniel
b0f757eb50 Replace Deck::getKeyword(std::string) with operator[std::string] 2021-11-23 14:00:38 +01:00
Joakim Hove
14453560da Add UDAValue::operator*= 2021-10-19 11:12:06 +02:00
Joakim Hove
7002faba3b
Merge pull request #2662 from joakim-hove/remove-uda-autocreate
Remove uda autocreate
2021-09-12 08:45:44 +02:00
Joakim Hove
9bad260538 Special case treatment of trailing slash for UDQ keywords 2021-09-11 08:29:42 +02:00
Joakim Hove
026cbade9c UDQ - a keyword is not recognized only from UNITS verb 2021-09-09 08:30:00 +02:00
Joakim Hove
babff0e0ba Stopped auto creation of UDQ ASSIGN from UDQ UNITS 2021-09-09 08:30:00 +02:00
Joakim Hove
aff9cb74d1 Add UDQConfig::operator[](std::size_t insert_index) 2021-08-20 14:29:45 +02:00
Joakim Hove
5e60927477 Rename uad -> uda 2021-08-20 14:29:16 +02:00
Joakim Hove
1ce143e479 Rename UDQActive::get_iuad() -> iuad() 2021-08-20 14:29:16 +02:00
Joakim Hove
a0ad7883c7 Remove unused size query functions 2021-08-20 14:29:14 +02:00
Joakim Hove
9862d88b12 Remove unused UDQActive::operator[] 2021-08-19 17:01:31 +02:00
Joakim Hove
7939adf3e3 Normalise input data in UDQ definitions
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.
2021-07-25 16:36:18 +02:00
Joakim Hove
6af909778c Load UDQConfig and UDQState from restart data 2021-07-01 07:31:48 +02:00
Joakim Hove
3fa67b21b3 Alternative selector implementation for UDQAssign loaded from rst 2021-06-25 15:25:48 +02:00
Bård Skaflestad
665a82b9cd Identify GCONINJE UDA Items
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().
2021-06-09 20:41:03 +02:00
Bård Skaflestad
32fa3df6b6 Don't Increment Loop Counter Twice 2021-05-25 17:31:44 +02:00
Joakim Hove
7b896359f6 Part 2: Use Opm::time_point 2021-03-03 15:13:34 +01:00
Joakim Hove
bcffaefa7a Use ScheduleState for wells++
Use SchedueleState for wells, in addition to the members UDQConfig, GasLiftOpt
and GuideRateConfig.
2021-02-10 07:22:46 +01:00
Joakim Hove
08cb85e08e Add temporary disabled Schedule::unique<UDQConfig>() test 2021-02-04 11:11:40 +01:00
Joakim Hove
acb1284efd Use small wrapper to manage shared pointers in ScheduleState 2021-01-29 11:42:36 +01:00
Joakim Hove
a4ca61dc4e Renamed WellOrder -> NameOrder 2021-01-28 19:49:05 +01:00
Joakim Hove
56c7e89bbd Use WellOrder to construct WellMatcher 2021-01-25 10:20:57 +01:00
Joakim Hove
344972624a Use ScheduleState to manage UDQActive 2021-01-15 09:19:33 +01:00
Joakim Hove
fa3b740d1d UDQ Cast can cast to both lhs type and rhs type 2020-11-24 11:48:17 +01:00
Joakim Hove
b2da0228b1 Support UDQ UPDATE action 2020-11-15 10:03:34 +01:00
Joakim Hove
e0e5ed1f91 Make sure UDQ can use also special summary values like TIME 2020-11-15 10:02:34 +01:00
Joakim Hove
47543641ee Testing of negative prefix 2020-11-05 15:38:23 +01:00