Commit Graph

167 Commits

Author SHA1 Message Date
Joakim Hove
6c449a48b1
Merge pull request #2069 from joakim-hove/udq-wlist
Udq wlist
2020-11-03 11:22:02 +01:00
Joakim Hove
14df089f14 Use WellMatcher() in Schedule::wellNames() 2020-10-31 09:04:32 +01:00
Joakim Hove
7ef7e3017e Add class WellMatcher and use it UDQ evaluation 2020-10-30 22:17:59 +01:00
Joakim Hove
9bec2673ad Explicitly delete UDAValue::operator=() 2020-10-30 17:19:02 +01:00
Joakim Hove
d301274e89 Improve warning for UDQ missing unit 2020-10-27 18:50:47 +01:00
Joakim Hove
e9dadcf93e Extract leading sign when extract UDQ factor 2020-10-27 14:17:12 +01:00
Joakim Hove
b53acbc6a7 Add functionality to extract required summary keys from UDQConfig 2020-10-23 16:05:55 +02:00
Joakim Hove
80a023794e Ensure that division is left assosiative in UDQ parser 2020-10-22 14:40:32 +02:00
Joakim Hove
ee7f50a51d
Merge pull request #2037 from joakim-hove/udq-define-order
Make sure UDQ define statements are evaluated in definition order
2020-10-21 17:32:55 +02:00
Joakim Hove
413a16157c Make sure UDQ define statements are evaluated in definition order 2020-10-21 13:49:07 +02:00
Joakim Hove
2289ba165b Update SummaryState in UDQContext 2020-10-20 22:22:21 +02:00
Joakim Hove
5ff65747f3 Rename summary variable in test 2020-10-20 20:02:19 +02:00
Joakim Hove
451eefbda5 UDQContext - differentiate between missing well and invalid variable 2020-10-16 11:24:21 +02:00
Williham Williham Totland
c43600337b Throws exception with nesting, and generalises tests to account for same. 2020-10-05 11:06:19 +02:00
Joakim Hove
0ab50fbc95
Merge pull request #1977 from wito/test-warning-noise-fix
Test Compilation Warning Noise Fix
2020-10-02 07:56:14 +02:00
Joakim Hove
0512ab88b4 ParseContext will throw OpmInputError 2020-09-29 15:37:14 +02:00
Williham Williham Totland
6d2f8cca5c Adds type information to integer literals. 2020-09-29 13:54:21 +02:00
Joakim Hove
e01400fa18 Add KeywordLocation argument to ParseContext::handleError() 2020-09-29 09:56:07 +02:00
Joakim Hove
5a060910a3 Differentiate better between UDQ ASSIGN and UDQ DEFINE
A quite typical situation is that a UDQ keyword is first initialized with UDQ
ASSIGN statement, and then subsequently a formula for updates every timestep is
entered with UDQ DEFINE:

  UDQ
     ASSIGN FU_VAR1 0 /
     DEFINE FU_VAR1 FU_VAR1 + 1 /
  /

Then the assign statement should be run once, and the define formula should be
evaluated for every subsequent timestep.
2020-09-09 21:39:29 +02:00
Joakim Hove
fc1e245ea4 Add TIMESTEP as context variable in summary eval 2020-09-09 19:42:42 +02:00
Joakim Hove
4a9ec1403e UDQ: get from an unknown summary variable throws std::out_of_range 2020-09-08 08:23:45 +02:00
Joakim Hove
8d11a04033 Add report_step argument to UDQConfig::eval() 2020-09-08 08:23:45 +02:00
Joakim Hove
11e70ca779 Handle undefined UDQ expressions 2020-09-02 23:03:03 +02:00
Arne Morten Kvarving
acad356e2d remove unused variable 2020-09-01 15:25:44 +02:00
Joakim Hove
4b3304730c Serializer class: SummaryState & UDQState 2020-09-01 13:15:42 +02:00
Joakim Hove
0161f50255 Add UDQState 2020-08-27 17:25:51 +02:00
Joakim Hove
168aa5602d Make sure DEFINE statements are evaluated in input order 2020-08-27 15:24:32 +02:00
Joakim Hove
718e00ca1f Correctly parse and handle UADD / UMUL / UMIN / UMAX set operations 2020-08-27 15:24:32 +02:00
Joakim Hove
6c2563c5a5 Fix tokenizer bug with mix of '*' and *
The token '*' should be interpreted as all wells/groups for a variable like WOPR
or GGPR, whereas the naked * is a multiplication sign. This commit fixes a bug
where the all wells/groups token '*' would be incorrectly interpreted as a
multiplication sign.
2020-08-23 08:31:15 +02:00
Joakim Hove
9fd29db2de Add case with literal in scientific form 2020-06-30 13:04:49 +02:00
Joakim Hove
f09b534e1d Hack around UDQ parser which does not accept leading '-' 2020-06-30 13:01:00 +02:00
Joakim Hove
fc4511d365 Fix UDQParsing code to handle numerical values on scientific form 2020-06-30 12:51:59 +02:00
Joakim Hove
082820380d Ensure that all values in UDQSet are finite 2020-06-12 09:12:55 +02:00
Joakim Hove
213c6fb6ad Add function SummaryState::update_udq() to add variables from UDQSet 2020-06-12 09:12:55 +02:00
Joakim Hove
90d1d992e5 Ensure that evaluated UDQSet have the correct name 2020-06-12 09:12:55 +02:00
Joakim Hove
fd5a42801f Make sure the UDQ usage in GCONPROD is recorded 2020-05-15 08:27:52 +02:00
Joakim Hove
3077f7aff8 Introduce class RawString
The RawString class is introduced as a string which can hold the literals '*',
'/' and '''. The RawString class is used to hold the content of UDQ and ACTIONX
keywords.
2020-04-21 06:51:25 +02:00
Joakim Hove
750e7b8b24 Default construct UDQ keywords with value 0 when defined with UNIT 2020-04-12 08:38:59 +02:00
Joakim Hove
5444eade2f Use std::shared_ptr<Python> for Python argument in Schedule 2020-03-31 10:26:55 +02:00
Joakim Hove
50fb51d56e Add Python arg to Schedule constructor 2020-03-27 12:43:18 +01:00
Joakim Hove
874c734628 Remove name property from UnitSystem dimension 2020-03-05 13:08:00 +01:00
Joakim Hove
f8c250be34 UDAValue: change from ::reset() to ::operator=() 2020-03-05 13:08:00 +01:00
Joakim Hove
37d31aeac0 Remove UDAValue copy and modify constructor 2020-03-05 13:08:00 +01:00
Joakim Hove
aed8c78af5 Move RestartConfig from EclipseState to Schedule 2020-02-19 12:35:07 +01:00
Joakim Hove
59f6cc7c11 Remove moot test 2020-02-19 12:33:50 +01:00
Atgeirr Flø Rasmussen
74129a2866 Silence a few warnings, remove some end-of-line whitespace. 2020-02-13 09:13:29 +01:00
Bård Skaflestad
19ecc3d30e Consider Active Phases When Initializing Satfunc Endpoints
This commit passes the run's notion of its active phases, an object
of type Opm::Phases, through to the initialisation layer for the
saturation functions' scaling properties.  In particular, this
allows us to discriminate between the phases and to not index into
tables or properties that would not be appropriate (e.g., maximum
gas saturation (SGU) in a simulation run without active gas).

Moreover, we now have enough information to know to look for SOF2 in
two-phase run using family II saturation function keywords.  These
changes are necessary in order to extend Flow's support for the
FILLEPS output request to two-phase runs.
2020-01-29 16:34:15 +01:00
Joakim Hove
ecb5fce19b
Only active cells (#1298)
Use FieldProps implementation for 3D properties
2020-01-13 15:46:06 +01:00
Joakim Hove
8f6c2c70f6 UDAalue::get<double>() will return raw value - not SI.
Add new function UDAValue::getSI() which will return SI value of numerical
input, and throw an exception if internal state is not numeric.
2020-01-06 12:05:51 +01:00
Joakim Hove
c42be3d345 Fixed bug in SORTA and SORTD functions 2020-01-02 20:18:19 +01:00
Joakim Hove
89ab99e6b9 UDQ: fix bug with parsing of expressions like A - B - C - D
- In the case of several tokens separated with +/- the final tree is assembled
   from left, was previously from the right. This fixes evaluation bug with
   expressions like A - B - C which were eventually evaluated as A - (B - C).

 - Improved handling of different types; both transiton from scalar to sets of
   wells and groups, and also groups in general. In particular you can now
   assign to a group variable:

        DEFINE GUXXX  WOPR * 0.25

 - Actually hook up the evaluation of group variables from the Summary code.
2019-12-17 16:59:06 +01:00
Joakim Hove
af1b140723 Some improvements to runtime type conversion when evaluating UDQ 2019-12-13 23:17:07 +01:00
Joakim Hove
b4fd949ca8 Change exception + test 2019-12-13 15:39:34 +01:00
Joakim Hove
198b208258 Test use of FieldPropsManager in WellConnections 2019-11-29 16:42:29 +01:00
Joakim Hove
e9b6ac54d9 Add PORO keyword to testdata 2019-11-28 20:06:39 +01:00
Joakim Hove
b2d9e92e25 Update test fixture to use correct grid 2019-11-26 21:34:04 +01:00
Bård Skaflestad
2558320aa3 UDQ Unit Test: Don't Create Dangling References
This fixes an issue identified by Address Sanitizer.
2019-10-26 18:18:38 -05:00
Joakim Hove
7e2d45cf66 Export all UDQTokens in use from UDQDefine 2019-10-24 16:51:15 +02:00
Joakim Hove
697545cf54 Use dimensions from ParserKeyword 2019-10-16 21:03:02 +02:00
Jostein Alvestad
202651c34d corrections after complex rebase to write DUDW data to ECL-compatible restart file 2019-10-07 09:54:36 +02:00
Joakim Hove
16a8f4040c Renamed UDQInput -> UDQCOnfig
UDQConfig object has merged DEFINE & ASSIGN

Log use of UDA for output purposes

Output UDQ keywords to restart file

Add size() method to UDQConfig

Add UDQVarTYpe member to UDQInput class

Add UDQIndex type to keep track of sequence number of variable types

Add unit to UDQInput class

use maps

Add operator[] to UDQConfig class

Use UDQInput class when creating restart file

UDQInput: use correct input index

Add UDQActive::get() method

Make sure UDQ DEFINE overwrite correctly

WIP

WIP - further code to output IGPH vector

WIP

Fix IUAD input index

Output use_index for IUAD

Fix bug with size of IUAD array

UAD usage hashing based on udqstring and controltype

Add UDQ test and input file

Refactor UDQActive - handles vanishing UDA

minor correction for iuad[1] and for test_UDQ_x.cpp

Further work for making unit tests for UDQ restart data

WIP Further work unit tests

WIP some minor corrections

WIP changes to add first version of BOOST test for IUDQ

WIP Added code to write InteHead and DoubHead data as well as IGPH to restart file,

Further added unit tests to the writing of UDQ data

add code to output IUAP array

Fixed group-group2 transition, disable Restart output

WIP Initial changes to add DUDW array to restart output

WIP further work on DUDW data

WIP - further work to output and test DUDW vector data to restart file

Further changes to write DUDW array to Restartfile
2019-10-07 09:54:34 +02:00
Joakim Hove
ff69737b99 Add start_time argument to SummaryState 2019-09-19 22:09:15 +02:00
Arne Morten Kvarving
6bbf1fcde2 remove unused UDQParams member in UDQContext 2019-09-18 13:21:00 +02:00
Joakim Hove
c8cd730d5c Refactor UDQActive - handles vanishing UDA 2019-08-12 13:04:47 +02:00
Joakim Hove
44ddd382a3 UAD usage hashing based on udqstring and controltype 2019-08-12 13:04:42 +02:00
Joakim Hove
79da1ba5eb Fix bug with size of IUAD array 2019-08-12 13:04:41 +02:00
Joakim Hove
29c3310671 Fix IUAD input index 2019-08-12 13:04:37 +02:00
Joakim Hove
858e0b84cf Make sure UDQ DEFINE overwrite correctly 2019-08-12 13:04:31 +02:00
Joakim Hove
39346c3b97 Add UDQActive::get() method 2019-08-12 13:04:30 +02:00
Joakim Hove
1a79e811dd Add operator[] to UDQConfig class 2019-08-12 13:04:24 +02:00
Joakim Hove
5e751bb26c Add unit to UDQInput class 2019-08-12 13:04:21 +02:00
Joakim Hove
9e309375b6 Add size() method to UDQConfig 2019-08-12 13:04:17 +02:00
Joakim Hove
1a62ceff7d Log use of UDA for output purposes 2019-08-12 13:04:10 +02:00
Joakim Hove
4d1b747b42 UDQConfig object has merged DEFINE & ASSIGN 2019-08-12 13:04:08 +02:00
Joakim Hove
28c2e7024c Renamed UDQInput -> UDQCOnfig 2019-08-12 13:04:07 +02:00
Joakim Hove
11fe1d6e03 Maintain insert order in UDQINput 2019-07-22 16:07:36 +02:00
Joakim Hove
2fb64e21d9 Add method UDQDefine::input_string() 2019-07-22 16:07:36 +02:00
Joakim Hove
370ce5de1f Removed public tokens() property for UDQDefine 2019-07-22 16:07:36 +02:00
Kai Bao
ca7fe55934 silencing shadowing warnings 2019-06-25 13:16:41 +02:00
Joakim Hove
6bbfd66744 Minor testing of UDQValue 2019-06-23 09:10:39 +02:00
Joakim Hove
3f2eefc638 UDQContext:
- add member const UDQParams&
- add functions has_well_var() and has_group_var()
2019-06-20 11:20:47 +02:00
Joakim Hove
c09bc36c03 UDQSet::eval - make sure to return well node 2019-06-16 08:42:54 +02:00
Joakim Hove
772bd3cee5 UDQ: Ensure that scalar right hand side is accepted into sets 2019-06-14 11:54:12 +02:00
Joakim Hove
edbc9d2af7 UDAValue: add reset() methods 2019-06-12 10:13:01 +02:00
Joakim Hove
44e21101bc UDAValue: the get<double>() method will return SI values 2019-06-12 10:13:01 +02:00
Joakim Hove
54af290cc0 Extend UDQ eval code
With this commit the code to evaluate UDQ values has been extended/refactored in
many ways:

 - There is an increased awarenwss of variable type, i.e. a well related UDQ
   versus a field related UDQ. The variable type flows through the AST, and it
   is verified that the expression to evaluate and the target variable are of
   compatible types.

 - Have added support for UDQ field variables and UDQ group variables.

 - The UDQSet type and the UDQDefine::eval() have been refactored to multiplex
   on all the UDQ types, and the specialized UDQWellSet has been removed.
2019-05-27 16:43:22 +02:00
Joakim Hove
4439882402 UDQ error test - use correct well variablec 2019-05-27 09:44:14 +02:00
Joakim Hove
9e288a9d78 Refactor SummaryState
- Change SummaryState::add() -> SummaryState::update(), the
   SummaryState::update() method is semantically aware of totals.

 - Add an internal variable to the SummaryState class to keep track of the
   elapsed simulation time.
2019-05-13 11:06:32 +02:00
Joakim Hove
b148769cc6 Internalize UDA values in the deck 2019-04-28 16:08:02 +02:00
Joakim Hove
656878d649 Add class UDAValue to hold UDA values from the Deck 2019-04-28 16:08:02 +02:00
Joakim Hove
bd0c0f6356 Internalize UDQ tokens in the UDQ define keyword 2019-04-08 15:12:15 +02:00
Joakim Hove
c9821faddc Changed UDQDefine to take UDQParams argument 2019-03-14 12:40:57 +01:00
Joakim Hove
066dca43ba UDQ Parsing - rest 2019-03-14 12:40:57 +01:00
Joakim Hove
16c9d7d04d UDQFunctionTable: const arg + default constructor 2019-03-14 09:28:26 +01:00
Joakim Hove
118f4dd3de Update eval_udq() in Summary 2019-03-14 09:28:26 +01:00
Joakim Hove
25d7e99413 Add UDQInput methods has_keyword() and has_unit() 2019-03-09 10:19:03 +01:00
Joakim Hove
ccba767b24 Add utility constructors and testing to UDQWellSet 2019-03-07 11:35:55 +01:00
Joakim Hove
585447fd22 Move UDQ action enum to UDQEnums 2019-03-07 11:35:55 +01:00
Joakim Hove
03a2bbdf80 Add UDQ / parsing test with '/' in data item 2019-03-05 07:15:29 +01:00
Joakim Hove
a91d47f191 Add name property to UDQSet 2019-02-25 11:15:12 +01:00