Commit Graph

11804 Commits

Author SHA1 Message Date
Markus Blatt
b3eddb7061
Merge pull request #3040 from hakonhagland/python_nsp2
Make the Python `opm` package a namespace package
2022-06-10 15:01:07 +02:00
Torbjørn Skille
e778960932 API change of class ERft and ERst
ERft - return false (not throw an exception) if function hasArray( .. ) is used with an
non-existing rftreport.

ERst - new memeber function hasArray ( .. )
2022-06-10 14:27:48 +02:00
Håkon Hægland
046736e45d Make Python opm package a namespace package
Convert the Python opm package from a regular package to a namespace
package such that opm-simulators can contribute to the package from a
different filesystem path. In this way, the two packages opm.simulators
and opm.io (for example) can have a different parent filesystem path.
2022-06-10 09:02:19 +02:00
Markus Blatt
02167f2c2f
Merge pull request #3041 from blattms/always-search-superlu
Make sure USE_SUPERLU is defined when calling FindSuperLU.cmake
2022-06-09 16:13:41 +02:00
Markus Blatt
819a28a94d Make sure USE_SUPERLU is defined when calling FindSuperLU.cmake
Previously, touching CMakeLists.txt after a first compilation would
trigger compile errors as the two CMake runs were done with
inconsistent parameters (first one without USE_SUPERLU defined and
second one with -DUSE_SUPERLU=ON). Of course that meant that the
options would also differ from module to module, which seems like a
recipe for desaster.

This patch fixes this by moving the definition of the USE_SUPERLU
option to OpmInit.cmake which is included very early in the top most
CMakeLists.txt of each module.

Closes OPM/opm-simulators#3908
2022-06-09 12:26:56 +02:00
Markus Blatt
dbec8e4466
Merge pull request #3029 from plgbrts/new-jt-table
Joule-Thomson keywords for gas, oil and water phase
2022-06-07 13:17:06 +02:00
Markus Blatt
5a61625768
Merge pull request #3037 from hakonhagland/inst_pyt
WIP: Install the `install.py` script such that it can be reused by opm-simulators
2022-06-07 13:02:09 +02:00
Markus Blatt
3a5b17a070
Merge pull request #3039 from bska/rst-glo-compat
Increase Compatibility of GLO Restart Output
2022-06-07 11:53:31 +02:00
Bård Skaflestad
f6ca3ccaff Increase Compatibility of GLO Restart Output
We need to honour a "small rate threshold" when outputting the lift
gas max supply rate limit and total gas production limit.  This
threshold renders the output discontinuous, but is needed for
compatibility.
2022-06-06 21:18:47 +02:00
Bård Skaflestad
e6d8d59525
Merge pull request #3028 from tskille/esmry_updates
Esmry updates
2022-06-06 21:16:49 +02:00
Håkon Hægland
32c3d9bcb0 Add the python script directory to opm-project-config
Uses GNUInstallDIrs' CMAKE_INSTALL_DATAROOTDIR as top directory for
common python scripts. Also adds that location to
opm-project-config.cmake.in such that other opm modules can
easily lookup the common scripts
2022-06-03 09:03:34 +02:00
Torbjørn Skille
9a97d5c998 updated ExtESmry unit test
Loading summary vector from restart simulation with loadBaseRunData = true and selected summary vector not present in baserun.
Common use case where a new vector added in the restart run.
2022-06-02 19:46:37 +02:00
Torbjørn Skille
1433bc7a55 ExtESmry - support loading when number of time steps have increased (on disk)
The ESMRY file can be updated with more time step data in the time span between opening an ESMRY file
and loading actual summary data from the file. This can happen if the ESMRY is generated by an active
run. Length of summary vectors extracted will be equal to number of time steps on disk when the file was
first opened (with the constructor).
2022-06-02 19:44:20 +02:00
Torbjørn Skille
ab81083e02 Write temporary ESMRY file before renaming this to the actual file name
This increases the availability of the file for other processes. Duration for a
rename file operation is very short relative to writing a new file.
2022-06-02 14:10:17 +02:00
Torbjørn Skille
d34910c27d Minimum time interval between update of ESMRY file
The ESMRY file need a complete rewrite every time this is being updated.
This will makes the file more available for reading by other processes.
2022-06-02 14:10:14 +02:00
Atgeirr Flø Rasmussen
e1e0edba7d
Merge pull request #3038 from bska/jfunc-require-endscale
Require ENDSCALE When JFUNC Entered
2022-06-01 08:54:28 +02:00
Bård Skaflestad
4333a69cd4 Require ENDSCALE When JFUNC Entered
We effectively ignore JFUNC data unless end-point scaling is
activated through the ENDSCALE keyword in the RUNSPEC section.
Alert the user to this fact by terminating the simulation run if the
case uses JFUNC without ENDSCALE present in RUNSPEC.  In this case,
issue a diagnostic message of the form

    Error: Unrecoverable errors while loading input: Problem with keyword JFUNC
    In CASE.DATA line 125
    Incompatible keyword combination: JFUNC declared, but ENDSCALE is missing.
2022-05-31 16:56:27 +02:00
Håkon Hægland
89b790d72f Install install.py
Install the install.py python script such that it can be used by
opm-simulators when building against an installed opm-common
2022-05-31 12:19:50 +02:00
Markus Blatt
d278880091
Merge pull request #3032 from bska/netbalan-rst-fixes
Increase Compatibility of NETBALAN Restart Output
2022-05-27 21:46:21 +02:00
Bård Skaflestad
8ff84920ed Increase Compatibility of NETBALAN Restart Output
The current Network::Balance class applies default values a little
too eagerly and this leads to problems for restarted simulation.  We
must take care to preserve the "did this item have a value" state
also in the restart file lest interactions with TUNING be lost
there.

To this end, make the minimum timestep size for network balancing be
an std::optional<> and use std::nullopt to represent "no value set"
in the input file.  While here, also preserve negative balancing
intervals exactly instead of replacing these values by zero.
2022-05-27 17:09:23 +02:00
Markus Blatt
378bd03eef
Merge pull request #3033 from tskille/fix_esmry
ESmry and ExtESmry - Prevent loading data multiple times
2022-05-25 15:15:33 +02:00
Torbjørn Skille
607b8e7ebf ESmry and ExtESmry - Prevent loading data multiple times 2022-05-25 12:01:36 +02:00
Bård Skaflestad
4f181ec439
Merge pull request #3021 from bska/wecon-etc-restart-output
Identify Additional IWEL and SWEL Items
2022-05-25 10:54:35 +02:00
Bård Skaflestad
b4cebad6a9 Address Review Comments
In particular, add more unit testing and give names to a number of
index constants.

Thanks to [at]blattms for reviewing the initial version of this
patch.
2022-05-24 18:21:41 +02:00
Bård Skaflestad
188d7802a3 Temporarily Disable Higher-Level Water Injection Control
Instead, just declare that all non-FIELD groups are subject to
higher-level control of the water injection.

This hack is needed for compatibility on a real field case.  We must
revisit this at a later point.
2022-05-24 12:06:57 +02:00
Bård Skaflestad
adb84c15cc Emit Group Control Target of Zero if Explicitly Assigned
If a simulation model explicitly assigns a target or limit of 0.0,
then we must honour that value in the restart file.  Use a more
complete condition to detect whether or not group level targets or
limits are defaulted in GCONPROD and/or GCONINJE.
2022-05-24 12:06:57 +02:00
Bård Skaflestad
b36f415a96 Identify Additional IWEL and SWEL Items
In particular, add entries from WECON, WGRUPCON and, WVFPEXP and fix
an incorrect item attribution for the WTEST 'reason' parameter.

Thanks to [at]tskille for invaluable assistance in identify these
items.
2022-05-24 12:06:57 +02:00
Bård Skaflestad
67b7fe58b3 Don't Assert IWEL[24] == -1 Anymore
This setting is no longer magic.
2022-05-24 12:06:57 +02:00
Bård Skaflestad
6049b6e254 Expose First/Every Reporting
Needed for output to the restart file.
2022-05-24 12:06:57 +02:00
Bård Skaflestad
2aff28dd57
Merge pull request #3002 from bska/bxip-smry-values
Add Support for Block-Level Component-in-Place Summary Values
2022-05-24 12:04:23 +02:00
Bård Skaflestad
c5b9c8ea18 Add Support for Block-Level Component-in-Place Summary Values
This commit outputs the various BxIP* summary output values such as
BOIP (block-level oil-in-place) and BGIPL (block-level gas-in-place
in liquid phase).  While here, also add support for outputting the
block-level dissolved gas-oil-ratio (BRS) and vaporised
oil-gas-ratio (BRV).
2022-05-23 14:51:30 +02:00
Markus Blatt
82a5e7192e
Merge pull request #3031 from hakonhagland/python_rates3
Adds a method get_injection_properties() to the Python interface to Opm::Schedule
2022-05-23 14:05:24 +02:00
Håkon Hægland
fa740678e0 Adds a method get_injection_properties()
Adds a method get_injection_properties() to the Python interface to
Opm::Schedule. This method can be used to get information about
Well::WellInjectionProperties for a given report step.

In order to avoid code duplication between opm-simulators and opm-common,
logic in CMakeLists.txt was refactored out into
cmake/Modules/PyInstallPrefix.cmake
2022-05-20 06:27:29 +02:00
Markus Blatt
acd90212d7
Merge pull request #3030 from blattms/bump-version-2022.10
Bump version to 2022.10-pre
2022-05-19 16:52:32 +02:00
Markus Blatt
a036273540 Bump version to 2022.10-pre 2022-05-19 16:46:35 +02:00
Markus Blatt
678114116f
Merge pull request #3026 from bska/expose-raw-guiderate-phase
Provide Accessor for WGRUPCON's Raw Phase Value
2022-05-19 15:34:19 +02:00
Markus Blatt
180b7cb664
Merge pull request #3027 from bska/attribute-missing-kw-terminator
Attribute Missing Terminator to Keyword/File/Line
2022-05-19 15:32:44 +02:00
Paul Egberts
d11d7d6ca0 Joule-Thomson keywords for gas, oil and water 2022-05-18 16:16:57 +02:00
Bård Skaflestad
462457fb39 Attribute Missing Terminator to Keyword/File/Line
This will hopefully aid the user in resolving the underlying issue.
2022-05-10 22:01:21 +02:00
Bård Skaflestad
f7ea7674c0 Provide Accessor for WGRUPCON's Raw Phase Value
Needed for restart file compatibility.
2022-05-10 10:03:27 +02:00
Bård Skaflestad
c91bde8182
Merge pull request #3005 from bska/weltarg-uda
Save and Restore UDAs From WELTARG Keyword
2022-05-09 14:09:30 +02:00
Bård Skaflestad
0e2623d6dd List WCONPROD UDAs in Order of Increasing Enum Values
The entries for WRAT and GRAT were listed in reverse order.
2022-05-09 12:24:30 +02:00
Bård Skaflestad
b9e9112c6b Distinguish Well/Group Injection/Production UDA Controls
This avoids add-on logic at the call site to identify UDAs in
WELTARG keywords.

Suggested by: [at]atgeirr
2022-05-09 12:05:28 +02:00
Bård Skaflestad
b9eaa3a6aa Save and Restore UDAs From WELTARG Keyword
This commit hooks the WELTARG UDA support code up to the main path
for saving and reloading the IUAD/IUAP restart arrays.
2022-05-09 11:33:07 +02:00
Bård Skaflestad
f751c46f10 Count Active UDAs From WELTARG Keyword
This commit introduces a new overload of the updateUDQActive member
function of the WellInjectionProperties and WellProductionProperties
classes.  The new overload is specifically targeted at accounting
for any active UDAs in WELTARG records.  It is possible to have
"regular" UDAs introduced in WCONPROD/WCONINJE and also a separate
set of UDAs attributed to WELTARG at the same time so we need to be
able to distinguish the two cases.

Call the new overload from the WELTARG keyword handler.
2022-05-09 11:33:07 +02:00
Bård Skaflestad
14a6a5a4c3 Generate Units of Measurements for WELTARG UDAs
In preparation of loading such UDAs from the restart file.
2022-05-09 11:33:07 +02:00
Bård Skaflestad
25ede43bf7 Implement UDQ::*_control in Terms of UDQ::keyword
This replaces the cost of maintaining sets of switch/case statements
with some additional runtime cost of looking up the corresponding
keyword in a std::map<>, but these functions are not called in inner
loops so the extra cost is justified.
2022-05-09 11:33:07 +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