Compare commits

..

736 Commits

Author SHA1 Message Date
Atgeirr Flø Rasmussen
c72d2bf460 Merge pull request #2092 from OPM/fix/add-std-includes
add missing includes of standard library headers
2020-11-06 13:29:22 +01:00
Bernd Flemisch
dfddff0562 add missing includes of standard library headers 2020-11-06 09:56:05 +01:00
Joakim Hove
1371b5706d Bump version to 2020.04 final 2020-05-14 12:46:39 +02:00
Joakim Hove
b571dd9d66 Bump version to rc4 2020-05-08 10:39:27 +02:00
Joakim Hove
ad746440e0 Use string based parent *name* in GTNode instead of pointer 2020-05-08 10:23:54 +02:00
Markus Blatt
2bae3b2300 Quietly searcg for OpenMP in opm-common-prereqs.cmake 2020-04-30 12:17:56 +02:00
Markus Blatt
75a2a7e0ee Mark OpenMP as prerequisite for opm-common
to automatically trigger find_package(OpenMP) in downstream
modules (e.g. Dumux)
2020-04-30 12:17:50 +02:00
Arne Morten Kvarving
917fc523ad changed: remove multiarch-support predepends
no longer required in ubuntu bionic, and breaks ubuntu focal,
and in any case it is support by both platforms.
2020-04-30 10:25:58 +02:00
Joakim Hove
28e492ecb9 Bump version to 2020.04-rc3 2020-04-29 16:44:26 +02:00
Joakim Hove
ec1c315968 Python files should go in $PREFIX/dist-packages on debian 2020-04-29 10:49:49 +02:00
Joakim Hove
cf72ef0330 Remove unused function from Group output data 2020-04-29 10:43:03 +02:00
Markus Blatt
10a3bc4b56 Find Zoltan only if MPI is available.
Otherwise we experience compilation errors if OPM is configured with
deactivated MPI and activated and found dune-alugrid (cpmpile error
that mpi.h is not found). This commit fixes this for me.
2020-04-28 14:51:46 +02:00
Joakim Hove
8b4d8f1734 Remove unsupported E300 keywords 2020-04-27 19:22:15 +02:00
Markus Blatt
7cea357930 Use OpenMP::OpenMP_CXX target when linking libopmcommon
This should allow downstream to automatically use the correct
compile and linke flags for CMake > 3.9. For older versions
we fall back to the old approach.

Closes #1751
2020-04-27 16:09:42 +02:00
OPMUSER
720fb8dcab Add PVTGW, PVTGWO and RWGSALT
Will also add to Missing Features.
2020-04-27 13:00:12 +02:00
OPMUSER
8e56b44201 Update keyword_list.cmake with PERMFACT
Update keyword_list.cmake with PERMFACT
2020-04-27 13:00:04 +02:00
OPMUSER
b14c5fc1a9 Rename PERMRED to PERMFACT
As per TNO rename PERMRED to PERMFACT to match documentation.
2020-04-27 13:00:00 +02:00
Joakim Hove
565d6b76dc Use ESmry::loadData() to preload all summary vectors 2020-04-27 12:58:41 +02:00
Joakim Hove
ac840312e7 Small fixes to RSM output
- MAI -> MAY
- Update text header with simulation time and flow version
- Make sure the YEARS column is always the first column on page 1
2020-04-27 12:58:37 +02:00
Joakim Hove
5e800ae2e7 Add keyword PRVD 2020-04-25 21:44:14 +02:00
Joakim Hove
2e0583cc74 Summary compare ESmry and ERsm - looser tolerance 2020-04-25 09:11:59 +02:00
OPMUSER
8365eaed0b Update keyword_list.cmake 2020-04-25 09:11:53 +02:00
OPMUSER
571582c881 Create HMMULTSG
Create HMMULTSG definition
2020-04-25 09:11:46 +02:00
Joakim Hove
6439ae1cea Unconditionally add YEARS to summary output 2020-04-25 09:11:40 +02:00
Joakim Hove
e796916057 Introduce time unit ecl_years == 365.25 days 2020-04-25 09:11:10 +02:00
Joakim Hove
63b663228a Bumped version to 2020.04-rc2 2020-04-23 10:33:41 +02:00
Joakim Hove
bf475b73b4 Segment sorting - check if already in order 2020-04-23 10:27:29 +02:00
Joakim Hove
1e734020f1 Update connections should hanlde empty list 2020-04-23 10:27:12 +02:00
Joakim Hove
60e9a9c6b9 Merge pull request #1731 from joakim-hove/segment-depth-change
Add method WellSegments::segmentDepthChange()
2020-04-22 14:53:23 +02:00
Joakim Hove
48969b8b77 Add method WellSegments::branchSegments() 2020-04-22 12:07:26 +02:00
Joakim Hove
dd0041f8ee Add method WellSegments::segmentDepthChange() 2020-04-22 10:21:51 +02:00
Joakim Hove
c4690fd3c0 Merge pull request #1730 from joakim-hove/segment-connection-block-depth
Changes in WELSPECS reports implementation
2020-04-22 09:53:53 +02:00
Joakim Hove
d0828c4016 Changes in WELSPECS reports implementation
- The table datastructures are created dynamically
- Pass a context variable to all fetcher functions
- Add function to look up grid cell depth
2020-04-22 09:16:06 +02:00
Joakim Hove
f0eaa8ea99 Merge pull request #1728 from joakim-hove/report-check-time
Report check time
2020-04-22 08:21:35 +02:00
Joakim Hove
b082a4d02f Send WELSPECS report to OpmLog::info() 2020-04-21 14:43:07 +02:00
Joakim Hove
22de4aaeee Write footnotes under the WELSPECS report tables 2020-04-21 14:42:26 +02:00
Williham Williham Totland
3db07ce4d3 Implement WELSPECS reports for MSW wells 2020-04-21 14:34:23 +02:00
Bård Skaflestad
f902ceb6d7 Merge pull request #1729 from joakim-hove/changed-wells
Add function Schedule::changed_wells() to use in WELSPECS reporting
2020-04-21 14:13:54 +02:00
Joakim Hove
d37aa1116d Add function Schedule::changed_wells() to use in WELSPECS reporting 2020-04-21 13:18:49 +02:00
Joakim Hove
0f5fddc470 Merge pull request #1722 from joakim-hove/raw-string-quote
Raw string quote
2020-04-21 13:02:49 +02:00
Joakim Hove
ca508663b2 Add comparison of connections to Well::operator== 2020-04-21 11:28:36 +02:00
Joakim Hove
9a6d4d43a8 Split Well::operator==() 2020-04-21 11:28:36 +02:00
Joakim Hove
f32f971bc5 Merge pull request #1727 from akva2/fix_test_suite
fixed: it's test_suite, not tests_suite
2020-04-21 11:17:12 +02:00
Joakim Hove
7f0700431a Merge pull request #1726 from akva2/set_visibility
changed: explicitly set visibility on PyRunModule
2020-04-21 10:31:40 +02:00
Joakim Hove
3c60cb3765 Merge pull request #1723 from joakim-hove/welspecs-connection-DFACTOR
Add unsupported D-FACTOR to Welspecs Connection report
2020-04-21 09:33:27 +02:00
Joakim Hove
8debd0b044 Merge pull request #1725 from akva2/mark_pybind11_system
changed: mark pybind11 headers as system headers
2020-04-21 09:24:58 +02:00
Arne Morten Kvarving
0656b4bf17 fixed: it's test_suite, not tests_suite 2020-04-21 09:24:41 +02:00
Arne Morten Kvarving
23dccd9c54 changed: explicitly set visibility on PyRunModule
to avoid warnings for the pybind11 members with hidden visibility
2020-04-21 09:19:54 +02:00
Arne Morten Kvarving
c22a4ff980 changed: mark pybind11 headers as system headers
to quell some (shadowing) warnings
2020-04-21 09:00:30 +02:00
Joakim Hove
6f23f05c03 Add unsupported D-FACTOR to Welspecs Connection report 2020-04-21 08:29:39 +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
Bård Skaflestad
89503cd4d9 Merge pull request #1676 from tskille/esmry_test_lod
Effective LOD for ESmry
2020-04-20 20:59:51 +02:00
Joakim Hove
635f3ccb4a Merge pull request #1721 from akva2/fix_deck_deserialize
fixed: initialize iterators after deserialization
2020-04-20 15:03:43 +02:00
Arne Morten Kvarving
78a6854214 fixed: initialize iterators after deserialization 2020-04-20 13:19:55 +02:00
Joakim Hove
082ab35a0e Merge pull request #1716 from joakim-hove/embedded-python-cmake
Set flag for embedded Python in the opm-common-config.cmake file
2020-04-20 11:16:03 +02:00
Bård Skaflestad
4da5a81233 Merge pull request #1718 from joakim-hove/welspecs-items
Internalize Gas inflow equation flag in Well - for reporting
2020-04-19 23:45:51 +02:00
Torbjørn Skille
54087e3bd8 Effective LOD for ESmry 2020-04-19 20:59:38 +02:00
Joakim Hove
0f22f897ed Add message about missing data 2020-04-19 08:58:31 +02:00
Joakim Hove
9194dd408e Add message about missing well D factor 2020-04-19 08:54:05 +02:00
Joakim Hove
84ad5ef502 Internalize Gas inflow equation flag in Well - for reporting 2020-04-19 08:37:48 +02:00
Joakim Hove
12b0537936 Merge pull request #1717 from berland/OPTIONS3
Add json file for OPTIONS3, E300.
2020-04-18 07:08:39 +02:00
Bård Skaflestad
2d4175ed0f Merge pull request #1695 from GitPaean/msw_summary_keywords
adding the summary output keywords for MSW
2020-04-17 20:53:31 +02:00
Atgeirr Flø Rasmussen
4b1609b20a Merge pull request #1712 from joakim-hove/group-control2
Separate flags for available_for_group_control for injectors and producers
2020-04-17 16:40:23 +02:00
Håvard Berland
f46a4c9a02 Update keyword_list.cmake with OPTIONS3 2020-04-17 16:28:20 +02:00
Håvard Berland
29e7ef4504 Add json file for OPTIONS3, E300. 2020-04-17 16:05:52 +02:00
Joakim Hove
7a2394ae12 Set flag for embedded Python in the opm-common-config.cmake file 2020-04-17 14:14:26 +02:00
Joakim Hove
819b624809 Changes in available for group control implementation
1. Add separate available_group_control flags for injection and production.
2. Add separate available_group_control flags for each injection phase.
2020-04-17 13:30:26 +02:00
Joakim Hove
dd30fb7bd8 Extracte Schedule construction to separate function in test 2020-04-17 13:03:26 +02:00
Joakim Hove
fbfd95d2f2 Merge pull request #1711 from joakim-hove/welspecs-unknown
Welspecs unknown
2020-04-17 11:43:34 +02:00
Joakim Hove
a18539c63c Merge pull request #1620 from joakim-hove/run-pyaction
Run pyaction
2020-04-17 11:40:15 +02:00
Joakim Hove
53fddda62b Merge pull request #1715 from joakim-hove/keywords
Add some missing keywords
2020-04-17 11:37:51 +02:00
Joakim Hove
78577e94cc Add some missing keywords 2020-04-17 08:57:17 +02:00
Kai Bao
e09b0a2de4 addressing reviewing comments from OPM/opm-common#1695 2020-04-17 01:06:22 +02:00
Kai Bao
8e4d4827a2 adding the test for new segment summary keywords 2020-04-17 00:38:21 +02:00
Kai Bao
34ca02c253 adding summary keywords for MSW
SPRD, SPRDH, SPRDF, SPRDA
2020-04-17 00:38:21 +02:00
Joakim Hove
3dbb922cc7 Fill on some of the unknown elements in WELSPECS report 2020-04-16 17:54:09 +02:00
Joakim Hove
315382bad8 Run PYACTION keywords
The PYACTION keyword is implemented with a Python module with a run() function
in an external module.
2020-04-16 14:13:54 +02:00
Williham Williham Totland
ead07d2f3f Passes line_number to columnwise data fetch function. 2020-04-16 09:39:46 +02:00
Joakim Hove
685ab301d2 Merge pull request #1691 from joakim-hove/UDQ-UNITS
Default construct UDQ keywords with value 0 when defined with UNIT
2020-04-16 09:27:28 +02:00
Joakim Hove
44c5a6c84c Merge pull request #1709 from joakim-hove/region-fip-keyword
Minor fixup to REGION fip summary keyword regexp
2020-04-16 09:27:01 +02:00
Joakim Hove
b899a1da64 Merge pull request #1703 from joakim-hove/well-store-dens-calc
Check WELSPECS values
2020-04-16 09:26:48 +02:00
Joakim Hove
637b1109aa Minor fixup to REGION fip summary keyword regexp 2020-04-16 07:05:51 +02:00
Joakim Hove
d79b817a58 Merge pull request #1707 from GitPaean/small_adjustment_aquifer_keywords
small adjustments for a few AQU keywords
2020-04-16 06:33:35 +02:00
Joakim Hove
2b0fcc974c Merge pull request #1686 from joakim-hove/cache-cell-volume
Cache cell volume
2020-04-16 06:32:05 +02:00
Joakim Hove
92e923b567 Merge pull request #1706 from joakim-hove/test-clean-srcdir
Rework testing of Schedule exit status
2020-04-15 21:56:55 +02:00
Kai Bao
585e18d85f small adjustments for a few AQU keywords
AQUCT, AQUFET, AQUFETP
2020-04-15 21:24:43 +02:00
Joakim Hove
43e2fced7d Simplified testing of exit status 2020-04-15 21:04:26 +02:00
Markus Blatt
8e3ba156a6 Merge pull request #1675 from blattms/refactor-policy-settings
Fix policy warnings
2020-04-15 21:01:35 +02:00
Joakim Hove
133ff18ee3 Make sure all generated files are in $work_dir 2020-04-15 20:50:51 +02:00
Joakim Hove
abaee17857 Add HAVE_OPENMP has opm_common_CONFIG_VAR 2020-04-15 20:33:22 +02:00
Joakim Hove
0cfc291039 Add function to calculate volume for all active cells - omp 2020-04-15 20:33:22 +02:00
Atgeirr Flø Rasmussen
0cdd6ba3d8 Merge pull request #1692 from joakim-hove/action-exit
Action exit
2020-04-15 17:11:15 +02:00
Markus Blatt
8816549f2f Try to set CMP0048 to NEW as we do not use VERSION 2020-04-15 14:17:53 +02:00
Markus Blatt
eb22f6cfd9 [CMake] Set PATH instead of LOCATION. 2020-04-15 14:17:53 +02:00
Markus Blatt
6707263385 DUNE does not need special treatment.
No need to set *_ROOT for it, which triggers a CMP0074 warning
as the policy settings do not survive find_package calls.
2020-04-15 14:17:53 +02:00
Markus Blatt
636ce45596 Set policy CMP0074 to NEW.
We have been using  <PackageName>_ROOT like it is intended now.
2020-04-15 14:17:53 +02:00
Markus Blatt
742d8943ca Move policy settings to OpmInit and into a macro OpmSetPolicies().
OpmInit.cmake is one of the first includes and most importantly before
the opm-*-prereqs.cmake files are include. The macro is needed to make
the policies set in all CMakefiles. OpmSetPolicies should be called in
the toplevel CMakeLists.txt file.

This fixes a lot of warnings experienced in downstream modules that
got triggered by the opm-*-prereqs.cmake files. At some calls the
policies were at other not.

On the other hand new warnings about soon to be deprecated policies
CMP0026 and CMP0048 appear at least for cmake version 3.13.4.
But that should be fixed in another PR.
2020-04-15 14:17:53 +02:00
Joakim Hove
593ee3174c Merge pull request #1704 from blattms/remove-old-boost-locale-hack
Revert hack for old boost versions (commit 59863939)
2020-04-15 13:39:58 +02:00
Markus Blatt
4882e2d782 Revert hack for old boost versions (commit 59863939)
We do not support boost in that version anymore and do not use its
locales anyway.

Closes #1667
2020-04-15 12:51:13 +02:00
Joakim Hove
4d9be76910 Check WELSPECS value for FIP_REGION and DENSITY_CALCULATION 2020-04-15 11:54:15 +02:00
Joakim Hove
3072f0dabe Add pvt_table as member for Well 2020-04-15 11:26:57 +02:00
Joakim Hove
e417ca6688 Merge pull request #1694 from joakim-hove/pyaction-api
Add api for PyAction::run()
2020-04-14 19:06:19 +02:00
Joakim Hove
12bbf19425 Merge pull request #1700 from akva2/janitoring
Some more janitoring
2020-04-14 16:34:38 +02:00
Joakim Hove
1c84c4c3f3 Add new keyword EXIT
The keyword EXIT is a opm only keyword which can be used to terminate the whole
simulation as part of the ACTIONX keyword.
2020-04-14 16:32:52 +02:00
Arne Morten Kvarving
b8a66cb0fa Merge pull request #1699 from akva2/clang_with_std++fs
changed: add option for using clang with libstdc++
2020-04-14 16:12:43 +02:00
Arne Morten Kvarving
f23257cbf5 initialize variables to avoid (faulty) compiler warnings 2020-04-14 14:10:37 +02:00
Arne Morten Kvarving
784389d228 remove unused variables 2020-04-14 14:10:33 +02:00
Atgeirr Flø Rasmussen
f494f6d5ce Merge pull request #1696 from joakim-hove/explicit-schedule
Add explicit to one argument Schedule constructor
2020-04-14 13:23:26 +02:00
Joakim Hove
6c34c0304f Merge pull request #1698 from atgeirr/fix-dxdydztops-performance
Address performance issue for DX/DY/DZ/TOPS grids.
2020-04-14 13:03:03 +02:00
Joakim Hove
f9b5946b25 Merge pull request #1697 from akva2/janitoring
fixed: avoid shadowing warnings
2020-04-14 13:02:07 +02:00
Arne Morten Kvarving
2f2cbea424 changed: add option for using clang with libstdc++
when using clang, whether or not we should link to stdc++fs
cannot easily be detected. it depends on the c++ lib used
(libstdc++ vs libc++), as well as the versions of these.

to avoid messing up in general, this adds an option for forcing
linking to stdc++fs, even when using clang. it defaults to false
to not break existing build setups where it works. is required
for building on jenkins
2020-04-14 11:44:32 +02:00
Arne Morten Kvarving
33e3d36ef5 fixed: avoid shadowing warnings 2020-04-14 11:28:10 +02:00
Atgeirr Flø Rasmussen
11f555c156 Address performance issue for DX/DY/DZ/TOPS grids.
The sumIdir() and sumJdir() methods were called inside loop
nests over i and j. Since the methods themselves were linear in
nx and ny, respectively, this was a quadratic algorithm. Performance
only becomes an issue for large (> 10k) values of NX or NY, which
was thought not to ever happen. This assumption was wrong.
2020-04-14 11:28:07 +02:00
Joakim Hove
84eaef0372 Add explicit to one argument Schedule constructor 2020-04-14 11:27:26 +02:00
Joakim Hove
e980713572 Merge pull request #1693 from joakim-hove/unused
Unused
2020-04-13 08:29:12 +02:00
Joakim Hove
466e21e37e Add api for PyAction::run() 2020-04-13 08:01:09 +02:00
Joakim Hove
648a8d1413 Remove unused arguments 2020-04-13 07:54:10 +02:00
Joakim Hove
0c91724927 Changes in Schedule default construction - add Python argument 2020-04-13 07:52:47 +02:00
Joakim Hove
750e7b8b24 Default construct UDQ keywords with value 0 when defined with UNIT 2020-04-12 08:38:59 +02:00
Bård Skaflestad
8202c2007e Merge pull request #1690 from joakim-hove/write-report-ss
Write report to stringstream and not stdout
2020-04-11 23:31:24 +02:00
Joakim Hove
161d337dd3 Write report to stringstream and not stdout 2020-04-11 22:03:31 +02:00
Joakim Hove
56745f57ac Merge pull request #1689 from joakim-hove/schedule-python-constructor
Schedule: add std::shared_ptr<Python> arg to "default" constructor
2020-04-11 08:00:59 +02:00
Williham Williham Totland
9a69c49ca9 Start to create WELSPECS reports 2020-04-11 07:52:32 +02:00
Joakim Hove
f0d0fb1a83 Merge pull request #1688 from tskille/summary
Updates of ESmry
2020-04-10 19:37:32 +02:00
Joakim Hove
3af0d4e623 Add Schedule(Python ) constructor 2020-04-10 12:07:00 +02:00
Torbjørn Skille
e5583b738f Updates of ESmry
- new overload function for keywordList, list keys based on pattern (string argument)
 - summary program wild card elements (keys including * or ?)
 - python bindings to new member function
2020-04-10 10:10:58 +02:00
Joakim Hove
acda777b9d Merge pull request #1685 from joakim-hove/rsm-regression-test
Rsm regression test
2020-04-09 10:58:41 +02:00
Joakim Hove
efeafcc47c Merge pull request #1687 from joakim-hove/grid-cleanup
Grid cleanup
2020-04-08 22:30:44 +02:00
Joakim Hove
1efca16420 EclipseGrid: - use member getNXYZ() instead of passing dims 2020-04-08 21:44:26 +02:00
Joakim Hove
650ffb12b8 EclipseGrid: ensure that all ACTNUM manipulations use resetACTNUM 2020-04-08 21:38:41 +02:00
Tor Harald Sandve
19693c7d3d Merge pull request #1632 from totto82/scale_guiderates_with_rates
Scale guiderates with rates
2020-04-08 12:29:20 +02:00
Bård Skaflestad
afd0ed21ba Merge pull request #1682 from joakim-hove/timestamp-ymd
Add three argument (year, month, day) constructor TimeStampUTC
2020-04-07 12:07:02 +02:00
Joakim Hove
cee75dcaac Add basic regression testing of RSM file 2020-04-05 17:32:07 +02:00
Joakim Hove
fb345f94af Merge pull request #1684 from joakim-hove/rms-output-fixup
Rms output fixup
2020-04-05 15:57:13 +02:00
Joakim Hove
6296255ebc Add space part for the time/date column in the multiplier row 2020-04-05 12:38:12 +02:00
Joakim Hove
07d19b57d7 Add right padding of columns to column 130 2020-04-05 12:38:12 +02:00
Joakim Hove
db8c9652e4 Add cmp() function to compare ERsm and ESmry instances 2020-04-05 12:37:41 +02:00
Joakim Hove
f260c05d9d Add class ERsm for loading RSM files 2020-04-05 12:37:41 +02:00
Joakim Hove
2b81afc6fa Add space part for the time/date column in the multiplier row 2020-04-05 12:37:41 +02:00
Joakim Hove
1df8be064f Add right padding of columns to column 130 2020-04-05 12:37:41 +02:00
Joakim Hove
b4f5848e3e Add three argument (year, month, day) constructor TimeStampUTC 2020-04-05 10:58:53 +02:00
Joakim Hove
eb89331403 Merge pull request #1674 from joakim-hove/runsum-dates
Runsum dates
2020-04-05 10:58:39 +02:00
Bård Skaflestad
ac35c7c936 Merge pull request #1681 from joakim-hove/move-util
Moved string utilities to opm/common
2020-04-04 21:57:16 +02:00
Joakim Hove
075d018cf3 Moved string utilities to opm/common 2020-04-04 17:10:13 +02:00
Joakim Hove
ab2e5cc310 Add three argument (year, month, day) constructor TimeStampUTC 2020-04-04 16:20:13 +02:00
Joakim Hove
b09814bc2e Respect DATE keyword in RUNSUM output 2020-04-03 16:05:43 +02:00
Bård Skaflestad
efb34b6533 Merge pull request #1673 from joakim-hove/summary-date
Summary date
2020-04-03 12:48:13 +02:00
Joakim Hove
8f81df09c4 Merge pull request #1679 from wito/to-string-fix
[FIX] Resolves a build error on macOS/AppleClang 11.0.3
2020-04-03 12:37:27 +02:00
Williham Williham Totland
1925fc3712 Resolves a build error on macOS/AppleClang 11.0.3 2020-04-03 11:33:36 +02:00
Joakim Hove
92efbb4713 Merge pull request #1678 from akva2/add_test_configuration
added: support for specifying configuration for test
2020-04-03 11:29:26 +02:00
Joakim Hove
b72f3b9d4b Merge pull request #1677 from wito/dynamic-state-new-data
Allow interrogating DynamicState for changes in data
2020-04-03 11:16:33 +02:00
Joakim Hove
c9ae00707b Remove unused variable usec 2020-04-03 10:36:54 +02:00
Arne Morten Kvarving
2a9254e76d added: support for specifying configuration for test 2020-04-03 10:15:29 +02:00
Joakim Hove
934def46d2 Add DAY, MONTH and YEAR and summary keys 2020-04-03 10:09:48 +02:00
Joakim Hove
90940ed7b5 Add DATE as meta keyword to SummaryConfig 2020-04-03 10:09:48 +02:00
Bård Skaflestad
9764207bfd Merge pull request #1657 from joakim-hove/rst-msw-omega
Rst msw M2
2020-04-03 09:48:46 +02:00
Joakim Hove
142061dbc0 Update Well testing in Schedule::cmp 2020-04-03 08:55:44 +02:00
Joakim Hove
4e0c0911f1 Improve error message 2020-04-03 08:55:44 +02:00
Joakim Hove
31fb7e6072 Add operator<< for injection and production cmode 2020-04-03 08:55:44 +02:00
Joakim Hove
51866155c0 Add operator<< for well status 2020-04-03 08:55:44 +02:00
Williham Williham Totland
433a3a9e9b Adds DynamicState<T>::is_new_data(size_t). 2020-04-03 07:57:51 +02:00
Joakim Hove
d78cc40bf1 Set well VFP table when loading from restart file 2020-04-03 07:36:54 +02:00
Joakim Hove
907bdaf33e Improve error message 2020-04-03 07:36:54 +02:00
Bård Skaflestad
2ade5c67f3 Merge pull request #1669 from joakim-hove/summary-time
Use std::chrono instead of std::vector<int> to store start date
2020-04-02 22:20:11 +02:00
Tor Harald Sandve
f5b7d6cb98 scale guiderates with current rate 2020-04-02 20:36:29 +02:00
Markus Blatt
c7e70da2c5 Do not call project another time in OpmLibMain
Each project should and does this in their own top level
CMakeLists.cmake at the very beginning anyway.
2020-04-02 19:44:32 +02:00
Joakim Hove
3b70c9edce Add method dates to ESmry class 2020-04-02 19:23:02 +02:00
Tor Harald Sandve
5d61975622 rename Potetials struct in guideRate to RateVector 2020-04-02 16:34:07 +02:00
Joakim Hove
33ad7a2620 Use std::chrono instead of std::vector<int> to store start date 2020-04-02 15:38:20 +02:00
Joakim Hove
2df7183f1b Implement asLocalTimeT helper function 2020-04-02 15:31:13 +02:00
Joakim Hove
fd221bb949 Merge pull request #1670 from joakim-hove/esmry-rm-seqtime
Esmry rm seqtime
2020-04-02 13:59:05 +02:00
Joakim Hove
e3c491ad38 Merge pull request #1671 from wito/smpec-unit-fix
[FIX] Wrong unit names given for field units with certain values of UnitSystem::measure
2020-04-02 13:51:02 +02:00
Williham Williham Totland
c255116133 Adds static assertions to ensure at compile time that all unit names are provided. 2020-04-02 10:23:46 +02:00
Williham Williham Totland
4919d850a9 Resolves an issue with units resulting from silent string concatenation. 2020-04-02 10:19:28 +02:00
Joakim Hove
33ecf4215d ESmry: use templated function rstep_vector() 2020-04-02 09:35:59 +02:00
Joakim Hove
f8e793a21a ESmry: remove unused member seqTime 2020-04-02 09:32:12 +02:00
Bård Skaflestad
dc0b91609e Merge pull request #1656 from joakim-hove/rst-well-shut
Rst well shut
2020-04-01 23:11:04 +02:00
Bård Skaflestad
d918f052e2 Merge pull request #1668 from bska/pot-rate-smry-alias
Summary: Recognise Aliases for Potential Phase Injection Rates
2020-04-01 22:39:26 +02:00
Bård Skaflestad
dfb4b5ef3a Summary: Recognise Aliases for Potential Phase Injection Rates
This commit adds the aliases 'WGIP' and 'WWIP' for the existing
summary vector names 'WGPI' (potential gas injection rate at well
level), and 'WWPI' (potental water injection rate at well level),
respectively.

Some datasets in 'opm-tests' use these alias names.
2020-04-01 21:38:33 +02:00
Joakim Hove
d3817e2fc2 Merge pull request #1665 from wito/rptconfig-rptsched
Handle RPTSCHED keywords in a time-sensitive manner
2020-04-01 14:00:41 +02:00
Joakim Hove
07e6be97e9 msim: Add temporary well to msim testcase - and verify SHUT status 2020-04-01 13:29:17 +02:00
Joakim Hove
f115ed43f5 msim: Ensure that only open wells get an assigned rate 2020-04-01 13:18:00 +02:00
Joakim Hove
8483251aec msim: Pass correct substep flag 2020-04-01 13:18:00 +02:00
Joakim Hove
7cd004bf71 msim: ensure data::wells instance is not reused 2020-04-01 13:18:00 +02:00
Joakim Hove
e51edcf1c8 Add comment about multiple calls to setCurrentControl() 2020-04-01 13:18:00 +02:00
Williham Williham Totland
f3fbfc41ad Completes RPTConfig to pass tests. 2020-04-01 13:02:29 +02:00
Williham Williham Totland
9f7664fe13 Makes the new interface compile against tests. 2020-04-01 13:02:29 +02:00
Bård Skaflestad
03657799ce Merge pull request #1659 from joakim-hove/rst-well-shut2
Rst well shut2
2020-04-01 12:32:54 +02:00
Joakim Hove
61fa2d899e Merge pull request #1664 from akva2/janitoring
quell shadowing warnings
2020-04-01 11:05:25 +02:00
Arne Morten Kvarving
21db859ece quell shadowing warnings 2020-04-01 10:39:14 +02:00
Williham Williham Totland
ea269c7cc7 Implement writing of RSM file 2020-04-01 10:30:10 +02:00
Joakim Hove
f441d385f3 Fix initialization in test 2020-04-01 10:28:05 +02:00
Joakim Hove
278402b63e Check well status before checking active control 2020-04-01 10:28:05 +02:00
Joakim Hove
fe6714c14d Enable THP production control if THP target is set in restart file 2020-04-01 10:28:05 +02:00
Joakim Hove
07e590a0ed Check that will is OPEN before checking active control 2020-04-01 10:21:58 +02:00
Joakim Hove
efff382517 Add test for ReportConfig 2020-04-01 10:17:05 +02:00
Joakim Hove
7c0ddd0b9d Merge pull request #1654 from joakim-hove/skiprest-exceptions
Skiprest exceptions
2020-04-01 09:38:54 +02:00
Joakim Hove
07843654b1 SKIPREST: Make sure e.g. VFP tables are loaded even under SKIPREST 2020-04-01 08:23:15 +02:00
Joakim Hove
7aaf68fbc4 Add testdeck for the situation with SKIPREST and e.g VFP 2020-04-01 08:02:32 +02:00
Bård Skaflestad
420446f318 Merge pull request #1663 from joakim-hove/cmake-fix
Embed build timestamp also in UseVersion.cmake
2020-03-31 23:57:17 +02:00
Atgeirr Flø Rasmussen
3111505ed6 Merge pull request #1661 from joakim-hove/connections-wellpi
WPIMULT: directly multiply the connection transmissibility factor
2020-03-31 18:59:46 +02:00
Joakim Hove
320f9b5510 Emed build timestamp also in UseVersion.cmake 2020-03-31 17:23:25 +02:00
Joakim Hove
a8ad5cd9f2 Merge pull request #1662 from joakim-hove/fix-non-python
Fix codepath for non-python
2020-03-31 17:18:02 +02:00
Joakim Hove
5ac2b3f531 Fix codepath for non-python 2020-03-31 16:56:44 +02:00
Joakim Hove
6fb2989708 WPIMULT: directly multiply the connection transmissibility factor 2020-03-31 16:53:28 +02:00
Joakim Hove
14bd2f7d48 Merge pull request #1660 from joakim-hove/python-shared-ptr
Use std::shared_ptr<Python> for Python argument in Schedule
2020-03-31 16:50:43 +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
cebef15dc4 Merge pull request #1653 from joakim-hove/compile-timestamp
Generate BUILD_TIMESTAMP macro with build system
2020-03-31 07:56:14 +02:00
Joakim Hove
cc60a65f14 Merge pull request #1364 from bska/no-dyndata-seqnum-0
Don't Output Dynamic Data to Restart File for SEQNUM=0
2020-03-31 07:55:11 +02:00
Joakim Hove
fe1ef0a65f Generate BUILD_TIMESTAMP macro with build system 2020-03-30 15:11:48 +02:00
Bård Skaflestad
5c787ef97e Don't Needlessly Copy Complete Well Objects
We're able to implement the top-level restart file well writing code
without calling Schedule::getWells() and should therefore do so.

While here, also restore formatting in LoadRestart.cpp.
2020-03-30 14:39:04 +02:00
Bård Skaflestad
43ef003452 Header: Make 'ih' Not Const to Activate NRVO 2020-03-30 14:39:04 +02:00
Bård Skaflestad
bc28de3372 Don't Output Dynamic Data to Restart File for SEQNUM=0
This commit introduces a special case for the restart file writing
code.  In particular we no longer write dynamic data vectors (e.g.,
*WEL, *GRP, *CON) to the restart file if we're being asked to output
the initial condition (i.e., report step/sequence number 0).

Add the report step as a new explicit parameter to createInteHEAD()
instead of inferring this value from the "sim_step" and output
dynamic sizes as zero for report_step=0.  While here, also correct
an omission from earlier commit 7986e99e.  We must ensure that the
maximum number of wells in the field (intehead[163]) is at least as
large as the current number of active wells (intehead[16]).

Update "intehead" test to account for report_step being passed
directly as an argument to InteHEAD::stepParam().
2020-03-30 14:39:04 +02:00
Bård Skaflestad
269537b101 Merge pull request #1658 from akva2/bad_janitoring
fix faulty fix in 811d2e2a64
2020-03-30 14:37:02 +02:00
Arne Morten Kvarving
7e26c6a5e9 fix faulty fix in 811d2e2a64
sched uses python, so we have to reorder the members instead
2020-03-30 14:20:08 +02:00
Joakim Hove
fa8afbcc6d Merge pull request #1655 from akva2/janitoring
Quell warnings
2020-03-30 13:52:38 +02:00
Arne Morten Kvarving
ebc92fb92e fixed: proper initializer list order 2020-03-30 12:38:47 +02:00
Arne Morten Kvarving
811d2e2a64 quell unused parameter warning when built without python support 2020-03-30 12:33:34 +02:00
Arne Morten Kvarving
83d1627dbb quell signed/unsigned comparison warning 2020-03-30 12:33:20 +02:00
Joakim Hove
0025144079 Merge pull request #1559 from joakim-hove/rst-msw
Initialize MSW wells from restart file
2020-03-28 09:47:46 +01:00
Joakim Hove
f320fe3d57 Only compare historical modes in history mode 2020-03-28 08:58:14 +01:00
Joakim Hove
f59fec133d Check NSCONZ before reading CFKind value from SCON 2020-03-28 08:58:14 +01:00
Joakim Hove
bbc87beed5 Improve error message for connection comparison 2020-03-28 08:58:14 +01:00
Joakim Hove
7bc5272290 Connections / segments: retain start and end from restart 2020-03-28 08:58:14 +01:00
Joakim Hove
d827fd6da5 Update debug message 2020-03-28 08:58:14 +01:00
Joakim Hove
ad5b410940 Sort segments 2020-03-28 08:58:14 +01:00
Joakim Hove
aa6128c4be Check for invalid value when loading segment information 2020-03-28 08:58:14 +01:00
Joakim Hove
22396d1b21 Do not alter sort value when attaching segment from restart file 2020-03-28 08:58:14 +01:00
Joakim Hove
f613c15727 Connections: keep order from restart file 2020-03-28 08:58:14 +01:00
Joakim Hove
eb8f162663 Enable rst testing with MSW data 2020-03-28 08:58:14 +01:00
Joakim Hove
97173e51a3 Update binary testdata 2020-03-28 08:58:14 +01:00
Joakim Hove
fba1858925 Merge pull request #1652 from bska/resv-totinj
Restart: Save/Restore Cumulative Injected Reservoir Volume
2020-03-28 08:57:37 +01:00
Bård Skaflestad
1113c25eb1 Restart: Save/Restore Cumulative Injected Reservoir Volume
This commit adds support for persisting the *VIT cumulative summary
vector at the well, group, and field levels in the simulation
restart files.  Connection level currently not supported.
2020-03-27 14:59:29 +01:00
Joakim Hove
467f7879a6 Merge pull request #1636 from joakim-hove/add-python-arg
Add python arg
2020-03-27 13:43:44 +01:00
Joakim Hove
50fb51d56e Add Python arg to Schedule constructor 2020-03-27 12:43:18 +01:00
Joakim Hove
9d3ec9be61 Merge pull request #1646 from joakim-hove/python-fixup2
Make sure PythonInterpreter can be safely disabled
2020-03-27 12:42:18 +01:00
Joakim Hove
687887939d Make sure PythonInterpreter can be safely disabled 2020-03-27 12:11:40 +01:00
Joakim Hove
562136772a Merge pull request #1638 from joakim-hove/remove-stale-boost-include
Remove stale boost includes
2020-03-27 10:49:52 +01:00
Joakim Hove
7fc75ce61c Merge pull request #1650 from atgeirr/fix-embedded-python-test
Use braces to force correct parsing.
2020-03-27 10:49:34 +01:00
Joakim Hove
413a45ec21 Merge pull request #1648 from berland/jq
Reformat all json keyword files through jq
2020-03-27 10:48:59 +01:00
Atgeirr Flø Rasmussen
4c5b03b83e Use braces to force correct parsing.
Without this, clang thinks it is a declaration, not a function call.
2020-03-27 10:11:12 +01:00
Williham Williham Totland
3e29350e94 Integrate SummaryNode in ESmry (#1642) 2020-03-27 08:07:52 +01:00
Håvard Berland
54b714f361 Reformat all json keyword files through jq
Ensures similar pretty-printing everywhere.

Includes a bugfix for 000_Eclipse100/O/OVERBURD which had
a } too much
2020-03-26 23:16:17 +01:00
Joakim Hove
3e2160af28 Merge pull request #1608 from joakim-hove/connections-sort-item
Connections sort item
2020-03-26 17:52:54 +01:00
Joakim Hove
c41f375e00 Merge pull request #1645 from akva2/janitoring
quell compiler warnings
2020-03-26 17:33:25 +01:00
Joakim Hove
6d8154823a Merge pull request #1643 from joakim-hove/python-fixup
Temporarily protect against deref when python is disabled
2020-03-26 16:20:04 +01:00
Arne Morten Kvarving
c07a839f15 quell compiler warnings 2020-03-26 16:07:49 +01:00
Joakim Hove
cce2bc0686 Temporarily protect against deref when python is disabled 2020-03-26 15:38:18 +01:00
Joakim Hove
eca0589fe1 Merge pull request #1641 from joakim-hove/python-enable-enum
Enable fine grained control of Python ON | OFF
2020-03-26 14:21:24 +01:00
Joakim Hove
6ffb5883d4 Merge pull request #1639 from wito/add-aquifer-category
Add Aquifer Category
2020-03-26 12:39:11 +01:00
Joakim Hove
cda315ce41 Merge pull request #1640 from atgeirr/fix-field-unavailable
Make the FIELD group unavailable for higher level control.
2020-03-26 12:37:44 +01:00
Atgeirr Flø Rasmussen
fce6eeca1b Make the FIELD group unavailable for higher level control. 2020-03-26 12:07:06 +01:00
Joakim Hove
a8f0ebb183 Enable fine grained control of Python ON | OFF 2020-03-26 12:00:59 +01:00
Williham Williham Totland
4e08ff7f6d Adds ::Aquifer to Opm::EclIO::SummaryNode::Category. 2020-03-26 11:36:13 +01:00
Bård Skaflestad
5a701a2ee8 Merge pull request #1609 from wito/new-summarynode
New SummaryNode implementation
2020-03-26 11:34:21 +01:00
Joakim Hove
52855cce1e Merge pull request #1637 from bska/restore-all-injlimits
Simulation Restart: Restore All Available Injection Control Modes
2020-03-26 09:14:21 +01:00
Williham Williham Totland
06d317d119 Review Actions: Un-consts SummaryNode members and un-statics some data vectors. 2020-03-26 08:20:50 +01:00
Bård Skaflestad
c2bd04edcb Simulation Restart: Restore All Possible Injection Control Modes
In particular, declare that the well supports RATE, RESV, and THP
limits/targets if such values are available in the SWEL array.
2020-03-25 18:54:28 +01:00
Joakim Hove
39eb327551 Remove stale boost includes 2020-03-25 18:18:25 +01:00
Joakim Hove
9ad8465609 Replace connection segIndex and compSeqIndex with sort_value member 2020-03-25 18:02:40 +01:00
Joakim Hove
91841a99e1 Merge pull request #1606 from joakim-hove/wellconnections-output
Changes in WellConnection ordering
2020-03-25 18:01:51 +01:00
Joakim Hove
c7d3603184 Changes in WellConnection ordering
1. If the well is MSW the connections in the WellConnection class is sorted in
   output order in the ::order() method, and retained that way.

2. Add method WellConnection::output() which return a vector of connection
   pointers sorted in output order.
2020-03-25 10:54:21 +01:00
Joakim Hove
03efd5e589 Merge pull request #1635 from joakim-hove/internalize_tracers
Internalize tracers
2020-03-25 10:17:29 +01:00
Bård Skaflestad
9f0985850c Merge pull request #1614 from joakim-hove/wellrates-get-connection-rates
Get connection rates from well rates object
2020-03-25 08:09:10 +01:00
Joakim Hove
9411af4dfc Implement TracerConfig in EclipseState
Co-authored-by: Arne Morten Kvarving <arne.morten.kvarving@sintef.no>
2020-03-25 07:53:08 +01:00
Joakim Hove
5c2a5898c0 Fetch connection rates using global_index 2020-03-25 07:43:10 +01:00
Joakim Hove
8b2e503602 Update incorrect test 2020-03-25 07:43:10 +01:00
Bård Skaflestad
c68be43301 Merge pull request #1629 from joakim-hove/load-restart
Load restart XCON data
2020-03-24 12:21:59 +01:00
Joakim Hove
d40ebe647a Merge pull request #1634 from joakim-hove/pyaction-fixup
Pyaction fixup
2020-03-24 10:58:05 +01:00
Joakim Hove
179b6ba9ff Use global index when assembling connection rates from XCON keyword 2020-03-24 10:55:49 +01:00
Joakim Hove
9498217e0a Merge pull request #1623 from joakim-hove/find-connection
Find connection
2020-03-24 10:06:34 +01:00
Joakim Hove
00faf6099a Merge pull request #1628 from joakim-hove/init-global-index
Initialize global index when creating connections from rst file
2020-03-24 10:05:10 +01:00
Joakim Hove
fad5346ec1 Merge pull request #1633 from atgeirr/fix-type-mismatch
Fix type mismatch error for EclEntry.
2020-03-24 09:27:52 +01:00
Joakim Hove
611b21beab Add serialization active member 2020-03-24 08:40:13 +01:00
Joakim Hove
9ce64d5aae Add copy constructor and assignment operator to PyAction 2020-03-24 08:07:21 +01:00
Atgeirr Flø Rasmussen
2d52268bf8 Fix type mismatch error for EclEntry. 2020-03-24 08:05:34 +01:00
Joakim Hove
a0ebb2091f Add method Actions::pending_python() to get active Python functions 2020-03-24 07:23:31 +01:00
Joakim Hove
4c25ce69c1 Add mutable bool active member to PyAction 2020-03-24 07:23:31 +01:00
Joakim Hove
4b687e3368 Fix bug in CMakeLists.txt - mock simulator tests were not built 2020-03-24 07:23:31 +01:00
Joakim Hove
1ac240a425 Merge pull request #1625 from tskille/replace_long_int_eclio
replacing long int and unsigned long int
2020-03-23 19:57:10 +01:00
Bård Skaflestad
d52180389b Merge pull request #1631 from atgeirr/add-missing-include
Add missing header inclusion.
2020-03-23 19:04:36 +01:00
Atgeirr Flø Rasmussen
4a88b87958 Merge pull request #1626 from totto82/fixGuideRat
fix bug in guiderate model
2020-03-23 17:51:10 +01:00
Atgeirr Flø Rasmussen
0b0fab781b Add missing header inclusion. 2020-03-23 17:49:43 +01:00
Torbjørn Skille
9d24f0dc34 replacing long int and unsigned long int
- long int -> int64_t
  - unsigned long int -> uint64_t

All EclIO classes and associated tests has been updated.
2020-03-23 17:12:56 +01:00
Bård Skaflestad
6cf4b7efc7 Merge pull request #1624 from atgeirr/fix-narrowing
Compile-error fix: do not narrow double->bool in init list.
2020-03-23 16:30:17 +01:00
Joakim Hove
1192830c60 Initialize global index when creating connections from rst file 2020-03-23 16:08:49 +01:00
Tor Harald Sandve
41ae6b0bc4 fix bug in guideratemodel 2020-03-23 15:30:51 +01:00
Arne Morten Kvarving
0a8a25d5df Merge pull request #1622 from joakim-hove/include-hpp
Include hpp files and not cpp files
2020-03-23 14:50:33 +01:00
Atgeirr Flø Rasmussen
2805f862db Compile-error fix: do not narrow double->bool in init list. 2020-03-23 14:34:27 +01:00
Joakim Hove
02a5501c0b Add method out::Well::find_connection(std::size_t global_index) 2020-03-23 13:43:50 +01:00
Joakim Hove
a61c48521a Include hpp files and not cpp files 2020-03-23 13:28:47 +01:00
Joakim Hove
f88d382172 Merge pull request #1615 from joakim-hove/connection-testing
Connection testing
2020-03-23 13:00:06 +01:00
Arne Morten Kvarving
0a9a0285dc Merge pull request #1621 from akva2/move_ser_object
move data serialization objects close to the class code
2020-03-23 12:40:30 +01:00
Arne Morten Kvarving
e9e69ca44f Merge pull request #1607 from tskille/latest_pybind_eclio
Python bindings for EclIO classes
2020-03-23 12:05:55 +01:00
Arne Morten Kvarving
e3bd1e6723 add static method to return a test object for serialization
this allows killing the constructors taking member values
2020-03-23 10:58:15 +01:00
Torbjørn Skille
c33372b8b4 Adding python bindings for C++ class EclOutput 2020-03-23 10:57:49 +01:00
Torbjørn Skille
1a39c07981 Adding python bindings for C++ class ERft 2020-03-23 10:57:49 +01:00
Torbjørn Skille
d258ce5a57 Updates of C++ class ERft to be used with python bindings
-> Support for extracting data based on report index
  -> adding extra float (time) to RftReportList
2020-03-23 10:57:49 +01:00
Torbjørn Skille
b992ff0e1c Adding python bindings for C++ class EGrid 2020-03-23 10:57:49 +01:00
Torbjørn Skille
f97dfda92e Adding python bindings for C++ class ESmry 2020-03-23 10:57:49 +01:00
Torbjørn Skille
931fa96a59 Updates of C++ class ESmry to be used with python bindings
-> adding member function ESmry::get_startdat(), start of simulation from keyword STARTDAT in SMSPEC file
  -> adding member function ESmry::numberOfTimeSteps(), number of timesteps in run
2020-03-23 10:57:49 +01:00
Torbjørn Skille
c1caf4738e Adding python bindings for C++ class ERst
-> one additional C++ member function ERst::numberOfReportSteps()
2020-03-23 10:57:44 +01:00
Bård Skaflestad
c3c6c93f65 Merge pull request #1619 from joakim-hove/use-reference
Use reference
2020-03-23 10:49:36 +01:00
Joakim Hove
d1527da245 Use reference when accessing Schedule actions 2020-03-23 08:52:02 +01:00
Joakim Hove
8a420d30e6 Remove trailing whitespace 2020-03-23 08:52:02 +01:00
Bård Skaflestad
3bc8f832d8 Merge pull request #1618 from bska/add-missing-header
Parser.cpp: Include Missing Header
2020-03-22 18:02:47 +01:00
Bård Skaflestad
e7324ccd95 Parser.cpp: Include Missing Header
The implementation uses std::stack and therefore needs a declaration
of this type in scope.  This apparently built by accident earlier.
While here, also include a few other headers to make Parser.[hc]pp
more self-contained.
2020-03-22 17:06:38 +01:00
Bård Skaflestad
01d6ad95e0 Merge pull request #1617 from bska/summary-wmctl
Support Outputting Active Well Control to Summary File
2020-03-21 14:30:25 +01:00
Bård Skaflestad
f2e848bb5d Restart File: Reimplement Active Well Control Output Code
Switch to using the same backend that is also used for outputting
the equivalent value to the 'WMCTL' summary vector.
2020-03-20 22:07:32 +01:00
Bård Skaflestad
2f8ad86afd Summary Output: Implement 'WMCTL' Keyword
This outputs a numeric code, an integer value, for all configured
wells at all times and enables more visual inspection of how the
wells' active controls change over time--either in response to
explicit target modes in the input or as a result of limits becoming
active.

Note that due to the fall-back option of selecting the input value
if no dynamic value is available, we must ensure that the test code
does not specify well types (producer/injector) that conflict with
the keywords used in the backing data set.  Update the relevant
tests accordingly.
2020-03-20 22:07:32 +01:00
Bård Skaflestad
45b501cb83 Summary Config: Recognize 'WMCTL' Keyword
This would previously be interpreted as a completion keyword due to
matching the pattern 'W*L'.
2020-03-20 22:07:32 +01:00
Bård Skaflestad
8d2cc14ad0 Active Well Control Output: Place Duplicate Implementation in Well
Will become shared backend for output to restart and summary files.
Add unit tests to exercise the new functions.
2020-03-20 22:07:04 +01:00
Joakim Hove
4e2dae298f Merge pull request #1593 from joakim-hove/internalize-pyaction
Internalize pyaction
2020-03-20 18:38:29 +01:00
Joakim Hove
81b70de140 Add serializer support for PyAction 2020-03-20 17:15:53 +01:00
Joakim Hove
d2af97b1b2 Internalize PYACTION keywords while parsing Schedule 2020-03-20 16:59:50 +01:00
Joakim Hove
9632eae663 Add PyAction container to Actions class 2020-03-20 16:59:50 +01:00
Joakim Hove
c7f6b22bdf Add static method bool Python::enabled() 2020-03-20 16:59:50 +01:00
Joakim Hove
d06a5a78e0 Moved PyAction class into Action:: namespace 2020-03-20 16:59:50 +01:00
Joakim Hove
7852203d39 PYACTION: The actual python code is in an external file
With this commit the PYACTION keyword is changed, instead of embedding the
Python code directly in the .DATA file the keyword now points to an external
file which is loaded verbatim into the PyAction keyword.

In addition the PYACTION keyword has now got a name and a string indicating how
many times it should run.
2020-03-20 16:59:50 +01:00
Joakim Hove
db72ff80ed Use template Deck::count() in opmpack IMPORT handler 2020-03-20 16:59:50 +01:00
Joakim Hove
6e5cd6c371 Add templated method Deck::count() 2020-03-20 16:59:50 +01:00
Williham Williham Totland
2c74b0961d Removes various minor edits. 2020-03-20 15:34:14 +01:00
Williham Williham Totland
ab71b43f10 Fixes minor formatting glitch in the SummaryNode copyright statement. 2020-03-20 14:48:32 +01:00
Williham Williham Totland
fb4f026c97 Uses correct name in reference to enum value. 2020-03-20 14:27:08 +01:00
Williham Williham Totland
f884c90745 Refactors out duplicated code. 2020-03-20 14:21:18 +01:00
Williham Williham Totland
06eeae89e6 Reworks mode vectors for Opm::EclIO::SummaryNode. 2020-03-20 14:12:06 +01:00
Williham Williham Totland
eba0f3dcde Relocates new test in CMakeLists_files.cmake. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
89fe3c3d15 Reworks Evaluator::Factory for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
327fe79c90 Adds Opm::EclIO::SummaryNode::is_user_defined(). 2020-03-20 14:08:03 +01:00
Williham Williham Totland
62983db22f Removes use of default: 2020-03-20 14:08:03 +01:00
Williham Williham Totland
99375eb5be Reworks requiredRestartVectors for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
35afdd5131 Reworks ::requiredSegmentVectors() for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
21e9c1b952 Implements the change to SummaryNode in ::Evaluator. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
a6a144a5be Review action: Removes default: cases. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
318ca70a0b Uses the correct names for enum values. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
fda69e9d57 Review action: Reverts a number of changes at the request of @bska. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
0174a16386 Reworks EfficiencyFactor::setFactors for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
6970158f7f Makes the return value of Opm::Group::flow_group/::control_group optional. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
701175c776 Makes fallthrough explicit. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
bb114b6a55 Renames enum access name. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
855b23aa1b Minor formatting tweak. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
e500fbbbca Reworks ::find_wells for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
b12397c68e Minor formatting tweak. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
cb0f27c719 Reworks ::updateValue for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
b940d81aed Rewrites ::need_wells() for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
001877df2b Simplifies namespace declaration. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
84c57ff37b Review Action: Renames Opm::EclIO::SummaryNode::name => wgname 2020-03-20 14:08:03 +01:00
Williham Williham Totland
4bb453dd14 Adds a test for Opm::EclIO::SummaryNode::unique_key() 2020-03-20 14:08:03 +01:00
Williham Williham Totland
d9e1d397d6 Fixes order of accumulation for key parts. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
c3de96b1f4 Makes fallthrough explicit. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
dbf17af4a7 Minor formatting tweaks. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
861c098912 Implements Opm::EclIO::SummaryNode::unique_key(). 2020-03-20 14:08:03 +01:00
Williham Williham Totland
0265b7fb46 Renames variables for clarity. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
90a2eeb7fc Reworks to unified initialisation. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
e317b9663a Removes extraneous type. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
e5e0a49e89 Adds conversion operator SummaryConfigNode => SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
3af0bbf3cb Removes extraneous names. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
402f28f749 Adds Opm::EclIO::SummaryNode::Type::Mode. 2020-03-20 14:08:03 +01:00
Arne Morten Kvarving
c57af82c52 Merge pull request #1616 from akva2/fix_dynmap
fixed: make a two-param map template for splitDynMap
2020-03-20 14:06:50 +01:00
Arne Morten Kvarving
f0a25e4cf3 fixed: make a two-param map template for splitDynMap
gcc is more forgiving with default template parameters than clang.
2020-03-20 12:42:30 +01:00
Joakim Hove
49bd6e9bd7 Use 'real' connections when creating test data 2020-03-20 11:13:05 +01:00
Joakim Hove
c97ff53a51 White space/reformatting in test code 2020-03-20 11:01:08 +01:00
Joakim Hove
438e4b68bf Merge pull request #1612 from joakim-hove/connection-global-index
Add global_index to Connections
2020-03-20 09:08:49 +01:00
Joakim Hove
f87369713b Add global_index to Connections 2020-03-19 22:14:06 +01:00
Joakim Hove
25e31a95ca Merge pull request #1611 from joakim-hove/aggregate-connections-rename
Minor refactoring for improved readability
2020-03-19 22:05:07 +01:00
Joakim Hove
7a6208a66a Minor refactoring for improved readability 2020-03-19 16:53:57 +01:00
Bård Skaflestad
4b85366d7e Merge pull request #1592 from jalvestad/opm_data_Groups
Changes in opm-common for current Production/Injection Group Control parameters
2020-03-19 16:53:07 +01:00
Torbjørn Skille
059f2fba57 Update of python bindings for EclFile
-> two extra overloads for getting (array name + array name, occurrence)
   -> extra member function count(std::string), count occurrences of arrays with a specific name.
2020-03-19 15:57:39 +01:00
Arne Morten Kvarving
ae858182eb Merge pull request #1605 from akva2/serialize_internal_schedule
Internal serialization in Schedule
2020-03-19 12:53:00 +01:00
Arne Morten Kvarving
524b180102 update UDQConfig serialization
to avoid the need for OPM defined types in underlying
serializer
2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
63cbf052d6 update TransMult serialization
to avoid the need for OPM defined types in underlying
serializer
2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
66a4d1119d add serialization template to VFPProdTable 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
4d7d3b0e7c add serialization template to VFPInjTable 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
e4e853065c remove accessors in Group added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
5304b0ce2b add serialization template to Group 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
21e5d975e8 add serialization template to GroupProductionProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
a87ec3ad46 add serialization template to GroupInjectionProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
12889a675d remove accessors in IOrderSet added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
d25220ba4e add serialization template to IOrderSet 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
6100e1f572 remove accessors in Well added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
91bd6edd87 add serialization template to Well 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
0a4bb79b4a changed: use shared_ptr to mutable references
const refs are incompatible with serialization
2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
0a45fd4da6 add serialization template to WellType 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
2a3b3e3e73 remove accessors in WellSegments added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
815526a4a8 add serialization template to WellSegments 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
7c298d0891 remove accessors in Segment added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
117682d211 add serialization template to Segment 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
a6f546a87a add serialization template to Valve 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
335eb8c5e1 add serialization template to SpiralICD 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
dcbde5ea53 add serialization template to WellInjectionProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
b045048e73 remove accessors in WellProductionProperties added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9fb608fd0d add serialization template to WellProductionProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
6079e1d261 remove accessors in WellConnections added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
39034dabe4 add serialization template to WellConnections 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
b9e745f3e5 add serialization template to Connection 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
689420f85a remove accessors in WellTracerProperties added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
f271d75063 add serialization template to WellTracerProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
a6053d7817 add serialization template to WellBrineProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9c1c9f9e29 add serialization template to WellPolymerProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
4d0672d31a add serialization template to WellFoamProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
7e817e7d26 add serialization template to WellEconProductionLimits 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
a4274c4b1a add serialization template to WellGuideRate 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
dc6f4291d8 refactor DynamicState split methods for reuse
friend class Schedule so it can call them.
2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
ea45dcb01a remove accessors in Deck added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
461e24209d add serialization template to Deck 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
6519429291 remove accessors in Actions added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
91d62c63a1 add serialization template to Actions 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
f8cb4a80ff remove accessors in ActionAST added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9cd1403b33 add serialization template to ActionAST 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
8ad0111ded remove accessors in ActionX added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
e0a02e893a add serialization template to ActionX 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
3ea3fb4f8f add serialization template to Action::Condition 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
aa33b4c7c1 add serialization template to Action::Quantity 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9e37416447 remove accessors in DeckKeyword added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
ae55a7f4d1 add serialization template to DeckKeyword 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
902fd38eb2 add serialization template to Location 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
c88e586993 remove accessors in DeckRecord added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
afa466771b add serialization template to DeckRecord 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
5abfb155fb remove accessors in ASTNode added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
dc142f9f43 add serialization template to ASTNode 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
c1f5635210 remove accessors in DeckItem added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
40b230473c add serialization template to DeckItem 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
ac5d8817bc use serializer for global_whistctl_mode 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
422509d201 remove accessors in GConSump added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
f61da6684d add serialization template to GConSump 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
21ba0ad213 remove accessors in GConSale added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
bfc44df84f add serialization template to GConSale 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
0f31e76ae7 remove accessors in UnitSystem added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
977e1ce1d4 add serialization template to UnitSystem 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
1573687264 refactor: put copy-pasted switch in separate member function for reuse 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9dc0761550 remove accessors in GuideRateConfig added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
a7c9ca900c add serialization template to GuideRateConfig 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
79263a74c4 remove accessors in GuideRateModel added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
f9aa3ee3d4 add serialization template to GuideRateModel 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
25a90bae6e add serialization template to UDAValue 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
27bfe63146 remove accessors in Dimension added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
82ade7e7e1 add serialization template to Dimension 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
78c15009e0 remove accessors in WListManager added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
eb05ba503d add serialization template to WListManager 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
2fd1170cd1 remove accessors in WellTestConfig added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
dadd5b59d6 add serialization template to WellTestConfig 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
64b21c2f96 use serializer.isSerializing() for clarity 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
4b7801ba84 remove accessors in MessageLimits added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
48eee807f7 add serialization template to MessageLimits 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
a89a669d20 add serialization template to Tuning 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
26006cc317 remove accessors in Events added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
abc73b341e add serialization template to Events 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
86b003dfad remove accessors in DynamicVector added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
1b1120646f add serialization template to DynamicVector 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9b7c057c22 remove accessors in OilVaporizationProperties added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9bb8350586 add serialization template to OilVaporizationProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
aa9810f1ca use serializer for nupcol 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
19df064ce3 remove accessors in RFTConfig added for external serialization 2020-03-19 09:33:57 +01:00
Arne Morten Kvarving
276a65f232 add serialization template to RFTConfig 2020-03-19 09:26:03 +01:00
Arne Morten Kvarving
d626e16623 remove accessors in RestartConfig added for external serialization 2020-03-19 09:26:03 +01:00
Arne Morten Kvarving
ad32950271 add serialization template to RestartConfig 2020-03-19 09:26:03 +01:00
Arne Morten Kvarving
0a5c8a883d add bool parameter for non-complex type in DynamicState serialization 2020-03-19 09:26:03 +01:00
Arne Morten Kvarving
d076a18b85 add serialization template to TimeMap 2020-03-19 09:26:03 +01:00
Arne Morten Kvarving
1a745ddaa0 add serialization template to TimeStampUTC 2020-03-19 09:26:03 +01:00
Joakim Hove
b021e42f94 Merge pull request #1603 from joakim-hove/remove-num-removed
Remove num removed
2020-03-19 09:20:32 +01:00
Bård Skaflestad
f615f9270b Merge pull request #1599 from GitPaean/adding_some_connection_summary_keywords
adding a few connection summary keywords
2020-03-18 15:59:19 +01:00
Joakim Hove
b0e0b71964 Remove numRemoved member from WellConnections 2020-03-18 15:46:34 +01:00
Joakim Hove
447b625362 Merge pull request #1602 from joakim-hove/wellconnections-ordering
Move Connection::Order member from Well to WellConnections
2020-03-18 15:37:46 +01:00
Joakim Hove
acd73b76ea Remove unused method WellConnections::inputSize() 2020-03-18 15:36:17 +01:00
Torbjørn Skille
7699810f61 EclFile new member function count(std::string) which return number of arrays with a specific name 2020-03-18 14:56:49 +01:00
Joakim Hove
96d2cd59b3 Move Connection::Order member from Well to WellConnections 2020-03-18 14:28:53 +01:00
Jostein Alvestad
a4d3ec33f1 correction to buffer.write in opm/data/Groups 2020-03-18 14:13:05 +01:00
Kai Bao
1369a3509a adding a few connection summary keywords
COFR CWFR CGFR CWCT CGOR
2020-03-18 13:19:33 +01:00
Jostein Alvestad
51e3fac6b0 added tests/UDQ_ACTIONX_TEST1_U.DATA 2020-03-18 13:18:42 +01:00
Joakim Hove
4a2ccf3170 Merge pull request #1598 from joakim-hove/top-segment
Add method WellSegments::topSegment()
2020-03-17 14:59:11 +01:00
Arne Morten Kvarving
3f4ff89b01 Merge pull request #1597 from akva2/serialize_internal_eclstate_part5
Internal serialization in EclipseState - part 5
2020-03-17 13:59:03 +01:00
Joakim Hove
d27f537097 Add method WellSegments::topSegment() 2020-03-17 12:41:34 +01:00
Joakim Hove
11be4ef2a4 Merge pull request #1596 from joakim-hove/use-update-ref-depth
Use Well::updateRefDepth() in Well::updateSegments()
2020-03-17 12:31:47 +01:00
Arne Morten Kvarving
7b446b4d89 add serialization template to TableManager 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
08b7486597 add serialization template to Aqudims 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
641631d991 remove accessors in TableSchema added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
83f78c5918 add serialization template to TableSchema 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
6b18822c47 add serialization template to TableContainer 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
3575f88ee8 remove accessors in TableColumn added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
afd12dc1bd add serialization template to TableColumn 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
86ea1b8400 add serialization template to StandardCond 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
c5694f5d80 add serialization template to SolventDensityTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
6bbf72bba8 remove setter in SkpropolyTable added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
a80c5ffad3 add serialization template to SkprpolyTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
b0cd4e1c30 remove accessors in SimpleTable added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
a9fbd6b5b7 add serialization template to SimpleTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
17995453f4 remove accessors in RocktabTable added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
dd4336e72c add serialization template to RocktabTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
1f7d85d488 remove accessors in Rock2dtrTable added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
d7b6b282ca add serialization template to Rock2dtrTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
5090547a63 remove accessors in Rock2dTable added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
f36ebaec48 add serialization template to Rock2dTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
0b53169aff add serialization template to Regdims 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
199fc65bce remove accessors in PvtxTable added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
2dd91531ff add serialization template to PvtxTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
3a181e1f08 add serialization template to PvtwsaltTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
2340a2a1ea add serialization template to PolyInjTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
8aee2cedbc add serialization template to PlyshlogTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
bf1cbf1fed add serialization template to JFunc 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
5f67172a9c add serialization template to FlatTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
86090e0325 add serialization template to Eqldims 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
ae6b05777b add serialization template to DenT 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
248f8881f4 remove accessors in ColumnSchema added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
8c2ab633a2 add serialization template to ColumnSchema 2020-03-17 12:05:16 +01:00
Arne Morten Kvarving
09ddcfa0eb add serialization template to BrineDensityTable 2020-03-17 12:05:16 +01:00
Arne Morten Kvarving
eb91ba370b add serialization template to AquiferConfig 2020-03-17 12:05:16 +01:00
Arne Morten Kvarving
5d9605bc17 add serialization template to Aquifetp 2020-03-17 12:05:16 +01:00
Arne Morten Kvarving
e47723dbdc add serialization template to AquiferCT 2020-03-17 12:05:16 +01:00
Arne Morten Kvarving
2e5573e814 add serialization template to Aquancon 2020-03-17 12:05:16 +01:00
Joakim Hove
86b85aca01 Use Well::updateRefDepth() in Well::updateSegments() 2020-03-17 11:30:22 +01:00
Arne Morten Kvarving
ab50b48b42 Merge pull request #1579 from akva2/serialize_internal_eclstate_part4
Internal serialization in EclipseState - part 4
2020-03-17 10:38:40 +01:00
Joakim Hove
c0e328fd65 Merge pull request #1587 from tskille/eclio_huge_arrays
Adding support for larger EclFile arrays
2020-03-17 09:12:00 +01:00
Joakim Hove
0e8c5faba9 Merge pull request #1594 from joakim-hove/wellsegments-iter
Add begin() and end() iterators to WellSegments class
2020-03-17 09:10:54 +01:00
Arne Morten Kvarving
0a8c62ba3f remove accessors in UDQConfig added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
c04dff98bf add serialization template to UDQConfig 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
8bf05d9ba7 add serialization template for UDQIndex 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
6c19c2e8bb remove accessors in UDQDefine added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
76da13ba12 add serialization template to UDQDefine 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
657b265f0a remove accessors in UDQAssign added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
921daec3e7 add serialization template to UDQAssign 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
bf59ac6d33 remove accessors in UDQActive added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
9e291c34be add serialization template to UDQActive 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
d59fd93563 remove accessors in UDQASTNode added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
7f1d0c40f9 add serialization template to UDQASTNode 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
6a7560beaa add serialization template to DynamicState 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
69f20d9125 add serialization template to Runspec 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
e895fc05a6 add serialization template to SatFuncControls 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
eb1e71b625 add serialization template to Actdims 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
4275feee3c add serialization template to EclHysterConfig 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
ca205a1f5d add serialization template to UDQParams 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
0a69ecf663 add serialization template to WellSegmentDims 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
93b2127a8b add serialization template to Welldims 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
44219ac24e remove accessor in EndpointScaling added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
c230e4d7b7 add serialization template to EndpointScaling 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
badb934039 add serialization template to Tabdims 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
84820fc147 remove accessor in Phases added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
afa9f61219 add serialization template to Phases 2020-03-17 08:28:18 +01:00
Torbjørn Skille
e3ae38feb9 Adding support for large arrays using X231 format extension
- EclIO classes have been updated to support arrays with size beyond numeric limits for integers
- Output of arrays having 2^31 or more elements is facilitated by using a pair of headers
- The first header is of type X231, second should have the actual type
- The large array format extension is documented in the Eclipse File format manual
2020-03-16 18:58:25 +01:00
Joakim Hove
37a37d2f12 Add begin() and end() iterators to WellSegments class 2020-03-16 17:28:08 +01:00
Joakim Hove
969bfe976c Merge pull request #1584 from joakim-hove/msw-rst-test
Msw rst test
2020-03-16 16:10:25 +01:00
Jostein Alvestad
82ea605cb8 removed default initialization for template group_control 2020-03-16 15:29:08 +01:00
Jostein Alvestad
6479391903 additional changes to add tests 2020-03-16 14:28:37 +01:00
Arne Morten Kvarving
704717950d Merge pull request #1578 from akva2/serialize_internal_eclstate_part3
Internal serialization in EclipseState - part 3
2020-03-16 14:21:36 +01:00
Jostein Alvestad
e77a2c7816 Added SummaryConfig.hpp 2020-03-16 14:04:04 +01:00
Jostein Alvestad
68ac742f17 further changes for opm-data Groups 2020-03-16 13:51:05 +01:00
Jostein Alvestad
a18439bbcc intital changes for adding opm/output/data/Groups 2020-03-16 13:35:25 +01:00
Joakim Hove
db015638f8 Merge pull request #1590 from joakim-hove/python-include-fix
Fix incorrect #include
2020-03-16 13:02:03 +01:00
Arne Morten Kvarving
4ea63cdba7 add serialization template to EclipseConfig 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
ff8cfcd7d1 remove accessors in IOConfig added for external serialization 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
58b7f8cd45 add serialization template to IOConfig 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
62a49dceb1 add serialization template to InitConfig 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
3362831db4 remove accessor in FoamConfig added for external serialization 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
044b82459f add serialization template to FoamConfig 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
d569225cc8 add serialization template to FoamData 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
70b8fe0899 remove accessor in Equil added for external serialization 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
44e9dc1a7c add serialization template to Equil 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
18a263f3bc add serialization template to EquilRecord 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
eed3811f45 Merge pull request #1573 from akva2/serialize_internal_eclstate_part2
Internal serialization in EclipseState - part 2
2020-03-16 12:58:26 +01:00
Joakim Hove
7b1a165d4b Merge pull request #1589 from joakim-hove/set-code-end
Remove #if 0 code block
2020-03-16 11:52:51 +01:00
Arne Morten Kvarving
3b92d5dc26 remove accessor in FaultCollection added for external serialization 2020-03-16 11:43:30 +01:00
Arne Morten Kvarving
8e00b911e2 add serialization template to FaultCollection 2020-03-16 11:43:30 +01:00
Arne Morten Kvarving
3957b528f6 remove accessor in Fault added for external serialization 2020-03-16 11:43:30 +01:00
Arne Morten Kvarving
8806d4e14c add serialization template to Fault 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
c822ae8a88 remove accessor in FaultFace added for external serialization 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
a8ce3ebdcc add serialization template to FaultFace 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
55c9822c1c add serialization template to OrderedMap 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
f74aa2db07 remove accessors in TransMult added for external serialization 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
cf9b9cf64c add serialization template to TransMult 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
ed0ed133a2 remove accessors in MULTREGTScanner added for external serialization
and make the serialization-friendly getSearchMap() private
2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
e4465fc31c add serialization template to MULTREGTScanner 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
037620d83f Merge pull request #1568 from akva2/serialize_internal_eclstate_part1
Internal serialization in EclipseState - part 1
2020-03-16 11:42:51 +01:00
Joakim Hove
928a9be5db Fix incorrect #include 2020-03-16 11:41:09 +01:00
Arne Morten Kvarving
9e804f36e5 add serialization template to SimulationConfig 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
8569274c01 add serialization template to RockConfig 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
561518317b add serialization templates to BCConfig 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
10e3e5c998 remove accessors added to ThresholdPressure for external serialization 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
31a53f2ec5 add serialization template to ThresholdPressure 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
2419bb8d6a add serialization template to GridDims 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
7767a8b2b5 add serialization template to NNC and EDITNNC 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
62caad82a3 Merge pull request #1565 from akva2/serializer_schedule
Add serialization template to Schedule
2020-03-16 10:48:31 +01:00
Arne Morten Kvarving
e41919c6f5 remove accessors added for external serialization support 2020-03-16 10:47:11 +01:00
Arne Morten Kvarving
26b2a3a554 add serialization template to Schedule 2020-03-16 10:47:11 +01:00
Joakim Hove
b274561f07 Remove #if 0 code block 2020-03-16 09:54:22 +01:00
Joakim Hove
89479c5c75 Merge pull request #1588 from joakim-hove/remove-dead-code
Remove #if 0 code block
2020-03-16 09:46:09 +01:00
Joakim Hove
544621e646 Remove #if 0 code block 2020-03-16 09:06:35 +01:00
Joakim Hove
d79aadece0 Add msw based restart testing (currently disabled) 2020-03-14 09:15:51 +01:00
Joakim Hove
3c4a6a41f2 Add testdata for MSW based restart testing 2020-03-14 09:15:31 +01:00
Joakim Hove
47abe3cde9 Merge pull request #1583 from joakim-hove/rst-msw-initII
Rst msw init ii
2020-03-13 18:54:06 +01:00
Joakim Hove
d3ef0fd795 Merge pull request #1582 from wito/rename-summarynode
Rename SummaryNode to SummaryConfigNode
2020-03-13 16:53:38 +01:00
Joakim Hove
9967b38b16 Check defaulted value when initializing drainage_radius from SWEL 2020-03-13 16:05:16 +01:00
Joakim Hove
bed8d5fd04 Recognize +/- 1e20 as defaulted value in SWEL 2020-03-13 16:04:47 +01:00
Joakim Hove
ce68078963 Include connection insert index in Schedule::cmp 2020-03-13 16:03:49 +01:00
Joakim Hove
7e88f4b4c2 Merge pull request #1576 from joakim-hove/rst-msw-init
Rst msw init
2020-03-13 15:45:18 +01:00
Williham Williham Totland
4101d51ce5 Alphabetises includes. 2020-03-13 15:40:41 +01:00
Williham Williham Totland
ec2cd2f9eb Audits forward declarations. 2020-03-13 15:40:41 +01:00
Williham Williham Totland
fb7d4315c9 Renames Opm::SummaryNode to Opm::SummaryConfigNode. 2020-03-13 15:40:41 +01:00
Arne Morten Kvarving
939648e833 Merge pull request #1567 from akva2/serialize_summarynode
add serialization template to SummaryNode
2020-03-13 15:32:48 +01:00
Joakim Hove
0457a33f3c Merge pull request #1580 from wito/forward-declaration-fix
Minifix: Fixes forward declaration compiler warnings
2020-03-13 15:30:53 +01:00
Joakim Hove
23eda37c0a Make sure property Connection::r0 is initialized 2020-03-13 15:06:23 +01:00
Joakim Hove
f7b2e70282 Merge pull request #1577 from wito/summary-units
Adding support for inspecting units to Opm::EclIO::ESmry
2020-03-13 13:52:15 +01:00
Williham Williham Totland
5736111cf5 Resolves an issue where two structrs were forward declared as classes. 2020-03-13 13:49:03 +01:00
Williham Williham Totland
dddd45cec8 Simplifies name. 2020-03-13 12:35:17 +01:00
Williham Williham Totland
604c8a1169 Makes a number of variables const. 2020-03-13 12:34:47 +01:00
Joakim Hove
fb54272d6f Schedule::cmp - compare TimeMap 2020-03-13 12:18:08 +01:00
Joakim Hove
4d01b85e99 Add operator<< support for TimeMap 2020-03-13 12:17:41 +01:00
Joakim Hove
d53826ed28 Add small static function inverse_peaceman 2020-03-13 12:16:51 +01:00
Williham Williham Totland
916516db60 Rename variable for clarity. 2020-03-13 12:13:40 +01:00
Williham Williham Totland
1c29886ec0 Audits includes. 2020-03-13 12:05:40 +01:00
Joakim Hove
47ff1fc297 Merge pull request #1575 from joakim-hove/rst-testing
Add integration test for restart based Schedule init
2020-03-13 12:03:35 +01:00
Williham Williham Totland
7297a9736a Implements Opm::EclIO::ESmry::get_unit. 2020-03-13 11:55:43 +01:00
Joakim Hove
4433731079 Merge pull request #1566 from wito/rsm-testing
Adding support for the RUNSUM keyword in Opm::SummaryConfig
2020-03-13 11:16:30 +01:00
Williham Williham Totland
af61d58606 Removes trailing whitespace. 2020-03-13 10:39:53 +01:00
Williham Williham Totland
46abd74eba Adds stub for Opm::EclIO::ESmry::get_unit 2020-03-13 10:36:49 +01:00
Joakim Hove
6e7f8e4009 Add integration test for restart based Schedule init 2020-03-13 10:22:43 +01:00
Joakim Hove
acc8a5bc36 Merge pull request #1571 from joakim-hove/rst-schedule-III
Initialize Schedule from restart file
2020-03-13 10:20:03 +01:00
Williham Williham Totland
67f3d31254 Makes RPTONLY a processing instruction. 2020-03-13 10:02:48 +01:00
Williham Williham Totland
d5c4487808 Implements support for RUNSUM-related keywords NARROW and SEPARATE 2020-03-13 09:15:46 +01:00
Joakim Hove
edf01bdcda Initialize Schedule from restart file 2020-03-13 09:09:25 +01:00
Joakim Hove
952965ee07 Merge pull request #1570 from joakim-hove/schedule-cmp
Add context aware Schedule::cmp() function
2020-03-13 09:02:45 +01:00
Joakim Hove
191c50173a Add context aware Schedule::cmp() function 2020-03-13 08:03:36 +01:00
Williham Williham Totland
0910e55be7 Changes Opm::SummaryConfig::createRunSummary to be backed by a field. 2020-03-13 07:45:52 +01:00
Joakim Hove
e9bbab8b0d Merge pull request #1569 from joakim-hove/rst-schedule-parts
Rst schedule parts
2020-03-12 21:05:33 +01:00
Joakim Hove
a28f146d71 Add Well constructor based on restart well 2020-03-12 20:09:09 +01:00
Joakim Hove
e1dbd72689 Remove const and use std::move() when updating internal shared ptr 2020-03-12 18:11:25 +01:00
Joakim Hove
23bdbe51f2 Add wtype, drainage_radius and efficiency_factor members to rst::well 2020-03-12 18:11:25 +01:00
Joakim Hove
bf00fec1f9 Add Connection constructor based on RestartIO::connection 2020-03-12 18:11:25 +01:00
Joakim Hove
03be91a951 Add members cf_kind, cf, skin_factor and r0 to rst::connection 2020-03-12 18:11:25 +01:00
Joakim Hove
ee5f311a04 RestartIO::state - use internal UnitSystem member 2020-03-12 17:47:41 +01:00
Joakim Hove
034656b9fb Remove test application rst_load 2020-03-12 17:41:08 +01:00
Joakim Hove
0fa1be6f54 Add accessor to in productionControls 2020-03-12 17:40:15 +01:00
Joakim Hove
c7695a7ac1 Moved declarations 2020-03-12 17:34:54 +01:00
Williham Totland
a270964846 Adds tests for swallowing RUNSUM keyword. 2020-03-12 14:59:31 +01:00
Williham Totland
eb921fefa9 Corrects variable name used in test. 2020-03-12 14:25:34 +01:00
Williham Totland
700a6720c4 Returns keyword sets to function-local static const. 2020-03-12 14:07:57 +01:00
Williham Totland
4c06edcb22 Unifies keyword_set searching. 2020-03-12 13:39:35 +01:00
Williham Totland
7da9d975d4 Rewrites .count() > 0 to more idiomatic .find() != .end(). 2020-03-12 13:24:42 +01:00
Joakim Hove
8342d78fa0 Merge pull request #1556 from joakim-hove/connection-segment-attach-bug
Fixed: do not update insert_index when linking segment -> connection
2020-03-12 12:56:04 +01:00
Joakim Hove
fcfed6e125 Merge pull request #1563 from atgeirr/add-has-method-guiderate
Add GuideRate::has() method.
2020-03-12 12:55:44 +01:00
Williham Totland
7b70c109ff Replaces "fall-through" comments with attributes.
In order to in future support compiling with -Wimplicit-fallthrough, the human-only comments indicating the switch case fallthroughs have been replaced with compiler-friendly [[fallthrough]] attributes.

For reference: https://en.cppreference.com/w/cpp/language/attributes/fallthrough
2020-03-12 12:36:50 +01:00
Williham Totland
6f83c4198c Review Action: Renames SummaryConfig::doRunSummary to SummaryConfig::createRunSummary 2020-03-12 12:23:09 +01:00
Williham Totland
36e91f5cff Implements SummaryConfig::doRunSummary() 2020-03-12 12:14:00 +01:00
Arne Morten Kvarving
f25f7e77f5 add serialization template to SummaryNode 2020-03-12 12:11:01 +01:00
Williham Totland
7f6518af5f Extracts udq_blacklist as searchable unordered set. 2020-03-12 11:37:08 +01:00
Williham Totland
c5af3afebd Corrects test after discussion. 2020-03-12 11:35:38 +01:00
Williham Totland
97e55c565d Extracts static const specialkw as static { const special_keywords }. 2020-03-12 11:10:38 +01:00
Joakim Hove
d5855edc55 Fixed: do not update insert_index when linking segment -> connection 2020-03-12 11:01:56 +01:00
Joakim Hove
82028ca20d Merge pull request #1564 from akva2/less_shared_ptr
changed: store Regdims and Eqldims as regular members, not shared ptrs
2020-03-12 11:00:46 +01:00
Williham Totland
fcc2e32d66 Renames runsum to doRunSummary, adds accessor. 2020-03-12 10:52:10 +01:00
Joakim Hove
60194fca04 Add test to ESmry for units 2020-03-12 09:41:43 +01:00
Joakim Hove
af3f1b83e2 Remove trailing whitespace 2020-03-12 09:41:43 +01:00
Joakim Hove
7a9c0171d1 Add test to check whether RSM output has been requested 2020-03-12 09:28:48 +01:00
Arne Morten Kvarving
c8c8ef006d changed: store Regdims and Eqldims as regular members, not shared ptrs 2020-03-12 08:53:36 +01:00
Bård Skaflestad
0ec72754dd Merge pull request #1555 from joakim-hove/connection-def-segment-zero
The numerical value 0 is used to signify no connection <-> segment
2020-03-11 14:14:17 -05:00
Bård Skaflestad
dce9a2222f Merge pull request #1562 from joakim-hove/segment-reorder-refactor
Segment reorder refactor
2020-03-11 13:43:34 -05:00
Bård Skaflestad
7732e42658 Merge pull request #1552 from akva2/eclstate_serialize
add serialization template to EclipseState
2020-03-11 12:12:49 -05:00
Joakim Hove
d79350f20a Merge pull request #1560 from joakim-hove/rawkeyword-cleanup
Remove unused file
2020-03-11 16:30:07 +01:00
Joakim Hove
96f22730ca Minor reformatting 2020-03-11 16:14:21 +01:00
Joakim Hove
af02d6620d Align code 2020-03-11 15:46:00 +01:00
Joakim Hove
472984233f Use Segment instance for outlet segment 2020-03-11 15:42:49 +01:00
Atgeirr Flø Rasmussen
ce930d0158 Add virtual destructor for EclipseState class. 2020-03-11 15:19:47 +01:00
Atgeirr Flø Rasmussen
be2337e2c1 Add GuideRate::has(). 2020-03-11 15:19:47 +01:00
Joakim Hove
9b1d045631 Add segmentOrder() overload to avoid dummy argument 2020-03-11 14:49:17 +01:00
Joakim Hove
83ace5c03e Remove unused file 2020-03-11 14:33:12 +01:00
Bård Skaflestad
683723aa56 Merge pull request #1558 from joakim-hove/segment-use-named-index
Use enum values to look up indices when assembling segment info
2020-03-11 08:08:41 -05:00
Joakim Hove
222e0e7699 Use named constants in ISEG init 2020-03-11 13:39:42 +01:00
Joakim Hove
61894b5c3a Use enum values to look up indices when assembling segment info 2020-03-11 11:45:08 +01:00
Joakim Hove
3cc78f2487 The numerical value 0 is used to signify no connection <-> segment 2020-03-11 08:11:22 +01:00
Bård Skaflestad
64206e1d9a Merge pull request #1549 from akva2/serializer_summaryconfig
add serialization template to SummaryConfig
2020-03-10 20:20:08 -05:00
Arne Morten Kvarving
35eb136986 Merge pull request #1554 from dr-robertk/PR/cmake-check-include-file
[bugfix][cmake] Fix FindParMETIS check
2020-03-10 15:36:05 +01:00
Robert Kloefkorn
8de70f9128 [bugfix][cmake] Fix FindParMETIS check by adding missing
include(CheckIncludeFile).
2020-03-10 15:33:29 +01:00
Bård Skaflestad
cb7e40345f Merge pull request #1550 from akva2/followup_stonetype
changed: relocate and rename StoneType enum
2020-03-10 07:57:26 -05:00
Arne Morten Kvarving
1da29f8bd8 add serialization template to EclipseState 2020-03-10 13:47:11 +01:00
Arne Morten Kvarving
6a2c036582 add serialization template to SummaryConfig
remove accessors that was only required for the external serialization
support
2020-03-10 13:09:08 +01:00
Arne Morten Kvarving
c2108265b3 Merge pull request #1548 from akva2/simplify_oilvap_equality
simplify the OilVaporization equality operator
2020-03-10 12:31:10 +01:00
Joakim Hove
e3600cfc19 Merge pull request #1551 from joakim-hove/opmpack-fix2
Fix opmpack copy_file option in the case of empty directories
2020-03-10 12:22:30 +01:00
Arne Morten Kvarving
9b22cab024 changed: relocate and rename StoneType enum
unfortunate naming, unfortunate location
2020-03-10 11:09:49 +01:00
Joakim Hove
02fd4ab340 Fix opmpack copy_file option in the case of empty directories 2020-03-10 11:03:45 +01:00
Arne Morten Kvarving
d945dee95b simplify the OilVaporization equality operator
in particular the UNDEF -> false condition causes issues
in user code.
2020-03-10 09:55:46 +01:00
Joakim Hove
b8a30805d3 Merge pull request #1547 from joakim-hove/update-binary-testdata
Update embedded testdata with more items in restart file
2020-03-09 19:13:00 +01:00
Joakim Hove
cab6e21df6 Update embedded testdata with more items in restart file 2020-03-09 17:55:50 +01:00
Joakim Hove
ed0018ac98 Merge pull request #1546 from joakim-hove/rst-small
Rst small
2020-03-09 16:56:30 +01:00
Joakim Hove
b9b7cdc801 Merge pull request #1544 from joakim-hove/restart-items
Restart items
2020-03-09 16:55:57 +01:00
Joakim Hove
2edb1f4621 Add Well::DrainageRadius and Well::EfficiencyFactor to restart file 2020-03-09 16:52:03 +01:00
Joakim Hove
34984de671 Merge pull request #1519 from joakim-hove/add-welltype-class
Add WellTypes class
2020-03-09 16:40:22 +01:00
Joakim Hove
d1e4b28ad2 Merge pull request #1545 from joakim-hove/jenkins-enable-simulator-python
jenkins: Enable building of Python extension in opm-simulators
2020-03-09 15:32:55 +01:00
Joakim Hove
46cba99cfb Completion number has correct offset in file 2020-03-09 15:14:28 +01:00
Joakim Hove
b46b50ed5f Add explicit to one argument constructor 2020-03-09 15:14:23 +01:00
Joakim Hove
094270d994 Loading restart: check defaulted rates against value 1e+20 2020-03-09 15:06:08 +01:00
Joakim Hove
915dc982e8 Add throw protection when trying to create Valve from restart file 2020-03-09 14:59:35 +01:00
Joakim Hove
39c96ac9de Add UnitSystem member to restart state 2020-03-09 14:59:30 +01:00
Joakim Hove
d056e8e97d jenkins: Enable building of Python extension in opm-simulators 2020-03-09 14:31:10 +01:00
Joakim Hove
0bb822b9b5 Use WellType when reading and writing restart file 2020-03-09 13:30:18 +01:00
Joakim Hove
327625b713 Use the WellType class in Well and Schedule 2020-03-09 13:30:18 +01:00
Joakim Hove
6e8b4a6c12 Add WellType class for ecl interop 2020-03-09 13:29:11 +01:00
Joakim Hove
51a593de39 Merge pull request #1532 from joakim-hove/uda-value-dim-constructor
Uda value dim constructor
2020-03-09 13:28:22 +01:00
Joakim Hove
2eceab522d Merge pull request #1541 from joakim-hove/rst-tuning
Rst tuning
2020-03-09 13:27:02 +01:00
Joakim Hove
ff3949a6ce Output Connection::SkinFactor to restart file 2020-03-09 12:18:41 +01:00
Arne Morten Kvarving
8f7eefcf2a Merge pull request #1543 from akva2/internalize_stonetype
internalize STONE|STONE1|STONE2
2020-03-09 11:21:32 +01:00
Arne Morten Kvarving
825eb34e8a internalize STONE|STONE1|STONE2 2020-03-09 09:54:10 +01:00
Joakim Hove
86768666ae Merge pull request #1542 from wito/extended-network-model-API
Separates Opm::Group::parent() for the extended network model
2020-03-06 17:05:34 +01:00
Joakim Hove
43ae6e6a0e Initialize Tuning object when loading from restart file 2020-03-06 15:52:28 +01:00
Joakim Hove
75b8c12090 Publish indices required to look up Tuning parameters from DOUBHEAD 2020-03-06 15:52:28 +01:00
Joakim Hove
884e5e820a Add missing #include<.../Units.hpp> 2020-03-06 15:52:28 +01:00
Williham Totland
13e838d171 Separates Opm::Group::parent() for the extended network model
In order to support the extended network model going forwards, the method Opm::Group::parent() is split in the API into two new methods, Opm::Group::control_group() and Opm::Group::flow_group(). These methods give the names of the parent node in the group control hierarchy and network structure, respectively.

While for the standard network model these two values will be the same (and the same as ::parent()), code that presently calls ::parent() should be revisited with an eye to the question of which parent group is desired.
2020-03-06 14:38:38 +01:00
Arne Morten Kvarving
9116f6410c Merge pull request #1539 from akva2/serialize_plyshlog_rocktab
Prepare serialization for PlyshlogTable and RocktabTable
2020-03-06 13:55:26 +01:00
Arne Morten Kvarving
f0f87bb4b5 Merge pull request #1540 from akva2/internalize_stone1ex
internalize STONE1EX
2020-03-06 13:52:43 +01:00
Arne Morten Kvarving
f9c3368fc2 internalize STONE1EX 2020-03-06 12:08:13 +01:00
Arne Morten Kvarving
0cb8eecaa6 changed: use regular shared ptrs in table container
ptrs to const is problematic for serialization support
2020-03-06 09:59:09 +01:00
Arne Morten Kvarving
7fe4c3b23d prepare RocktabTable for serialization 2020-03-06 09:59:09 +01:00
Arne Morten Kvarving
9b0203b517 prepare PlyshlogTable for serialization 2020-03-06 09:59:09 +01:00
Arne Morten Kvarving
e4433dfc2d Merge pull request #1537 from akva2/internaliz_shrate
Internalize SHRATE
2020-03-06 09:58:42 +01:00
Joakim Hove
74e53f2a22 Merge pull request #1538 from joakim-hove/rename-order-connections
Rename function WellConnections::orderConnections()
2020-03-05 20:14:09 +01:00
Joakim Hove
0b26ece3c4 Rename function WellConnections::orderConnections() 2020-03-05 16:00:56 +01:00
Arne Morten Kvarving
33ebaa8753 internalize SHRATE 2020-03-05 14:34:01 +01:00
Arne Morten Kvarving
ef1e6d5fd8 Revert "added: PolymerConfig class"
This reverts commit a984ca5beb.
2020-03-05 14:17:51 +01:00
Arne Morten Kvarving
0fe106176e Merge pull request #1536 from akva2/internalize_plyvmh
internalize PLYVMH
2020-03-05 14:15:11 +01:00
Arne Morten Kvarving
93615f53c5 internalize PLYVMH 2020-03-05 13:13:33 +01:00
Arne Morten Kvarving
d47a064c1c Merge pull request #1534 from akva2/internalize_plmixpar
internalize PLMIXPAR
2020-03-05 13:10:24 +01:00
Joakim Hove
8501a7ead4 Construct UDA values in WellInjectionProperties with correct unit 2020-03-05 13:08:00 +01:00
Joakim Hove
17ec37ae4e WellProductionProperties - init with correct UDA dimensions 2020-03-05 13:08:00 +01:00
Joakim Hove
ac79a7a1b1 Add UnitSystem::getDimension( measure ) method 2020-03-05 13:08:00 +01:00
Joakim Hove
4b0ee9d0bb Remove method Dimension::newComposite() 2020-03-05 13:08:00 +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
157d3e4279 Add UDAValue constructor which takes dimension 2020-03-05 13:08:00 +01:00
Joakim Hove
3c0c94ff71 Remove stale comment 2020-03-05 13:08:00 +01:00
Arne Morten Kvarving
b53bd27a08 Merge pull request #1535 from akva2/add_polymerconfig
added: PolymerConfig class
2020-03-05 13:02:57 +01:00
Arne Morten Kvarving
a984ca5beb added: PolymerConfig class 2020-03-05 11:54:22 +01:00
Arne Morten Kvarving
c52efaecd3 Merge pull request #1533 from akva2/foamconfig_fix
fixed: update FoamConfig defaults
2020-03-05 11:16:18 +01:00
Arne Morten Kvarving
a1708080c1 internalize PLMIXPAR 2020-03-05 11:07:18 +01:00
Arne Morten Kvarving
c8ff9503a2 fixed: update FoamConfig defaults
Foam cases should run without FOAMOPTS available. That means
we need to default the mobility model to a valid value.

This also adds enum value 'FUNC' and handles setting the default model
if only transport phase is unspecified.
2020-03-05 09:13:03 +01:00
Joakim Hove
c75421a73e Merge pull request #1531 from atgeirr/fix-missing-include
Add missing <string> include.
2020-03-04 14:22:26 +01:00
Atgeirr Flø Rasmussen
1cbb1ddaf7 Merge pull request #1530 from akva2/foam_config_change
changed: don't enforce foam model limits in parser
2020-03-04 14:18:32 +01:00
Atgeirr Flø Rasmussen
92eb721e85 Add missing <string> include. 2020-03-04 13:51:49 +01:00
Arne Morten Kvarving
26bd5fd4a0 changed: don't enforce foam model limits in parser 2020-03-04 10:53:20 +01:00
1543 changed files with 80682 additions and 13901 deletions

View File

@@ -53,6 +53,7 @@ endif()
# we cannot generate dune.module since it is read by dunecontrol before
# the build starts, so it makes sense to keep the data there then.
include (OpmInit)
OpmSetPolicies()
# Look for the opm-tests repository; if found the variable
# HAVE_OPM_TESTS will be set to true.
@@ -163,15 +164,17 @@ if (ENABLE_MOCKSIM)
add_executable(msim examples/msim.cpp)
target_link_libraries(msim mocksim)
set(_libs mocksim opmcommon
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
set(_libs mocksim opmcommon
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
foreach( test test_msim test_msim_ACTIONX )
opm_add_test(${test} SOURCES tests/msim/${test}.cpp
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests
CONDITION HAVE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND)
endforeach()
foreach( test test_msim test_msim_ACTIONX test_msim_EXIT)
opm_add_test(${test} SOURCES tests/msim/${test}.cpp
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests
CONDITION ${HAVE_ECL_INPUT})
endforeach()
endif()
endif()
# Build the compare utilities
@@ -190,7 +193,11 @@ if(ENABLE_ECL_INPUT)
test_util/summary.cpp
)
foreach(target compareECL convertECL summary)
add_executable(test_esmry_lod
test_util/test_esmry_lod.cpp
)
foreach(target compareECL convertECL summary test_esmry_lod)
target_link_libraries(${target} opmcommon)
install(TARGETS ${target} DESTINATION bin)
endforeach()
@@ -240,7 +247,11 @@ install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
if (OPM_ENABLE_PYTHON)
# -------------------------------------------------------------------------
# 1: Wrap C++ functionality in Python
set(PYTHON_PACKAGE_PATH "site-packages")
if (EXISTS "/etc/debian_version")
set(PYTHON_PACKAGE_PATH "dist-packages")
else()
set(PYTHON_PACKAGE_PATH "site-packages")
endif()
set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
make_directory(${PROJECT_BINARY_DIR}/python)
@@ -349,7 +360,7 @@ if (OPM_ENABLE_PYTHON)
# 2: Embed the Python interpreter for keywords like PYACTION and PYINPUT
if (OPM_ENABLE_EMBEDDED_PYTHON)
add_subdirectory(python/pybind11)
target_include_directories(opmcommon PRIVATE "python/pybind11/include;${PYTHON_INCLUDE_DIRS}")
target_include_directories(opmcommon SYSTEM PRIVATE "python/pybind11/include;${PYTHON_INCLUDE_DIRS}")
target_link_libraries(opmcommon PUBLIC ${PYTHON_LIBRARY})
add_definitions(-DEMBEDDED_PYTHON)

View File

@@ -41,6 +41,7 @@ list (APPEND MAIN_SOURCE_FILES
)
if(ENABLE_ECL_INPUT)
list(APPEND MAIN_SOURCE_FILES
src/opm/io/eclipse/SummaryNode.cpp
src/opm/json/JsonObject.cpp
src/opm/parser/eclipse/Deck/Deck.cpp
src/opm/parser/eclipse/Deck/DeckItem.cpp
@@ -51,6 +52,7 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/Deck/DeckSection.cpp
src/opm/parser/eclipse/Deck/UDAValue.cpp
src/opm/parser/eclipse/Python/Python.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp
src/opm/parser/eclipse/EclipseState/AquiferConfig.cpp
src/opm/parser/eclipse/EclipseState/AquiferCT.cpp
src/opm/parser/eclipse/EclipseState/Aquifetp.cpp
@@ -83,6 +85,7 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/IOConfig/IOConfig.cpp
src/opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.cpp
src/opm/parser/eclipse/EclipseState/Runspec.cpp
src/opm/parser/eclipse/EclipseState/TracerConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.cpp
@@ -93,7 +96,6 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionValue.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ASTNode.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/Condition.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Events.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/Group.cpp
@@ -114,6 +116,7 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Valve.cpp
src/opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/RFTConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/RPTConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.cpp
src/opm/parser/eclipse/EclipseState/Schedule/SummaryState.cpp
@@ -218,7 +221,10 @@ if(ENABLE_ECL_INPUT)
set_source_files_properties(${PYTHON_CXX_SOURCE_FILES} PROPERTIES COMPILE_FLAGS -Wno-shadow)
set_source_files_properties(src/opm/parser/eclipse/Python/PythonInterp.cpp PROPERTIES COMPILE_FLAGS -Wno-shadow)
set_source_files_properties(src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp PROPERTIES COMPILE_FLAGS -Wno-shadow)
list( APPEND MAIN_SOURCE_FILES src/opm/parser/eclipse/Python/PythonInterp.cpp ${PYTHON_CXX_SOURCE_FILES})
list( APPEND MAIN_SOURCE_FILES
src/opm/parser/eclipse/Python/PythonInterp.cpp
src/opm/parser/eclipse/Python/PyRunModule.cpp
${PYTHON_CXX_SOURCE_FILES})
endif()
list( APPEND PYTHON_CXX_DEPENDS ${PYTHON_CXX_SOURCE_FILES}
@@ -237,8 +243,11 @@ if(ENABLE_ECL_OUTPUT)
src/opm/io/eclipse/EGrid.cpp
src/opm/io/eclipse/ERft.cpp
src/opm/io/eclipse/ERst.cpp
src/opm/io/eclipse/ERsm.cpp
src/opm/io/eclipse/ESmry.cpp
src/opm/io/eclipse/ESmry_write_rsm.cpp
src/opm/io/eclipse/OutputStream.cpp
src/opm/io/eclipse/SummaryNode.cpp
src/opm/io/eclipse/rst/connection.cpp
src/opm/io/eclipse/rst/group.cpp
src/opm/io/eclipse/rst/header.cpp
@@ -270,6 +279,8 @@ if(ENABLE_ECL_OUTPUT)
src/opm/output/eclipse/RestartValue.cpp
src/opm/output/eclipse/WriteInit.cpp
src/opm/output/eclipse/WriteRFT.cpp
src/opm/output/eclipse/WriteRPT.cpp
src/opm/output/eclipse/report/WELSPECS.cpp
src/opm/output/data/Solution.cpp
)
endif()
@@ -290,6 +301,8 @@ list (APPEND TEST_SOURCE_FILES
)
if(ENABLE_ECL_INPUT)
list(APPEND TEST_SOURCE_FILES
tests/rst_test.cpp
tests/test_ERsm.cpp
tests/parser/ACTIONX.cpp
tests/parser/ADDREGTests.cpp
tests/parser/AquiferTests.cpp
@@ -325,6 +338,7 @@ if(ENABLE_ECL_INPUT)
tests/parser/ParseDATAWithDefault.cpp
tests/parser/PYACTION.cpp
tests/parser/RawKeywordTests.cpp
tests/parser/test_ReportConfig.cpp
tests/parser/ResinsightTest.cpp
tests/parser/RestartConfigTests.cpp
tests/parser/RFTConfigTests.cpp
@@ -346,6 +360,7 @@ if(ENABLE_ECL_INPUT)
tests/parser/TableSchemaTests.cpp
tests/parser/ThresholdPressureTest.cpp
tests/parser/TimeMapTest.cpp
tests/parser/TracerTests.cpp
tests/parser/TransMultTests.cpp
tests/parser/TuningTests.cpp
tests/parser/UDQTests.cpp
@@ -379,6 +394,7 @@ if(ENABLE_ECL_OUTPUT)
tests/test_rst.cpp
tests/test_Solution.cpp
tests/test_Summary.cpp
tests/test_Summary_Group.cpp
tests/test_Tables.cpp
tests/test_Wells.cpp
tests/test_WindowedArray.cpp
@@ -410,6 +426,7 @@ if(ENABLE_ECL_OUTPUT)
tests/SOFR_TEST.DATA
tests/UDQ_TEST_WCONPROD_IUAD-2.DATA
tests/UDQ_ACTIONX_TEST1.DATA
tests/UDQ_ACTIONX_TEST1_U.DATA
tests/include_example_pvt.txt
tests/include_example_summary.txt
tests/include_sgof.txt
@@ -418,6 +435,17 @@ if(ENABLE_ECL_OUTPUT)
tests/SPE1CASE2.DATA
tests/SPE1CASE2_RESTART.DATA
tests/SPE1CASE2.X0060
tests/PYACTION.DATA
tests/act1.py
tests/MSW.DATA
tests/EXIT_TEST.DATA
tests/action_syntax_error.py
tests/action_missing_run.py
tests/EMBEDDED_PYTHON.DATA
tests/wclose.py
tests/msim/MSIM_PYACTION.DATA
tests/msim/action1.py
tests/msim/action2.py
)
endif()
@@ -437,12 +465,13 @@ if(ENABLE_ECL_INPUT)
tests/SPE1CASE1A.UNSMRY
tests/SPE1CASE1_RST60.SMSPEC
tests/SPE1CASE1_RST60.UNSMRY
tests/MODEL2_RESTART.DATA
tests/restart/MODEL2.UNRST
)
list (APPEND EXAMPLE_SOURCE_FILES
examples/opmi.cpp
examples/opmpack.cpp
examples/opmhash.cpp
tests/rst_load.cpp
)
endif()
@@ -494,15 +523,16 @@ list( APPEND PUBLIC_HEADER_FILES
opm/common/utility/parameters/ParameterStrings.hpp
opm/common/utility/parameters/ParameterTools.hpp
opm/common/utility/numeric/calculateCellVol.hpp
opm/common/utility/String.hpp
opm/common/utility/TimeService.hpp
)
if(ENABLE_ECL_INPUT)
list(APPEND PUBLIC_HEADER_FILES
opm/io/eclipse/SummaryNode.hpp
opm/json/JsonObject.hpp
opm/parser/eclipse/Utility/Stringview.hpp
opm/parser/eclipse/Utility/Functional.hpp
opm/parser/eclipse/Utility/Typetools.hpp
opm/parser/eclipse/Utility/String.hpp
opm/parser/eclipse/Generator/KeywordGenerator.hpp
opm/parser/eclipse/Generator/KeywordLoader.hpp
opm/parser/eclipse/Units/UnitSystem.hpp
@@ -541,6 +571,7 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp
opm/parser/eclipse/EclipseState/Grid/MinpvMode.hpp
opm/parser/eclipse/EclipseState/EndpointScaling.hpp
opm/parser/eclipse/EclipseState/TracerConfig.hpp
opm/parser/eclipse/EclipseState/Tables/DenT.hpp
opm/parser/eclipse/EclipseState/Tables/SimpleTable.hpp
opm/parser/eclipse/EclipseState/Tables/StandardCond.hpp
@@ -614,6 +645,7 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/ImkrvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/Sof3Table.hpp
opm/parser/eclipse/EclipseState/Tables/SgofTable.hpp
opm/parser/eclipse/EclipseState/Tables/TracerVdTable.hpp
opm/parser/eclipse/EclipseState/EclipseState.hpp
opm/parser/eclipse/EclipseState/EclipseConfig.hpp
opm/parser/eclipse/EclipseState/Aquancon.hpp
@@ -653,6 +685,7 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Schedule/DynamicVector.hpp
opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp
opm/parser/eclipse/EclipseState/Schedule/RFTConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/RPTConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp
opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.hpp
opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp
@@ -714,9 +747,11 @@ if(ENABLE_ECL_OUTPUT)
opm/io/eclipse/EGrid.hpp
opm/io/eclipse/ERft.hpp
opm/io/eclipse/ERst.hpp
opm/io/eclipse/ERsm.hpp
opm/io/eclipse/ESmry.hpp
opm/io/eclipse/PaddedOutputString.hpp
opm/io/eclipse/OutputStream.hpp
opm/io/eclipse/SummaryNode.hpp
opm/io/eclipse/rst/connection.hpp
opm/io/eclipse/rst/group.hpp
opm/io/eclipse/rst/header.hpp
@@ -727,6 +762,7 @@ if(ENABLE_ECL_OUTPUT)
opm/output/data/Cells.hpp
opm/output/data/Solution.hpp
opm/output/data/Wells.hpp
opm/output/data/Groups.hpp
opm/output/eclipse/VectorItems/aquifer.hpp
opm/output/eclipse/VectorItems/connection.hpp
opm/output/eclipse/VectorItems/group.hpp
@@ -756,7 +792,14 @@ if(ENABLE_ECL_OUTPUT)
opm/output/eclipse/WindowedArray.hpp
opm/output/eclipse/WriteInit.hpp
opm/output/eclipse/WriteRFT.hpp
opm/output/eclipse/WriteRPT.hpp
opm/output/eclipse/WriteRestartHelpers.hpp
opm/output/OutputWriter.hpp
)
endif()
if(ENABLE_ECL_INPUT OR ENABLE_ECL_OUTPUT)
list(APPEND TEST_SOURCE_FILES
tests/test_SummaryNode.cpp
)
endif()

View File

@@ -61,6 +61,16 @@ foreach (test BoxTest
list(APPEND EXTRA_TESTS ${test})
endforeach ()
opm_add_test( rst_spe1
SOURCES tests/rst_test.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS tests/SPE1CASE2.DATA tests/SPE1CASE2_RESTART.DATA )
opm_add_test( rst_msw
SOURCES tests/rst_test.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS tests/MSW.DATA tests/MSW_RESTART.DATA )
# opm-tests dependent tests
if(HAVE_OPM_TESTS)
opm_add_test(parse_write ONLY_COMPILE
@@ -105,8 +115,6 @@ if(HAVE_OPM_TESTS)
opm_add_test("SPE9_CP_GROUP2" NO_COMPILE EXE_NAME parse_write TEST_ARGS "${OPM_TESTS_ROOT}/spe9group/SPE9_CP_GROUP.DATA")
set_property(TEST NORNE_ATW2013
PROPERTY ENVIRONMENT "OPM_ERRORS_IGNORE=PARSE_RANDOM_SLASH")
opm_add_test("RST_LOAD_MSW" NO_COMPILE EXE_NAME rst_load TEST_ARGS "${OPM_TESTS_ROOT}/msw_3d_hfa/opm-simulation-reference/flow/3D_MSW.UNRST")
endif()
# JSON tests

View File

@@ -58,6 +58,7 @@ if(PARMETIS_INCLUDE_DIR)
endif()
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${MPI_C_COMPILE_FLAGS}")
include(CheckIncludeFile)
check_include_file(parmetis.h PARMETIS_FOUND)
_search_parmetis_lib(PARMETIS_LIBRARY parmetis "The main ParMETIS library.")

View File

@@ -16,6 +16,9 @@ if(ZOLTAN_ROOT)
set(ZOLTAN_NO_DEFAULT_PATH "NO_DEFAULT_PATH")
endif()
# We only need zoltan with MPI. Otherwise usage of alugrid is broken.
find_package(MPI)
# Make sure we have checked for the underlying partitioners.
find_package(PTScotch)
#find_package(ParMETIS)
@@ -39,20 +42,23 @@ find_library(ZOLTAN_LIBRARIES
${ZOLTAN_NO_DEFAULT_PATH})
set (ZOLTAN_FOUND FALSE)
if (ZOLTAN_INCLUDE_DIRS OR ZOLTAN_LIBRARIES)
set(ZOLTAN_FOUND TRUE)
set (ZOLTAN_CONFIG_VAR HAVE_ZOLTAN)
# print a message to indicate status of this package
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZOLTAN
DEFAULT_MSG
ZOLTAN_LIBRARIES
ZOLTAN_INCLUDE_DIRS
MPI_FOUND
)
if (ZOLTAN_FOUND)
set(HAVE_ZOLTAN 1)
set(ZOLTAN_LIBRARIES ${ZOLTAN_LIBRARIES} ${PARMETIS_LIBRARIES} ${PTSCOTCH_LIBRARIES})
set(ZOLTAN_INCLUDE_DIRS ${ZOLTAN_INCLUDE_DIRS} ${PARMETIS_INCLUDE_DIRS}
${PTSCOTCH_INCLUDE_DIRS})
endif()
set (ZOLTAN_CONFIG_VAR HAVE_ZOLTAN)
# print a message to indicate status of this package
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZOLTAN
DEFAULT_MSG
ZOLTAN_LIBRARIES
ZOLTAN_INCLUDE_DIRS
)

View File

@@ -97,3 +97,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND ${project}_LIBRARIES stdc++fs)
endif()
endif()
option(OPM_CLANG_WITH_STDC++FS "Using libstdc++ with clang and we want to link to stdc++fs" OFF)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND OPM_CLANG_WITH_STDC++FS)
list(APPEND ${project}_LIBRARIES stdc++fs)
endif()

View File

@@ -5,6 +5,8 @@ is_compiler_gcc_compatible ()
include(TestCXXAcceptsFlag)
macro (opm_defaults opm)
message("Processing opm_defaults ${opm}")
# if we are installing a development version (default when checking out of
# VCS), then remember which directories were used when configuring. package
# distribution should disable this option.

View File

@@ -54,17 +54,6 @@ foreach (name IN LISTS _opm_proj_vars)
endif (NOT DEFINED ${CMAKE_PROJECT_NAME}_${name})
endforeach (name)
# these dependencies needs special treatment
set (_opm_proj_exemptions
dune-common
dune-istl
dune-grid
dune-geometry
dune-uggrid
dune-alugrid
dune-localfunctions
dune-fem
)
# insert this boilerplate whenever we are going to find a new package
macro (find_and_append_package_to prefix name)
@@ -115,21 +104,6 @@ macro (find_and_append_package_to prefix name)
endif (EXISTS ${${NAME}_ROOT}/${name}-config.cmake OR EXISTS ${${NAME}_ROOT}/${name}Config.cmake)
endif (NOT DEFINED ${name}_DIR AND (DEFINED ${name}_ROOT OR DEFINED ${NAME}_ROOT))
# these libraries need special handling which is not provided in
# the -config.cmake file, but which must be provided by this project,
# something which is done in our find module
list (FIND _opm_proj_exemptions "${name}" _${name}_exempted)
if ((NOT (_${name}_exempted EQUAL -1)) AND (DEFINED ${name}_DIR))
set (${name}_ROOT "${${name}_DIR}")
# store this for later, in case we reconfigure
set (${name}_ROOT "${${name}_ROOT}" CACHE LOCATION "Path to ${name}")
# clear this to not use config mode
unset (${name}_DIR)
# variables that are given on the command-line is also put in the cache
# removing the local copy only "unshadows" this one
unset (${name}_DIR CACHE)
endif ((NOT (_${name}_exempted EQUAL -1)) AND (DEFINED ${name}_DIR))
# if we're told not to look for the package, pretend it was never found
if (CMAKE_DISABLE_FIND_PACKAGE_${name})
set (${name}_FOUND FALSE)
@@ -151,10 +125,8 @@ macro (find_and_append_package_to prefix name)
# and the likes which is only done via opm_find_package
if ( (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND )
OR _search_components GREATER -1)
string(REGEX MATCH "(dune|opm)-.*" _is_opm ${name})
if(_${name}_exempted LESS 0 AND NOT _is_opm)
find_package (${name} ${ARGN})
elseif(_${name}_exempted GREATER -1)
string(REGEX MATCH "(opm)-.*" _is_opm ${name})
if(NOT _is_opm)
find_package (${name} ${ARGN})
else()
if(${name}_DIR)

View File

@@ -12,6 +12,59 @@
# This module should be the first to be included in the project,
# because most of the others (OpmXxx.cmake) use these variables.
# for CMake >= 3.0, we need to change a few policies:
#
# - CMP0026 to allow access to the LOCATION target property
# - CMP0048 to indicate that we want to deal with the *VERSION*
# variables ourselves
# - CMP0064 to indicate that we want TEST if conditions to be evaluated
# - CMP0074 to indicate that <PackageName>_ROOT can be used to find package
# config files
macro(OpmSetPolicies)
if (POLICY CMP0026)
# Needed as we query LOCATION in OpmCompile.cmake and OpmSatellites.cmake
cmake_policy(SET CMP0026 OLD)
endif()
if (POLICY CMP0048)
# We do not set version. Hence NEW should work and this can be removed later
cmake_policy(SET CMP0048 NEW)
endif()
if(POLICY CMP0064)
cmake_policy(SET CMP0064 NEW)
endif()
# set the behavior of the policy 0054 to NEW. (i.e. do not implicitly
# expand variables in if statements)
if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
# set the behavior of policy 0074 to new as we always used <PackageName>_ROOT as the
# root of the installation
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
# include special
if (CMAKE_VERSION VERSION_LESS "2.8.3")
message (STATUS "Enabling compatibility modules for CMake 2.8.3")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.3")
endif (CMAKE_VERSION VERSION_LESS "2.8.3")
if (CMAKE_VERSION VERSION_LESS "2.8.5")
message (STATUS "Enabling compatibility modules for CMake 2.8.5")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.5")
endif (CMAKE_VERSION VERSION_LESS "2.8.5")
if (CMAKE_VERSION VERSION_LESS "2.8.7")
message (STATUS "Enabling compatibility modules for CMake 2.8.7")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.7")
endif (CMAKE_VERSION VERSION_LESS "2.8.7")
endmacro()
# helper macro to retrieve a single field of a dune.module file
macro(OpmGetDuneModuleDirective field variable contents)
string (REGEX MATCH ".*${field}:[ ]*([^\n]+).*" ${variable} "${contents}")

View File

@@ -40,7 +40,7 @@ macro (opm_install opm)
set (_sys_dbg_def OFF)
endif (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
option (SYSTEM_DEBUG "Put .debug files in GDB debug file directory" ${_sys_dbg_def})
set (DEBUG_FILE_DIRECTORY /usr/lib/debug CACHE LOCATION "GDB debug file directory")
set (DEBUG_FILE_DIRECTORY /usr/lib/debug CACHE PATH "GDB debug file directory")
mark_as_advanced (DEBUG_FILE_DIRECTORY)
if (SYSTEM_DEBUG AND NOT APPLE)
set (_dbg_prefix "${DEBUG_FILE_DIRECTORY}/")

View File

@@ -15,55 +15,11 @@
# tests_hook Do special processing before tests are compiled
# files_hook Do special processing before final targets are added
# for CMake >= 3.0, we need to change a few policies:
#
# - CMP0026 to allow access to the LOCATION target property
# - CMP0048 to indicate that we want to deal with the *VERSION*
# variables ourselves
# - CMP0064 to indicate that we want TEST if conditions to be evaluated
if (POLICY CMP0026)
cmake_policy(SET CMP0026 OLD)
endif()
if (POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
if(POLICY CMP0064)
cmake_policy(SET CMP0064 NEW)
endif()
# set the behavior of the policy 0054 to NEW. (i.e. do not implicitly
# expand variables in if statements)
if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
# include special
if (CMAKE_VERSION VERSION_LESS "2.8.3")
message (STATUS "Enabling compatibility modules for CMake 2.8.3")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.3")
endif (CMAKE_VERSION VERSION_LESS "2.8.3")
if (CMAKE_VERSION VERSION_LESS "2.8.5")
message (STATUS "Enabling compatibility modules for CMake 2.8.5")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.5")
endif (CMAKE_VERSION VERSION_LESS "2.8.5")
if (CMAKE_VERSION VERSION_LESS "2.8.7")
message (STATUS "Enabling compatibility modules for CMake 2.8.7")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.7")
endif (CMAKE_VERSION VERSION_LESS "2.8.7")
# don't write default flags into the cache, preserve that for user set values
include (AddOptions)
no_default_options ()
# C++ project
project (${${project}_NAME})
enable_language (C)
enable_language (CXX)
# Languages and global compiler settings
if(CMAKE_VERSION VERSION_LESS 3.8)
message(WARNING "CMake version does not support c++17, guessing -std=c++17")

View File

@@ -198,6 +198,7 @@ endmacro (opm_data satellite target dirname files)
# TEST_DEPENDS Other tests which must be run before running this test (optional, default: None)
# LIBRARIES Libraries to link test against (optional)
# WORKING_DIRECTORY Working directory for test (optional, default: ${PROJECT_BINARY_DIR})
# CONFIGURATION Configuration to add test to
#
# Example:
#
@@ -211,7 +212,7 @@ include(CMakeParseArguments)
macro(opm_add_test TestName)
cmake_parse_arguments(CURTEST
"NO_COMPILE;ONLY_COMPILE;ALWAYS_ENABLE" # flags
"EXE_NAME;PROCESSORS;WORKING_DIRECTORY" # one value args
"EXE_NAME;PROCESSORS;WORKING_DIRECTORY;CONFIGURATION" # one value args
"CONDITION;DEFAULT_ENABLE_IF;TEST_DEPENDS;DRIVER;DRIVER_ARGS;DEPENDS;TEST_ARGS;SOURCES;LIBRARIES" # multi-value args
${ARGN})
@@ -347,7 +348,8 @@ macro(opm_add_test TestName)
add_test(NAME ${_FANCY}
WORKING_DIRECTORY "${CURTEST_WORKING_DIRECTORY}"
COMMAND ${CURTEST_COMMAND})
COMMAND ${CURTEST_COMMAND}
CONFIGURATIONS ${CURTEST_CONFIGURATION})
# specify the dependencies between the tests
if (CURTEST_TEST_DEPENDS)

View File

@@ -42,7 +42,13 @@ macro (find_openmp opm)
# enabling OpenMP is supposedly enough to make the compiler link with
# the appropriate libraries
find_package (OpenMP ${${opm}_QUIET})
list (APPEND ${opm}_LIBRARIES ${OpenMP_LIBRARIES})
if(OpenMP_CXX_FOUND)
list (APPEND ${opm}_LIBRARIES OpenMP::OpenMP_CXX)
else()
list (APPEND ${opm}_LIBRARIES ${OpenMP_LIBRARIES})
endif()
if (OPENMP_FOUND)
add_options (C ALL_BUILDS "${OpenMP_C_FLAGS}")
add_options (CXX ALL_BUILDS "${OpenMP_CXX_FLAGS}")

View File

@@ -14,6 +14,7 @@
# makes changes to any of the unit tests.
message("-- Writing version information to local header project-version.h")
string (TIMESTAMP build_timestamp "%Y-%m-%d at %H:%M:%S hrs")
string (TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_upper_)
if (cmake_build_type_upper_ MATCHES DEBUG)
@@ -23,6 +24,7 @@ if (cmake_build_type_upper_ MATCHES DEBUG)
"#define PROJECT_VERSION_NAME \"${${project}_LABEL}\"\n"
"#define PROJECT_VERSION_HASH \"debug\"\n"
"#define PROJECT_VERSION \"${${project}_LABEL} (debug)\"\n"
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
)
else ()
@@ -41,6 +43,7 @@ else ()
"#define PROJECT_VERSION_NAME \"${${project}_LABEL}\"\n"
"#define PROJECT_VERSION_HASH \"unknown git version\"\n"
"#define PROJECT_VERSION \"${${project}_LABEL} (unknown git version)\"\n"
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
)
else ()

View File

@@ -47,6 +47,8 @@ if (sha1)
endif ()
endif ()
string (TIMESTAMP build_timestamp "%Y-%m-%d at %H:%M:%S hrs")
# write the content to a temporary file in a C compatible format
file (WRITE "${PROJECT_BINARY_DIR}/project-version.tmp"
"#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
@@ -54,6 +56,7 @@ file (WRITE "${PROJECT_BINARY_DIR}/project-version.tmp"
"#define PROJECT_VERSION_NAME \"${PROJECT_LABEL}\"\n"
"#define PROJECT_VERSION_HASH \"${sha1}\"\n"
"#define PROJECT_VERSION \"${PROJECT_LABEL} (${sha1})\"\n"
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
)

View File

@@ -30,6 +30,11 @@ if(NOT @opm-project_NAME@_FOUND)
set (@opm-project_NAME@_LINKER_FLAGS "@opm-project_LINKER_FLAGS@")
set (@opm-project_NAME@_CONFIG_VARS "@opm-project_CONFIG_VARS@")
# The flag whether embedded Python is supported or not is passed to downstream modules,
# it is only used to enable/disable regression testing with Python enabled input. The
# actual code is self contained - and can be used downstream without awareness of this.
set (@opm-project_NAME@_EMBEDDED_PYTHON @OPM_ENABLE_EMBEDDED_PYTHON@)
# libraries come from the build tree where this file was generated
set (@opm-project_NAME@_LIBRARY "@opm-project_LIBRARY@")
set (@opm-project_NAME@_LIBRARIES ${@opm-project_NAME@_LIBRARY} "@opm-project_LIBRARIES@")

2
debian/changelog vendored
View File

@@ -1,4 +1,4 @@
opm-common (2019.04-pre~xenial) xenial; urgency=medium
opm-common (2020.04-1~xenial) xenial; urgency=medium
* New release

4
debian/control vendored
View File

@@ -16,7 +16,7 @@ Vcs-Browser: https://github.com/OPM/opm-common
Package: libopm-common1
Section: libs
Pre-Depends: ${misc:Pre-Depends}, multiarch-support
Pre-Depends: ${misc:Pre-Depends}
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -56,7 +56,7 @@ Description: OPM common library -- documentation
Package: python3-opm-common
Section: libs
Pre-Depends: ${misc:Pre-Depends}, multiarch-support
Pre-Depends: ${misc:Pre-Depends}
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}, libopm-common1, python3-numpy, python3-decorator

View File

@@ -5,8 +5,8 @@
Module: opm-common
Description: Open Porous Media Initiative shared infrastructure
Version: 2020.04-pre
Label: 2020.04-pre
Version: 2020.04
Label: 2020.04
Maintainer: opm@opm-project.org
MaintainerName: OPM community
Url: http://opm-project.org

View File

@@ -23,6 +23,7 @@
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
@@ -35,10 +36,11 @@ int main(int /* argc */, char** argv) {
Opm::Parser parser;
Opm::ParseContext parse_context;
Opm::ErrorGuard error_guard;
auto python = std::make_shared<Opm::Python>();
Opm::Deck deck = parser.parseFile(deck_file, parse_context, error_guard);
Opm::EclipseState state(deck);
Opm::Schedule schedule(deck, state, parse_context, error_guard);
Opm::Schedule schedule(deck, state, parse_context, error_guard, python);
Opm::SummaryConfig summary_config(deck, schedule, state.getTableManager(), parse_context, error_guard);
if (error_guard) {

View File

@@ -29,6 +29,7 @@
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/common/OpmLog/StreamLog.hpp>
@@ -44,6 +45,7 @@ inline void loadDeck( const char * deck_file) {
Opm::ParseContext parseContext;
Opm::ErrorGuard errors;
Opm::Parser parser;
auto python = std::make_shared<Opm::Python>();
std::cout << "Loading deck: " << deck_file << " ..... "; std::cout.flush();
@@ -62,7 +64,7 @@ inline void loadDeck( const char * deck_file) {
std::cout << "creating Schedule .... "; std::cout.flush();
start = std::chrono::system_clock::now();
Opm::Schedule schedule( deck, state);
Opm::Schedule schedule( deck, state, python);
auto schedule_time = std::chrono::system_clock::now() - start;
std::cout << "creating SummaryConfig .... "; std::cout.flush();

View File

@@ -22,6 +22,8 @@
#include <getopt.h>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/I.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/P.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/G.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
@@ -85,9 +87,11 @@ void copy_file(const fs::path& source_dir, fs::path fname, const fs::path& targe
auto source_file = source_dir / fname;
auto target_file = target_dir / fname;
if (!fs::is_directory(target_file.parent_path()))
fs::create_directories(target_file.parent_path());
{
const auto& parent_path = target_file.parent_path();
if (!parent_path.empty() && !fs::is_directory(parent_path))
fs::create_directories(parent_path);
}
fs::copy_file(source_file, target_file, fs::copy_options::overwrite_existing);
std::cerr << "Copying file " << source_file.string() << " -> " << target_file.string() << std::endl;
@@ -149,12 +153,22 @@ int main(int argc, char** argv) {
copy_file(input_arg.parent_path(), restart_file, output_dir);
}
for (std::size_t import_index = 0; import_index < deck.count("IMPORT"); import_index++) {
const auto& import_keyword = deck.getKeyword("IMPORT", import_index);
const auto& fname = import_keyword.getRecord(0).getItem("FILE").get<std::string>(0);
using IMPORT = Opm::ParserKeywords::IMPORT;
for (std::size_t import_index = 0; import_index < deck.count<IMPORT>(); import_index++) {
const auto& import_keyword = deck.getKeyword<IMPORT>(import_index);
const auto& fname = import_keyword.getRecord(0).getItem<IMPORT::FILE>().get<std::string>(0);
copy_file(input_arg.parent_path(), fname, output_dir);
}
using PYACTION = Opm::ParserKeywords::PYACTION;
for (std::size_t pyaction_index = 0; pyaction_index < deck.count<PYACTION>(); pyaction_index++) {
const auto& pyaction_keyword = deck.getKeyword<PYACTION>(pyaction_index);
const auto& fname = pyaction_keyword.getRecord(1).getItem<PYACTION::FILENAME>().get<std::string>(0);
copy_file(input_arg.parent_path(), fname, output_dir);
}
using GDFILE = Opm::ParserKeywords::GDFILE;
if (deck.hasKeyword<GDFILE>()) {
const auto& gdfile_keyword = deck.getKeyword<GDFILE>();

View File

@@ -3,7 +3,7 @@
declare -A configurations
declare -A EXTRA_MODULE_FLAGS
EXTRA_MODULE_FLAGS[opm-simulators]="-DBUILD_EBOS_EXTENSIONS=ON -DBUILD_EBOS_DEBUG_EXTENSIONS=ON -DBUILD_FLOW_VARIANTS=ON"
EXTRA_MODULE_FLAGS[opm-simulators]="-DBUILD_EBOS_EXTENSIONS=ON -DBUILD_EBOS_DEBUG_EXTENSIONS=ON -DBUILD_FLOW_VARIANTS=ON -DOPM_ENABLE_PYTHON=ON"
EXTRA_MODULE_FLAGS[opm-common]="-DOPM_ENABLE_PYTHON=ON -DOPM_ENABLE_EMBEDDED_PYTHON=ON -DOPM_INSTALL_PYTHON=ON"
# Parse revisions from trigger comment and setup arrays

View File

@@ -21,6 +21,7 @@ namespace Opm {
class EclipseIO;
class ParseContext;
class Parser;
class Python;
class SummaryState;
class msim {
@@ -33,7 +34,7 @@ public:
void well_rate(const std::string& well, data::Rates::opt rate, std::function<well_rate_function> func);
void solution(const std::string& field, std::function<solution_function> func);
void run(Schedule& schedule, EclipseIO& io, bool report_only);
void post_step(Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step) const;
void post_step(Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step);
private:
void run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const;

View File

@@ -24,6 +24,8 @@
#include <opm/output/eclipse/Summary.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/output/data/Groups.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.hpp>
@@ -41,11 +43,12 @@ msim::msim(const EclipseState& state_arg) :
void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) {
const double week = 7 * 86400;
data::Solution sol;
data::Wells well_data;
SummaryState st(std::chrono::system_clock::from_time_t(schedule.getStartTime()));
Python python;
io.writeInitial();
for (size_t report_step = 1; report_step < schedule.size(); report_step++) {
data::Wells well_data;
if (report_only)
run_step(schedule, st, sol, well_data, report_step, io);
else {
@@ -53,11 +56,14 @@ void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) {
run_step(schedule, st, sol, well_data, report_step, time_step, io);
}
post_step(schedule, st, sol, well_data, report_step);
const auto& exit_status = schedule.exitStatus();
if (exit_status.has_value())
return;
}
}
void msim::post_step(Schedule& schedule, const SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, size_t report_step) const {
void msim::post_step(Schedule& schedule, SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, size_t report_step) {
const auto& actions = schedule.actions(report_step);
if (actions.empty())
return;
@@ -70,6 +76,9 @@ void msim::post_step(Schedule& schedule, const SummaryState& st, data::Solution&
if (result)
schedule.applyAction(report_step, *action, result);
}
for (const auto& pyaction : actions.pending_python())
pyaction->run(this->state, schedule, report_step, st);
}
@@ -91,6 +100,8 @@ void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution&
this->simulate(schedule, st, sol, well_data, report_step, seconds_elapsed, time_step);
Opm::data::Group group_data;
seconds_elapsed += time_step;
io.summary().eval(st,
@@ -99,6 +110,7 @@ void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution&
this->state,
schedule,
well_data,
group_data,
{});
this->output(st,
@@ -113,11 +125,11 @@ void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution&
void msim::output(SummaryState& st, size_t report_step, bool /* substep */, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, EclipseIO& io) const {
void msim::output(SummaryState& st, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, EclipseIO& io) const {
RestartValue value(sol, well_data);
io.writeTimeStep(st,
report_step,
false,
substep,
seconds_elapsed,
value);
}
@@ -131,6 +143,10 @@ void msim::simulate(const Schedule& schedule, const SummaryState& st, data::Solu
for (const auto& well_pair : this->well_rates) {
const std::string& well_name = well_pair.first;
const auto& sched_well = schedule.getWell(well_name, report_step);
if (sched_well.getStatus() != Well::Status::OPEN)
continue;
data::Well& well = well_data[well_name];
for (const auto& rate_pair : well_pair.second) {
auto rate = rate_pair.first;

View File

@@ -3,7 +3,8 @@
# defines that must be present in config.h for our headers
set (opm-common_CONFIG_VAR
"HAS_ATTRIBUTE_UNUSED")
HAVE_OPENMP
)
# dependencies
set (opm-common_DEPS
@@ -14,6 +15,7 @@ set (opm-common_DEPS
list(APPEND opm-common_DEPS
# various runtime library enhancements
"Boost 1.44.0 COMPONENTS system unit_test_framework REQUIRED"
"OpenMP QUIET"
)
find_package_deps(opm-common)

View File

@@ -33,10 +33,26 @@ public:
lineno(lno)
{}
static Location serializeObject()
{
Location result;
result.filename = "test";
result.lineno = 1;
return result;
}
bool operator==(const Location& data) const {
return filename == data.filename &&
lineno == data.lineno;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(filename);
serializer(lineno);
}
};
}

View File

@@ -39,12 +39,21 @@ namespace Opm {
month == data.month &&
day == data.day;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(year);
serializer(month);
serializer(day);
}
};
TimeStampUTC() = default;
explicit TimeStampUTC(const std::time_t tp);
explicit TimeStampUTC(const YMD& ymd);
TimeStampUTC(int year, int month, int day);
TimeStampUTC(const YMD& ymd,
int hour,
int minutes,
@@ -68,7 +77,18 @@ namespace Opm {
int seconds() const { return this->seconds_; }
int microseconds() const { return this->usec_; }
template<class Serializer>
void serializeOp(Serializer& serializer)
{
ymd_.serializeOp(serializer);
serializer(hour_);
serializer(minutes_);
serializer(seconds_);
serializer(usec_);
}
private:
YMD ymd_{};
int hour_{0};
int minutes_{0};
@@ -78,6 +98,7 @@ namespace Opm {
TimeStampUTC operator+(const TimeStampUTC& lhs, std::chrono::duration<double> delta);
std::time_t asTimeT(const TimeStampUTC& tp);
std::time_t asLocalTimeT(const TimeStampUTC& tp);
} // namespace Opm

View File

@@ -44,16 +44,20 @@ public:
template <typename T>
const std::vector<T>& getRft(const std::string& name, const std::string& wellName,
int year, int month, int day) const;
template <typename T>
const std::vector<T>& getRft(const std::string& name, int reportIndex) const;
std::vector<std::string> listOfWells() const;
std::vector<RftDate> listOfdates() const;
using RftReportList = std::vector<std::pair<std::string, RftDate>>;
using RftReportList = std::vector<std::tuple<std::string, RftDate, float>>;
const RftReportList& listOfRftReports() const { return rftReportList; }
bool hasRft(const std::string& wellName, const RftDate& date) const;
bool hasRft(const std::string& wellName, int year, int month, int day) const;
std::vector<EclEntry> listOfRftArrays(int reportIndex ) const;
std::vector<EclEntry> listOfRftArrays(const std::string& wellName,
const RftDate& date) const;
@@ -63,8 +67,12 @@ public:
bool hasArray(const std::string& arrayName, const std::string& wellName,
const RftDate& date) const;
bool hasArray(const std::string& arrayName, int reportInd) const;
int numberOfReports() { return numReports; }
private:
std::map<int, std::pair<int,int>> arrIndexRange;
std::map<int, std::tuple<int,int>> arrIndexRange;
int numReports;
std::vector<float> timeList;
@@ -72,9 +80,11 @@ private:
std::set<RftDate> dateList;
RftReportList rftReportList;
std::map<std::pair<std::string,RftDate>,int> reportIndex; // mapping report index to wellName and date (tupe)
std::map<std::tuple<std::string,RftDate>,int> reportIndices; // mapping report index to wellName and date (tupe)
int getReportIndex(const std::string& wellName, const RftDate& date) const;
int getArrayIndex(const std::string& name, int reportIndex) const;
int getArrayIndex(const std::string& name, const std::string& wellName,
const RftDate& date) const;
};

79
opm/io/eclipse/ERsm.hpp Normal file
View File

@@ -0,0 +1,79 @@
/*
Copyright 2020 Equinor ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_IO_ERSM_HPP
#define OPM_IO_ERSM_HPP
#include <deque>
#include <string>
#include <unordered_map>
#include <variant>
#include <vector>
#include <opm/io/eclipse/SummaryNode.hpp>
#include <opm/common/utility/TimeService.hpp>
namespace Opm { namespace EclIO {
/*
Small class to load RSM files. The RSM file is a text based version of the
information found in the summary file. The format seems quite fragile - with
significant whitespace all over the place.The ambition of this ERsm clas is to
be able to do regression testing of the RSM files we export from the ESmry
class - it is not meant to be a rock-solid-works-in-every-lunar phase RSM
loader.
*/
class ESmry;
class ERsm
{
struct Vector{
SummaryNode header;
std::vector<double> data;
Vector(SummaryNode header_, std::size_t size_advice) :
header(std::move(header_))
{
this->data.reserve(size_advice);
}
};
public:
ERsm(const std::string& fname);
const std::vector<TimeStampUTC>& dates() const;
const std::vector<double>& days() const;
bool has_dates() const;
const std::vector<double>& get(const std::string& key) const;
bool has(const std::string& key) const;
private:
void load_block(std::deque<std::string>& lines , std::size_t& vector_length);
std::unordered_map<std::string, Vector> vectors;
std::variant<std::vector<double>, std::vector<TimeStampUTC>> time;
};
bool cmp(const ESmry& esmr, const ERsm& ersm);
}
}
#endif

View File

@@ -51,6 +51,7 @@ public:
}
int count(const std::string& name, int reportStepNumber) const;
size_t numberOfReportSteps() const { return seqnum.size(); };
const std::vector<int>& listOfReportStepNumbers() const { return seqnum; }

View File

@@ -19,52 +19,124 @@
#ifndef OPM_IO_ESMRY_HPP
#define OPM_IO_ESMRY_HPP
#include <chrono>
#include <ostream>
#include <string>
#include <unordered_map>
#include <vector>
#include <map>
#include <stdint.h>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/io/eclipse/SummaryNode.hpp>
namespace Opm { namespace EclIO {
using ArrSourceEntry = std::tuple<std::string, std::string, int, uint64_t>;
using TimeStepEntry = std::tuple<int, int, uint64_t>;
class ESmry
{
public:
// input is smspec (or fsmspec file)
// input is smspec (or fsmspec file)
explicit ESmry(const std::string& filename, bool loadBaseRunData=false);
int numberOfVectors() const { return nVect; }
bool hasKey(const std::string& key) const;
const std::vector<float>& get(const std::string& name) const;
const std::vector<float>& get(const SummaryNode& node) const;
std::vector<std::chrono::system_clock::time_point> dates() const;
std::vector<float> get_at_rstep(const std::string& name) const;
std::vector<float> get_at_rstep(const SummaryNode& node) const;
std::vector<std::chrono::system_clock::time_point> dates_at_rstep() const;
const std::vector<std::string>& keywordList() const { return keyword; }
void LoadData(const std::vector<std::string>& vectList) const;
void LoadData() const;
std::chrono::system_clock::time_point startdate() const { return startdat; }
const std::vector<std::string>& keywordList() const;
std::vector<std::string> keywordList(const std::string& pattern) const;
const std::vector<SummaryNode>& summaryNodeList() const;
int timestepIdxAtReportstepStart(const int reportStep) const;
private:
int nVect, nI, nJ, nK;
size_t numberOfTimeSteps() const { return timeStepList.size(); }
void ijk_from_global_index(int glob, int &i, int &j, int &k) const;
std::vector<std::vector<float>> param;
const std::string& get_unit(const std::string& name) const;
const std::string& get_unit(const SummaryNode& node) const;
void write_rsm(std::ostream&) const;
void write_rsm_file(std::optional<Opm::filesystem::path> = std::nullopt) const;
private:
Opm::filesystem::path inputFileName;
int nI, nJ, nK, nSpecFiles;
size_t nVect;
std::vector<bool> formattedFiles;
std::vector<std::string> dataFileList;
mutable std::vector<std::vector<float>> vectorData;
mutable std::vector<bool> vectorLoaded;
std::vector<TimeStepEntry> timeStepList;
std::vector<std::map<int, int>> arrayPos;
std::vector<std::string> keyword;
std::map<std::string, int> keyword_index;
std::vector<int> nParamsSpecFile;
std::vector<std::vector<std::string>> keywordListSpecFile;
std::vector<int> seqIndex;
std::vector<float> seqTime;
void ijk_from_global_index(int glob, int &i, int &j, int &k) const;
std::vector<SummaryNode> summaryNodes;
std::unordered_map<std::string, std::string> kwunits;
std::chrono::system_clock::time_point startdat;
std::vector<std::string> checkForMultipleResultFiles(const Opm::filesystem::path& rootN, bool formatted) const;
void getRstString(const std::vector<std::string>& restartArray,
void getRstString(const std::vector<std::string>& restartArray,
Opm::filesystem::path& pathRst,
Opm::filesystem::path& rootN) const;
void updatePathAndRootName(Opm::filesystem::path& dir, Opm::filesystem::path& rootN) const;
std::string makeKeyString(const std::string& keyword, const std::string& wgname, int num) const;
std::string unpackNumber(const SummaryNode&) const;
std::string lookupKey(const SummaryNode&) const;
void write_block(std::ostream &, bool write_dates, const std::vector<std::string>& time_column, const std::vector<SummaryNode>&) const;
template <typename T>
std::vector<T> rstep_vector(const std::vector<T>& full_vector) const {
std::vector<T> result;
result.reserve(seqIndex.size());
for (const auto& ind : seqIndex){
result.push_back(full_vector[ind]);
}
return result;
}
std::vector<std::tuple <std::string, uint64_t>> getListOfArrays(std::string filename, bool formatted);
std::vector<int> makeKeywPosVector(int speInd) const;
};
}} // namespace Opm::EclIO
inline std::ostream& operator<<(std::ostream& os, const Opm::EclIO::ESmry& smry) {
smry.write_rsm(os);
return os;
}
#endif // OPM_IO_ESMRY_HPP

View File

@@ -52,7 +52,7 @@ public:
char_array.clear();
}
using EclEntry = std::tuple<std::string, eclArrType, int>;
using EclEntry = std::tuple<std::string, eclArrType, int64_t>;
std::vector<EclEntry> getList() const;
template <typename T>
@@ -62,6 +62,7 @@ public:
const std::vector<T>& get(const std::string& name);
bool hasKey(const std::string &name) const;
std::size_t count(const std::string& name) const;
const std::vector<std::string>& arrayNames() const { return array_name; }
std::size_t size() const;
@@ -78,9 +79,9 @@ protected:
std::vector<std::string> array_name;
std::vector<eclArrType> array_type;
std::vector<int> array_size;
std::vector<int64_t> array_size;
std::vector<unsigned long int> ifStreamPos;
std::vector<uint64_t> ifStreamPos;
std::map<std::string, int> array_index;
@@ -108,7 +109,7 @@ private:
std::vector<bool> arrayLoaded;
void loadBinaryArray(std::fstream& fileH, std::size_t arrIndex);
void loadFormattedArray(const std::string& fileStr, std::size_t arrIndex, long int fromPos);
void loadFormattedArray(const std::string& fileStr, std::size_t arrIndex, int64_t fromPos);
};

View File

@@ -26,6 +26,7 @@
#include <opm/io/eclipse/EclIOdata.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <iostream>
namespace Opm { namespace EclIO { namespace OutputStream {
class Restart;
@@ -78,7 +79,7 @@ public:
friend class OutputStream::SummarySpecification;
private:
void writeBinaryHeader(const std::string& arrName, int size, eclArrType arrType);
void writeBinaryHeader(const std::string& arrName, int64_t size, eclArrType arrType);
template <typename T>
void writeBinaryArray(const std::vector<T>& data);
@@ -94,6 +95,7 @@ private:
void writeFormattedCharArray(const std::vector<std::string>& data);
void writeFormattedCharArray(const std::vector<PaddedOutputString<8>>& data);
void writeArrayType(const eclArrType arrType);
std::string make_real_string(float value) const;
std::string make_doub_string(double value) const;

View File

@@ -27,14 +27,29 @@
namespace Opm { namespace EclIO {
int flipEndianInt(int num);
int64_t flipEndianLongInt(int64_t num);
float flipEndianFloat(float num);
double flipEndianDouble(double num);
bool isEOF(std::fstream* fileH);
std::tuple<int, int> block_size_data_binary(eclArrType arrType);
std::tuple<int, int, int> block_size_data_formatted(eclArrType arrType);
std::string trimr(const std::string &str1);
uint64_t sizeOnDiskBinary(int64_t num, Opm::EclIO::eclArrType arrType);
uint64_t sizeOnDiskFormatted(const int64_t num, Opm::EclIO::eclArrType arrType);
void readBinaryHeader(std::fstream& fileH, std::string& tmpStrName,
int& tmpSize, std::string& tmpStrType);
void readBinaryHeader(std::fstream& fileH, std::string& arrName,
int64_t& size, Opm::EclIO::eclArrType &arrType);
void readFormattedHeader(std::fstream& fileH, std::string& arrName,
int64_t &num, Opm::EclIO::eclArrType &arrType);
}} // namespace Opm::EclIO
#endif // OPM_IO_ECLUTIL_HPP

View File

@@ -0,0 +1,77 @@
/*
Copyright 2020 Equinor ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_IO_SUMMARYNODE_HPP
#define OPM_IO_SUMMARYNODE_HPP
#include <functional>
#include <optional>
#include <string>
#include <unordered_set>
namespace Opm::EclIO {
struct SummaryNode {
enum class Category {
Aquifer,
Well,
Group,
Field,
Region,
Block,
Connection,
Segment,
Miscellaneous,
};
enum class Type {
Rate,
Total,
Ratio,
Pressure,
Count,
Mode,
Undefined,
};
std::string keyword;
Category category;
Type type;
std::string wgname;
int number;
constexpr static int default_number { std::numeric_limits<int>::min() };
std::string unique_key() const;
using number_renderer = std::function<std::string(const SummaryNode&)>;
std::string unique_key(number_renderer) const;
bool is_user_defined() const;
static Category category_from_keyword(const std::string&, const std::unordered_set<std::string> &miscellaneous_keywords = {});
std::optional<std::string> display_name() const;
std::optional<std::string> display_number() const;
std::optional<std::string> display_number(number_renderer) const;
};
} // namespace Opm::EclIO
#endif // OPM_IO_SUMMARYNODE_HPP

View File

@@ -31,9 +31,10 @@ namespace RestartIO {
class Header;
struct RstConnection {
RstConnection(const ::Opm::UnitSystem& unit_system, const int* icon, const float* scon, const double *xcon);
RstConnection(const ::Opm::UnitSystem& unit_system, std::size_t rst_index, int nsconz, const int* icon, const float* scon, const double *xcon);
static double inverse_peaceman(double cf, double kh, double rw, double skin);
int insert_index;
std::size_t rst_index;
std::array<int,3> ijk;
Connection::State state;
int drain_sat_table;
@@ -41,8 +42,10 @@ struct RstConnection {
int completion;
Connection::Direction dir;
int segment;
Connection::CTFKind cf_kind;
float tran;
float skin_factor;
float cf;
float depth;
float diameter;
float kh;
@@ -54,6 +57,7 @@ struct RstConnection {
double gas_rate;
double pressure;
double resv_rate;
double r0;
};

View File

@@ -65,6 +65,7 @@ struct RstGroup {
double voidage_production_total;
double water_injection_total;
double gas_injection_total;
double voidage_injection_total;
double oil_production_potential;
double water_production_potential;
double history_total_oil_production;

View File

@@ -30,7 +30,7 @@ class UnitSystem;
namespace RestartIO {
struct RstSegment {
RstSegment(const ::Opm::UnitSystem& unit_system, const int* iseg, const double * rseg);
RstSegment(const ::Opm::UnitSystem& unit_system, int segment_number, const int* iseg, const double * rseg);
int segment;
int outlet_segment;

View File

@@ -26,11 +26,13 @@
#include <opm/io/eclipse/rst/header.hpp>
#include <opm/io/eclipse/rst/group.hpp>
#include <opm/io/eclipse/rst/well.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp>
namespace Opm {
class UnitSystem;
namespace RestartIO {
struct RstState {
RstState(const ::Opm::UnitSystem& unit_system,
@@ -71,12 +73,18 @@ struct RstState {
static RstState load(EclIO::ERst& rst_file, int report_step);
const RstWell& get_well(const std::string& wname) const;
const ::Opm::UnitSystem unit_system;
RstHeader header;
std::vector<RstWell> wells;
std::vector<RstGroup> groups;
RstHeader header;
Tuning tuning;
private:
void add_groups(const ::Opm::UnitSystem& unit_system,
const std::vector<std::string>& zgrp,
void load_tuning(const std::vector<int>& intehead,
const std::vector<double>& doubhead);
void add_groups(const std::vector<std::string>& zgrp,
const std::vector<int>& igrp,
const std::vector<float>& sgrp,
const std::vector<double>& xgrp);

View File

@@ -27,6 +27,7 @@
#include <opm/io/eclipse/rst/connection.hpp>
#include <opm/io/eclipse/rst/segment.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.hpp>
namespace Opm {
class UnitSystem;
@@ -64,7 +65,7 @@ struct RstWell {
std::string group;
std::array<int, 2> ij;
std::pair<int,int> k1k2;
int wtype;
WellType wtype;
int active_control;
int vfp_table;
int pred_requested_control;
@@ -72,6 +73,7 @@ struct RstWell {
int hist_requested_control;
int msw_index;
int completion_ordering;
int pvt_table;
float orat_target;
float wrat_target;
@@ -84,6 +86,8 @@ struct RstWell {
float hist_grat_target;
float hist_bhp_target;
float datum_depth;
float drainage_radius;
float efficiency_factor;
double oil_rate;
double water_rate;
@@ -99,6 +103,7 @@ struct RstWell {
double void_total;
double water_inj_total;
double gas_inj_total;
double void_inj_total;
double gas_fvf;
double bhp_target_double;
double hist_oil_total;

112
opm/output/data/Groups.hpp Normal file
View File

@@ -0,0 +1,112 @@
/*
Copyright 2016 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_OUTPUT_GROUPS_HPP
#define OPM_OUTPUT_GROUPS_HPP
#include <algorithm>
#include <cstddef>
#include <initializer_list>
#include <map>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
namespace Opm {
namespace data {
struct currentGroupConstraints {
Opm::Group::ProductionCMode currentProdConstraint;
Opm::Group::InjectionCMode currentGasInjectionConstraint;
Opm::Group::InjectionCMode currentWaterInjectionConstraint;
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
inline currentGroupConstraints& set( Opm::Group::ProductionCMode cpc,
Opm::Group::InjectionCMode cgic,
Opm::Group::InjectionCMode cwic);
};
class Group : public std::map<std::string, Opm::data::currentGroupConstraints> {
public:
template <class MessageBufferType>
void write(MessageBufferType& buffer) const {
unsigned int size = this->size();
buffer.write(size);
for (const auto& witr : *this) {
const std::string& name = witr.first;
buffer.write(name);
const auto& pi_constr = witr.second;
pi_constr.write(buffer);
}
}
template <class MessageBufferType>
void read(MessageBufferType& buffer) {
unsigned int size;
buffer.read(size);
for (size_t i = 0; i < size; ++i) {
std::string name;
buffer.read(name);
currentGroupConstraints cgc;
cgc.read(buffer);
this->emplace(name, cgc);
}
}
};
/* IMPLEMENTATIONS */
template <class MessageBufferType>
void currentGroupConstraints::write(MessageBufferType& buffer) const {
buffer.write(this->currentProdConstraint);
buffer.write(this->currentGasInjectionConstraint);
buffer.write(this->currentWaterInjectionConstraint);
}
template <class MessageBufferType>
void currentGroupConstraints::read(MessageBufferType& buffer) {
buffer.read(this->currentProdConstraint);
buffer.read(this->currentGasInjectionConstraint);
buffer.read(this->currentWaterInjectionConstraint);
}
inline currentGroupConstraints& currentGroupConstraints::set( Opm::Group::ProductionCMode cpc,
Opm::Group::InjectionCMode cgic,
Opm::Group::InjectionCMode cwic) {
this->currentGasInjectionConstraint = cgic;
this->currentWaterInjectionConstraint = cwic;
this->currentProdConstraint = cpc;
return *this;
}
}} // Opm::data
#endif //OPM_OUTPUT_GROUPS_HPP

View File

@@ -150,15 +150,63 @@ namespace Opm {
void read(MessageBufferType& buffer);
};
class SegmentPressures {
public:
enum class Value : std::size_t {
Pressure, PDrop, PDropHydrostatic, PDropAccel, PDropFriction,
};
double& operator[](const Value i)
{
return this->values_[this->index(i)];
}
double operator[](const Value i) const
{
return this->values_[this->index(i)];
}
bool operator==(const SegmentPressures& segpres2) const
{
return this->values_ == segpres2.values_;
}
template <class MessageBufferType>
void write(MessageBufferType& buffer) const
{
for (const auto& value : this->values_) {
buffer.write(value);
}
}
template <class MessageBufferType>
void read(MessageBufferType& buffer)
{
for (auto& value : this->values_) {
buffer.read(value);
}
}
private:
constexpr static std::size_t numvals = 5;
std::array<double, numvals> values_;
std::size_t index(const Value ix) const
{
return static_cast<std::size_t>(ix);
}
};
struct Segment {
Rates rates;
double pressure;
SegmentPressures pressures;
std::size_t segNumber;
bool operator==(const Segment& seg2) const
{
return rates == seg2.rates &&
pressure == seg2.pressure &&
pressures == seg2.pressures &&
segNumber == seg2.segNumber;
}
@@ -210,6 +258,30 @@ namespace Opm {
template <class MessageBufferType>
void read(MessageBufferType& buffer);
const Connection* find_connection(Connection::global_index connection_grid_index) const {
const auto connection = std::find_if( this->connections.begin() ,
this->connections.end() ,
[=]( const Connection& c ) {
return c.index == connection_grid_index; });
if( connection == this->connections.end() )
return nullptr;
return &*connection;
}
Connection* find_connection(Connection::global_index connection_grid_index) {
auto connection = std::find_if( this->connections.begin() ,
this->connections.end() ,
[=]( const Connection& c ) {
return c.index == connection_grid_index; });
if( connection == this->connections.end() )
return nullptr;
return &*connection;
}
bool operator==(const Well& well2) const
{
return rates == well2.rates &&
@@ -428,7 +500,7 @@ namespace Opm {
void Segment::write(MessageBufferType& buffer) const {
buffer.write(this->segNumber);
this->rates.write(buffer);
buffer.write(this->pressure);
this->pressures.write(buffer);
}
template <class MessageBufferType>
@@ -506,7 +578,7 @@ namespace Opm {
void Segment::read(MessageBufferType& buffer) {
buffer.read(this->segNumber);
this->rates.read(buffer);
buffer.read(this->pressure);
this->pressures.read(buffer);
}
template <class MessageBufferType>

View File

@@ -72,14 +72,14 @@ public:
const std::vector<std::string> restart_group_keys = {"GOPP", "GWPP", "GOPR", "GWPR", "GGPR",
"GVPR", "GWIR", "GGIR", "GWCT", "GGOR",
"GOPT", "GWPT", "GGPT", "GVPT", "GWIT",
"GGIT",
"GGIT", "GVIT",
"GOPTH", "GWPTH", "GGPTH",
"GWITH", "GGITH"};
const std::vector<std::string> restart_field_keys = {"FOPP", "FWPP", "FOPR", "FWPR", "FGPR",
"FVPR", "FWIR", "FGIR", "FWCT", "FGOR",
"FOPT", "FWPT", "FGPT", "FVPT", "FWIT",
"FGIT",
"FGIT", "FVIT",
"FOPTH", "FWPTH", "FGPTH",
"FWITH", "FGITH"};
@@ -98,6 +98,7 @@ public:
{"GVPT", 13},
{"GWIT", 15},
{"GGIT", 16},
{"GVIT", 17},
{"GOPP", 22},
{"GWPP", 23},
{"GOPTH", 135},
@@ -135,6 +136,7 @@ public:
{"FVPT", 13},
{"FWIT", 15},
{"FGIT", 16},
{"FVIT", 17},
{"FOPP", 22},
{"FWPP", 23},
{"FOPTH", 135},

View File

@@ -20,6 +20,8 @@
#ifndef OPM_OUTPUT_SUMMARY_HPP
#define OPM_OUTPUT_SUMMARY_HPP
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
#include <map>
#include <memory>
#include <string>
@@ -36,6 +38,7 @@ namespace Opm {
namespace Opm { namespace data {
class WellRates;
class Group;
}} // namespace Opm::data
namespace Opm { namespace out {
@@ -62,12 +65,14 @@ public:
const EclipseState& es,
const Schedule& schedule,
const data::WellRates& well_solution,
const data::Group& group_solution,
const GlobalProcessParameters& single_values,
const RegionParameters& region_values = {},
const BlockValues& block_values = {}) const;
void write() const;
private:
class SummaryImplementation;
std::unique_ptr<SummaryImplementation> pImpl_;

View File

@@ -49,7 +49,7 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
Diameter = 2, // Connection diameter
EffectiveKH = 3, // Effective Kh product of connection
SkinFactor = 4, // Skinfactor - item 'SKIN' from COMPDAT
item12 = 11, // Connection transmissibility factor
SegDistEnd = 20, // Distance to end of connection in segment

View File

@@ -30,6 +30,23 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
TsInit = 1, // Maximum Length of Next Timestep
TsMaxz = 2, // Maximum Length of Timestep After Next
TsMinz = 3, // Minumum Length of All Timesteps
TsMchp = 4,
TsFMax = 5,
TsFMin = 6,
TsFcnv = 7,
TrgTTE = 8,
TrgCNV = 9,
TrgMBE = 10,
TrgLCV = 11,
XxxTTE = 16,
XxxCNV = 17,
XxxMBE = 18,
XxxLCV = 19,
XxxWFL = 20,
TrgDPR = 82,
TfDiff = 83,
DdpLim = 84,
DdsLim = 85,
GRpar_a = 87, // Guiderate parameter A
GRpar_b = 88, // Guiderate parameter B
GRpar_c = 89, // Guiderate parameter C
@@ -37,6 +54,10 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
GRpar_e = 91, // Guiderate parameter E
GRpar_f = 92, // Guiderate parameter F
GRpar_int = 97, // Guiderate parameter delay interval
ThrUPT = 99,
XxxDPR = 100,
TrgFIP = 101,
TrgSFT = 102,
GRpar_damp = 144, // Guiderate parameter damping factor
UdqPar_2 = 212, // UDQPARAM item number 2 (Permitted range (+/-) of user-defined quantities)
UdqPar_3 = 213, // UDQPARAM item number 3 (Value given to undefined elements when outputting data)

View File

@@ -67,8 +67,9 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
VoidPrTotal = 13, // Group's total cumulative reservoir
// voidage production
WatInjTotal = 15, // Group's total cumulative water injection
GasInjTotal = 16, // Group's total cumulative gas injection
WatInjTotal = 15, // Group's total cumulative water injection
GasInjTotal = 16, // Group's total cumulative gas injection
VoidInjTotal = 17, // Group's total cumulative reservoir volume injection
OilPrPot = 22, // Group's oil production potential
WatPrPot = 23, // Group's water production potential

View File

@@ -62,12 +62,6 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
};
namespace Value {
enum WellType : int {
Producer = 1, // Well is producer
OilInj = 2, // Well is oil injector
WatInj = 3, // Well is water injector
GasInj = 4, // Well is gas injector
};
enum WellCtrlMode : int {
WMCtlUnk = -10, // Unknown well control mode (OPM only)
@@ -120,6 +114,9 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
DatumDepth = 9, // Well's reference depth for BHP
DrainageRadius = 17, // Well's drainage radius - item 7 from WELSPECS
EfficiencyFactor1 = 24, // Item2 from WEFAC; this value is repeated at two locations.
EfficiencyFactor2 = 31, //
HistLiqRateTarget = 33, // Well's historical/observed liquid
// rate target/limit
@@ -149,8 +146,9 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
VoidPrTotal = 21, // Well's total cumulative reservoir
// voidage production
WatInjTotal = 23, // Well's total cumulative water injection
GasInjTotal = 24, // Well's total cumulative gas injection
WatInjTotal = 23, // Well's total cumulative water injection
GasInjTotal = 24, // Well's total cumulative gas injection
VoidInjTotal = 25, // Well's total cumulative reservoir volume injection
GasFVF = 34, // Well's producing gas formation volume factor.

View File

@@ -0,0 +1,46 @@
/*
Copyright (c) 2020 Equinor ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_WRITE_RPT_HPP
#define OPM_WRITE_RPT_HPP
#include <ostream>
namespace Opm {
class Schedule;
class EclipseGrid;
namespace RptIO {
void write_report(
std::ostream&,
const std::string& report,
unsigned value,
const Schedule& schedule,
const EclipseGrid& grid,
std::size_t time_step
);
namespace workers {
void write_WELSPECS(std::ostream&, unsigned, const Schedule&, const EclipseGrid& grid, std::size_t);
} } }
#endif // OPM_WRITE_RPT_HPP

View File

@@ -22,11 +22,6 @@
#include <vector>
// Missing definitions (really belong in ert/ecl_well/well_const.h, but not
// defined there)
#define SCON_KH_INDEX 3
// Forward declarations
namespace Opm {
@@ -43,8 +38,6 @@ namespace Opm {
namespace Opm { namespace RestartIO { namespace Helpers {
const double UNIMPLEMENTED_VALUE = 1e-100; // placeholder for values not yet available
std::vector<double>
createDoubHead(const EclipseState& es,
const Schedule& sched,
@@ -52,15 +45,14 @@ namespace Opm { namespace RestartIO { namespace Helpers {
const double simTime,
const double nextTimeStep);
std::vector<int>
createInteHead(const EclipseState& es,
const EclipseGrid& grid,
const Schedule& sched,
const double simTime,
const int num_solver_steps,
const int lookup_step); // The integer index used to look up dynamic properties, e.g. the number of well.
const int report_step,
const int lookup_step);
std::vector<bool>
createLogiHead(const EclipseState& es);

View File

@@ -77,6 +77,10 @@ namespace Opm {
const DeckKeyword& getKeyword( size_t index ) const {
return getKeyword( Keyword::keywordName, index );
}
template< class Keyword >
std::size_t count() const {
return count( Keyword::keywordName );
}
const std::vector< const DeckKeyword* > getKeywordList( const std::string& keyword ) const;
template< class Keyword >
@@ -122,14 +126,9 @@ namespace Opm {
using iterator = std::vector< DeckKeyword >::iterator;
Deck();
Deck( const Deck& );
Deck(const std::vector<DeckKeyword>& keywords,
const UnitSystem& defUnits,
const UnitSystem* activeUnits,
const std::string& dataFile,
const std::string& inputPath,
size_t accessCount);
static Deck serializeObject();
Deck& operator=(const Deck& rhs);
bool operator==(const Deck& data) const;
@@ -155,9 +154,19 @@ namespace Opm {
void write( DeckOutput& output ) const ;
friend std::ostream& operator<<(std::ostream& os, const Deck& deck);
const std::vector<DeckKeyword>& keywords() const;
std::size_t unitSystemAccessCount() const;
const std::unique_ptr<UnitSystem>& activeUnitSystem() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(keywordList);
defaultUnits.serializeOp(serializer);
serializer(activeUnits);
serializer(m_dataFile);
serializer(input_path);
serializer(unit_system_access_count);
if (!serializer.isSerializing())
this->init(this->keywordList.begin(), this->keywordList.end());
}
private:
Deck(std::vector<DeckKeyword>&& keywordList);

View File

@@ -39,21 +39,14 @@ namespace Opm {
DeckItem() = default;
DeckItem( const std::string&, int);
DeckItem( const std::string&, RawString);
DeckItem( const std::string&, std::string);
DeckItem( const std::string&, double) = delete;
DeckItem( const std::string&, UDAValue) = delete;
DeckItem( const std::string&, UDAValue, const std::vector<Dimension>& active_dim, const std::vector<Dimension>& default_dim);
DeckItem( const std::string&, double, const std::vector<Dimension>& active_dim, const std::vector<Dimension>& default_dim);
DeckItem(const std::vector<double>& dVec,
const std::vector<int>& iVec,
const std::vector<std::string>& sVec,
const std::vector<UDAValue>& uVec,
type_tag type,
const std::string& itemName,
const std::vector<value::status>& valueStat,
bool rawdata,
const std::vector<Dimension>& activeDim,
const std::vector<Dimension>& defDim);
static DeckItem serializeObject();
const std::string& name() const;
@@ -88,6 +81,7 @@ namespace Opm {
void push_back( int );
void push_back( double );
void push_back( std::string );
void push_back( RawString );
void push_back( UDAValue, size_t );
void push_back( int, size_t );
void push_back( double, size_t );
@@ -96,6 +90,7 @@ namespace Opm {
void push_backDefault( int );
void push_backDefault( double );
void push_backDefault( std::string );
void push_backDefault( RawString );
// trying to access the data of a "dummy default item" will raise an exception
template <typename T>
@@ -127,16 +122,6 @@ namespace Opm {
bool operator!=(const DeckItem& other) const;
static bool to_bool(std::string string_value);
const std::vector<double>& dVal() const;
const std::vector<int>& iVal() const;
const std::vector<std::string>& sVal() const;
const std::vector<UDAValue>& uVal() const;
const std::vector<value::status>& valueStatus() const;
bool rawData() const;
const std::vector<Dimension>& activeDimensions() const;
const std::vector<Dimension>& defaultDimensions() const;
bool is_uda() { return (type == get_type< UDAValue >()); };
bool is_double() { return type == get_type< double >(); };
bool is_int() { return type == get_type< int >() ; };
@@ -144,10 +129,26 @@ namespace Opm {
UDAValue& get_uda() { return uval[0]; };
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(dval);
serializer(ival);
serializer(sval);
serializer.vector(uval);
serializer(type);
serializer(item_name);
serializer.template vector<value::status, false>(value_status);
serializer(raw_data);
serializer.vector(active_dimensions);
serializer.vector(default_dimensions);
}
private:
mutable std::vector< double > dval;
std::vector< int > ival;
std::vector< std::string > sval;
std::vector< RawString > rsval;
std::vector< UDAValue > uval;
type_tag type = type_tag::unknown;

View File

@@ -47,12 +47,8 @@ namespace Opm {
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<std::vector<DeckValue>>& record_list, UnitSystem& system_active, UnitSystem& system_default);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<int>& data);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<double>& data, UnitSystem& system_active, UnitSystem& system_default);
DeckKeyword(const std::string& kwName,
const Location& loc,
const std::vector<DeckRecord>& record,
bool dataKw,
bool slashTerminated);
static DeckKeyword serializeObject();
const std::string& name() const;
void setFixedSize();
@@ -63,13 +59,11 @@ namespace Opm {
void addRecord(DeckRecord&& record);
const DeckRecord& getRecord(size_t index) const;
DeckRecord& getRecord(size_t index);
const std::vector<DeckRecord>& records() const;
const DeckRecord& getDataRecord() const;
void setDataKeyword(bool isDataKeyword = true);
void setDoubleRecordKeyword(bool isDoubleRecordKeyword = true);
bool isDataKeyword() const;
bool isDoubleRecordKeyword() const;
bool isSlashTerminated() const;
const std::vector<int>& getIntData() const;
const std::vector<double>& getRawDoubleData() const;
@@ -97,6 +91,18 @@ namespace Opm {
bool operator!=(const DeckKeyword& other) const;
friend std::ostream& operator<<(std::ostream& os, const DeckKeyword& keyword);
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_keywordName);
m_location.serializeOp(serializer);
serializer.vector(m_recordList);
serializer(m_isDataKeyword);
serializer(m_slashTerminated);
serializer(m_isDoubleRecordKeyword);
}
private:
std::string m_keywordName;
Location m_location;

View File

@@ -36,6 +36,8 @@ namespace Opm {
DeckRecord() = default;
DeckRecord( std::vector< DeckItem >&& );
static DeckRecord serializeObject();
size_t size() const;
void addItem( DeckItem deckItem );
@@ -70,7 +72,11 @@ namespace Opm {
bool operator==(const DeckRecord& other) const;
bool operator!=(const DeckRecord& other) const;
const std::vector<DeckItem>& getItems() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_items);
}
private:
std::vector< DeckItem > m_items;

View File

@@ -34,10 +34,12 @@ public:
UDAValue();
explicit UDAValue(double);
explicit UDAValue(const std::string&);
UDAValue(const UDAValue& src, const Dimension& dim);
explicit UDAValue(const Dimension& dim);
UDAValue(double data, const Dimension& dim);
UDAValue(const std::string& data, const Dimension& dim);
static UDAValue serializeObject();
/*
The get<double>() and get<std::string>() methods will throw an
exception if the internal type and the template parameter disagree.
@@ -55,25 +57,31 @@ public:
template<typename T>
bool is() const;
void reset(double value);
void reset(const std::string& value);
void assert_numeric() const;
void assert_numeric(const std::string& error_msg) const;
const Dimension& get_dim() const;
bool operator==(const UDAValue& other) const;
bool operator!=(const UDAValue& other) const;
UDAValue& operator=(double value);
UDAValue& operator=(const std::string& value);
bool is_numeric() { return numeric_value; }
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(numeric_value);
serializer(double_value);
serializer(string_value);
dim.serializeOp(serializer);
}
private:
bool numeric_value;
double double_value;
std::string string_value;
/* This 'mutable' modifier is a hack to avoid tampering with the overall
const-ness of the data in a deck item. */
Dimension dim;
};

View File

@@ -66,6 +66,15 @@ namespace Opm {
this->face_dir == other.face_dir;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(aquiferID);
serializer(global_index);
serializer(influx_coeff);
serializer(influx_mult);
serializer(face_dir);
}
};
@@ -73,13 +82,21 @@ namespace Opm {
Aquancon(const EclipseGrid& grid, const Deck& deck);
Aquancon(const std::unordered_map<int, std::vector<Aquancon::AquancCell>>& data);
static Aquancon serializeObject();
const std::unordered_map<int, std::vector<Aquancon::AquancCell>>& data() const;
bool operator==(const Aquancon& other) const;
bool active() const;
const std::vector<Aquancon::AquancCell> operator[](int aquiferID) const;
private:
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.map(cells);
}
private:
static bool cellInsideReservoirAndActive(const EclipseGrid& grid, int i, int j, int k);
static bool neighborCellInsideReservoirAndActive(const EclipseGrid& grid, int i, int j, int k, FaceDir::DirEnum faceDir);

View File

@@ -83,16 +83,47 @@ namespace Opm {
std::vector<int> cell_id;
bool operator==(const AQUCT_data& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(aquiferID);
serializer(inftableID);
serializer(pvttableID);
serializer(phi_aq);
serializer(d0);
serializer(C_t);
serializer(r_o);
serializer(k_a);
serializer(c1);
serializer(h);
serializer(theta);
serializer(c2);
serializer(p0);
serializer(td);
serializer(pi);
serializer(cell_id);
}
};
AquiferCT() = default;
AquiferCT(const TableManager& tables, const Deck& deck);
AquiferCT(const std::vector<AquiferCT::AQUCT_data>& data);
static AquiferCT serializeObject();
std::size_t size() const;
std::vector<AquiferCT::AQUCT_data>::const_iterator begin() const;
std::vector<AquiferCT::AQUCT_data>::const_iterator end() const;
const std::vector<AquiferCT::AQUCT_data>& data() const;
bool operator==(const AquiferCT& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_aquct);
}
private:
std::vector<AquiferCT::AQUCT_data> m_aquct;
};

View File

@@ -36,11 +36,22 @@ public:
AquiferConfig(const TableManager& tables, const EclipseGrid& grid, const Deck& deck);
AquiferConfig(const Aquifetp& fetp, const AquiferCT& ct, const Aquancon& conn);
static AquiferConfig serializeObject();
bool active() const;
const AquiferCT& ct() const;
const Aquifetp& fetp() const;
const Aquancon& connections() const;
bool operator==(const AquiferConfig& other);
template<class Serializer>
void serializeOp(Serializer& serializer)
{
aquifetp.serializeOp(serializer);
aquiferct.serializeOp(serializer);
aqconn.serializeOp(serializer);
}
private:
Aquifetp aquifetp;
AquiferCT aquiferct;

View File

@@ -49,17 +49,39 @@ class Aquifetp {
V0, // initial volume of water in aquifer
d0; // aquifer datum depth
std::pair<bool, double> p0;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(aquiferID);
serializer(pvttableID);
serializer(J);
serializer(C_t);
serializer(V0);
serializer(d0);
serializer(p0);
}
};
Aquifetp() = default;
Aquifetp(const Deck& deck);
Aquifetp(const std::vector<Aquifetp::AQUFETP_data>& data);
static Aquifetp serializeObject();
const std::vector<Aquifetp::AQUFETP_data>& data() const;
std::size_t size() const;
std::vector<Aquifetp::AQUFETP_data>::const_iterator begin() const;
std::vector<Aquifetp::AQUFETP_data>::const_iterator end() const;
bool operator==(const Aquifetp& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_aqufetp);
}
private:
std::vector<Aquifetp::AQUFETP_data> m_aqufetp;
};

View File

@@ -36,6 +36,8 @@ namespace Opm {
EclipseConfig(const Deck& deck);
EclipseConfig(const InitConfig& initConfig, const IOConfig& io_conf);
static EclipseConfig serializeObject();
const InitConfig& init() const;
IOConfig& io();
const IOConfig& io() const;
@@ -43,6 +45,13 @@ namespace Opm {
bool operator==(const EclipseConfig& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
m_initConfig.serializeOp(serializer);
io_config.serializeOp(serializer);
}
private:
InitConfig m_initConfig;
IOConfig io_config;

View File

@@ -26,6 +26,7 @@
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/EclipseState/AquiferConfig.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseConfig.hpp>
#include <opm/parser/eclipse/EclipseState/TracerConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Edit/EDITNNC.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
@@ -70,6 +71,7 @@ namespace Opm {
EclipseState() = default;
EclipseState(const Deck& deck);
virtual ~EclipseState() = default;
const IOConfig& getIOConfig() const;
IOConfig& getIOConfig();
@@ -112,6 +114,27 @@ namespace Opm {
const Runspec& runspec() const;
const AquiferConfig& aquifer() const;
const TracerConfig& tracer() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
// FieldPropsManager is handled otherwise, do not add
m_tables.serializeOp(serializer);
m_runspec.serializeOp(serializer);
m_eclipseConfig.serializeOp(serializer);
m_deckUnitSystem.serializeOp(serializer);
m_inputNnc.serializeOp(serializer);
m_inputEditNnc.serializeOp(serializer);
m_gridDims.serializeOp(serializer);
m_simulationConfig.serializeOp(serializer);
m_transMult.serializeOp(serializer);
m_faults.serializeOp(serializer);
serializer(m_title);
aquifer_config.serializeOp(serializer);
tracer_config.serializeOp(serializer);
}
private:
void initIOConfigPostSchedule(const Deck& deck);
void initTransMult();
@@ -138,6 +161,7 @@ namespace Opm {
FaultCollection m_faults;
std::string m_title;
AquiferConfig aquifer_config;
TracerConfig tracer_config;
};
}

View File

@@ -32,7 +32,8 @@ public:
/// Construct from input deck
explicit EDITNNC(const Deck& deck);
explicit EDITNNC(const std::vector<NNCdata>& data);
/// Returns an instance used for serialization test
static EDITNNC serializeObject();
/// \brief Get an ordered set of EDITNNC
const std::vector<NNCdata>& data() const
@@ -46,6 +47,12 @@ public:
bool operator==(const EDITNNC& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_editnnc);
}
private:
std::vector<NNCdata> m_editnnc;
};

View File

@@ -29,7 +29,8 @@ class EndpointScaling {
public:
EndpointScaling() noexcept = default;
explicit EndpointScaling( const Deck& );
EndpointScaling(const std::bitset<4>& opts);
static EndpointScaling serializeObject();
/* true if endpoint scaling is enabled, otherwise false */
operator bool() const noexcept;
@@ -41,10 +42,20 @@ class EndpointScaling {
bool twopoint() const noexcept;
bool threepoint() const noexcept;
unsigned long getBits() const;
bool operator==(const EndpointScaling& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
if (serializer.isSerializing())
serializer(options.to_ulong());
else {
unsigned long bits = 0;
serializer(bits);
options = std::bitset<4>(bits);
}
}
private:
enum class option {
any = 0,

View File

@@ -154,6 +154,7 @@ namespace Opm {
std::array<double, 3> getCellCenter(size_t i,size_t j, size_t k) const;
std::array<double, 3> getCellCenter(size_t globalIndex) const;
std::array<double, 3> getCornerPos(size_t i,size_t j, size_t k, size_t corner_index) const;
std::vector<double> activeVolume() const;
double getCellVolume(size_t globalIndex) const;
double getCellVolume(size_t i , size_t j , size_t k) const;
double getCellThickness(size_t globalIndex) const;
@@ -214,43 +215,38 @@ namespace Opm {
std::vector<int> m_global_to_active;
void initGridFromEGridFile(Opm::EclIO::EclFile& egridfile, std::string fileName);
void resetACTNUM( const int* actnum);
void initBinaryGrid(const Deck& deck);
void initCornerPointGrid(const std::array<int,3>& dims ,
const std::vector<double>& coord ,
void initCornerPointGrid(const std::vector<double>& coord ,
const std::vector<double>& zcorn ,
const int * actnum,
const double * mapaxes);
bool keywInputBeforeGdfile(const Deck& deck, const std::string keyword) const;
void initCylindricalGrid( const std::array<int, 3>&, const Deck&);
void initCartesianGrid( const std::array<int, 3>&, const Deck&);
void initCornerPointGrid( const std::array<int, 3>&, const Deck&);
void initDTOPSGrid( const std::array<int, 3>&, const Deck&);
void initDVDEPTHZGrid( const std::array<int, 3>&, const Deck&);
void initGrid( const std::array<int, 3>&, const Deck&);
void assertCornerPointKeywords( const std::array<int, 3>&, const Deck&);
void initCylindricalGrid(const Deck&);
void initCartesianGrid(const Deck&);
void initDTOPSGrid(const Deck&);
void initDVDEPTHZGrid(const Deck&);
void initGrid(const Deck&);
void initCornerPointGrid(const Deck&);
void assertCornerPointKeywords(const Deck&);
static bool hasDVDEPTHZKeywords(const Deck&);
static bool hasDTOPSKeywords( const Deck&);
static void assertVectorSize( const std::vector<double>& vector, size_t expectedSize, const std::string& msg);
static std::vector<double> createTOPSVector(const std::array<int, 3>& dims, const std::vector<double>& DZ,
const Deck&);
static std::vector<double> createDVector(const std::array<int, 3>& dims, size_t dim, const std::string& DKey,
const std::string& DVKey, const Deck&);
static bool hasDTOPSKeywords(const Deck&);
static void assertVectorSize(const std::vector<double>& vector, size_t expectedSize, const std::string& msg);
static std::vector<double> createTOPSVector(const std::array<int, 3>& dims, const std::vector<double>& DZ, const Deck&);
static std::vector<double> createDVector(const std::array<int, 3>& dims, std::size_t dim, const std::string& DKey, const std::string& DVKey, const Deck&);
static void scatterDim(const std::array<int, 3>& dims , size_t dim , const std::vector<double>& DV , std::vector<double>& D);
std::vector<double> makeCoordDxDyDzTops(const std::array<int, 3>& dims, const std::vector<double>& dx, const std::vector<double>& dy, const std::vector<double>& dz, const std::vector<double>& tops) const;
std::vector<double> makeZcornDzTops(const std::array<int, 3>& dims, const std::vector<double>& dz, const std::vector<double>& tops) const ;
std::vector<double> makeZcornDzvDepthz(const std::array<int, 3>& dims, const std::vector<double>& dzv, const std::vector<double>& depthz) const;
std::vector<double> makeCoordDxvDyvDzvDepthz(const std::array<int, 3>& dims, const std::vector<double>& dxv, const std::vector<double>& dyv, const std::vector<double>& dzv, const std::vector<double>& depthz) const;
double sumIdir(int j, int k, int i1, const std::array<int, 3>& dims, const std::vector<double>& dx) const;
double sumJdir(int i, int k, int j1, const std::array<int, 3>& dims, const std::vector<double>& dy) const;
double sumKdir(int i, int j, const std::array<int, 3>& dims, const std::vector<double>& dz) const;
std::vector<double> makeCoordDxDyDzTops(const std::vector<double>& dx, const std::vector<double>& dy, const std::vector<double>& dz, const std::vector<double>& tops) const;
std::vector<double> makeZcornDzTops(const std::vector<double>& dz, const std::vector<double>& tops) const ;
std::vector<double> makeZcornDzvDepthz(const std::vector<double>& dzv, const std::vector<double>& depthz) const;
std::vector<double> makeCoordDxvDyvDzvDepthz(const std::vector<double>& dxv, const std::vector<double>& dyv, const std::vector<double>& dzv, const std::vector<double>& depthz) const;
void getCellCorners(const std::array<int, 3>& ijk, const std::array<int, 3>& dims, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z) const;
void getCellCorners(const std::size_t globalIndex,

View File

@@ -34,9 +34,8 @@ class Fault {
public:
Fault() = default;
explicit Fault(const std::string& faultName);
Fault(const std::string& name,
double transMult,
const std::vector<FaultFace>& faceList);
static Fault serializeObject();
const std::string& getName() const;
void setTransMult(double transMult);
@@ -44,11 +43,18 @@ public:
void addFace( FaultFace );
std::vector< FaultFace >::const_iterator begin() const;
std::vector< FaultFace >::const_iterator end() const;
const std::vector<FaultFace>& getFaceList() const;
bool operator==( const Fault& rhs ) const;
bool operator!=( const Fault& rhs ) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_name);
serializer(m_transMult);
serializer.vector(m_faceList);
}
private:
std::string m_name;
double m_transMult = 0.0;

View File

@@ -36,7 +36,8 @@ class FaultCollection {
public:
FaultCollection();
FaultCollection(const GRIDSection& gridSection, const GridDims& grid);
FaultCollection(const OrderedMap<std::string, Fault>& faults);
static FaultCollection serializeObject();
size_t size() const;
bool hasFault(const std::string& faultName) const;
@@ -49,10 +50,14 @@ public:
void addFault(const std::string& faultName);
void setTransMult(const std::string& faultName , double transMult);
const OrderedMap<std::string, Fault>& getFaults() const;
bool operator==(const FaultCollection& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
m_faults.serializeOp(serializer);
}
private:
void addFaultFaces(const GridDims& grid,
const DeckRecord& faultRecord,

View File

@@ -35,16 +35,23 @@ public:
size_t J1 , size_t J2,
size_t K1 , size_t K2,
FaceDir::DirEnum faceDir);
FaultFace(const std::vector<size_t>& indices, FaceDir::DirEnum faceDir);
static FaultFace serializeObject();
std::vector<size_t>::const_iterator begin() const;
std::vector<size_t>::const_iterator end() const;
FaceDir::DirEnum getDir() const;
const std::vector<size_t>& getIndices() const;
bool operator==( const FaultFace& rhs ) const;
bool operator!=( const FaultFace& rhs ) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_faceDir);
serializer(m_indexList);
}
private:
static void checkCoord(size_t dim , size_t l1 , size_t l2);
FaceDir::DirEnum m_faceDir = FaceDir::XPlus;

View File

@@ -34,9 +34,10 @@ namespace Opm {
GridDims();
explicit GridDims(std::array<int, 3> xyz);
GridDims(size_t nx, size_t ny, size_t nz);
static GridDims serializeObject();
explicit GridDims(const Deck& deck);
size_t getNX() const;
@@ -59,6 +60,14 @@ namespace Opm {
bool operator==(const GridDims& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_nx);
serializer(m_ny);
serializer(m_nz);
}
protected:
size_t m_nx;
size_t m_ny;

View File

@@ -66,6 +66,17 @@ namespace Opm {
nnc_behaviour == data.nnc_behaviour &&
region_name == data.region_name;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(src_value);
serializer(target_value);
serializer(trans_mult);
serializer(directions);
serializer(nnc_behaviour);
serializer(region_name);
}
};
typedef std::map< std::pair<int , int> , const MULTREGTRecord * > MULTREGTSearchMap;
@@ -83,24 +94,31 @@ namespace Opm {
MULTREGTScanner(const GridDims& grid,
const FieldPropsManager* fp_arg,
const std::vector< const DeckKeyword* >& keywords);
MULTREGTScanner(const std::array<size_t,3>& size,
const std::vector<MULTREGTRecord>& records,
const ExternalSearchMap& searchMap,
const std::map<std::string, std::vector<int>>& region,
const std::string& defaultRegion);
static MULTREGTScanner serializeObject();
double getRegionMultiplier(size_t globalCellIdx1, size_t globalCellIdx2, FaceDir::DirEnum faceDir) const;
std::array<size_t,3> getSize() const;
const std::vector<MULTREGTRecord>& getRecords() const;
ExternalSearchMap getSearchMap() const;
const std::map<std::string, std::vector<int>>& getRegions() const;
const std::string& getDefaultRegion() const;
bool operator==(const MULTREGTScanner& data) const;
MULTREGTScanner& operator=(const MULTREGTScanner& data);
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(nx);
serializer(ny);
serializer(nz);
serializer.vector(m_records);
ExternalSearchMap searchMap = getSearchMap();
serializer(searchMap);
if (m_searchMap.empty())
constructSearchMap(searchMap);
serializer(regions);
serializer(default_region);
}
private:
ExternalSearchMap getSearchMap() const;
void constructSearchMap(const ExternalSearchMap& searchMap);
void addKeyword( const DeckKeyword& deckKeyword, const std::string& defaultRegion);

View File

@@ -40,6 +40,14 @@ struct NNCdata {
trans == data.trans;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(cell1);
serializer(cell2);
serializer(trans);
}
size_t cell1;
size_t cell2;
double trans;
@@ -56,7 +64,9 @@ public:
/// Construct from input deck.
explicit NNC(const Deck& deck);
explicit NNC(const std::vector<NNCdata>& nncdata) : m_nnc(nncdata) {}
static NNC serializeObject();
void addNNC(const size_t cell1, const size_t cell2, const double trans);
const std::vector<NNCdata>& data() const { return m_nnc; }
size_t numNNC() const;
@@ -64,6 +74,12 @@ public:
bool operator==(const NNC& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_nnc);
}
private:
std::vector<NNCdata> m_nnc;

View File

@@ -49,10 +49,8 @@ namespace Opm {
public:
TransMult() = default;
TransMult(const GridDims& dims, const Deck& deck, const FieldPropsManager& fp);
TransMult(const std::array<size_t,3>& size,
const std::map<FaceDir::DirEnum, std::vector<double>>& trans,
const std::map<FaceDir::DirEnum, std::string>& names,
const MULTREGTScanner& scanner);
static TransMult serializeObject();
double getMultiplier(size_t globalIndex, FaceDir::DirEnum faceDir) const;
double getMultiplier(size_t i , size_t j , size_t k, FaceDir::DirEnum faceDir) const;
@@ -61,13 +59,20 @@ namespace Opm {
void applyMULTFLT(const FaultCollection& faults);
void applyMULTFLT(const Fault& fault);
std::array<size_t,3> getSize() const;
const std::map<FaceDir::DirEnum, std::vector<double>>& getTrans() const;
const std::map<FaceDir::DirEnum, std::string>& getNames() const;
const MULTREGTScanner& getScanner() const;
bool operator==(const TransMult& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_nx);
serializer(m_ny);
serializer(m_nz);
// map used to avoid explicit instances with FaceDir::DirEnum in serializer
serializer.template map<decltype(m_trans),false>(m_trans);
serializer.template map<decltype(m_names),false>(m_names);
m_multregtScanner.serializeOp(serializer);
}
private:
size_t getGlobalIndex(size_t i , size_t j , size_t k) const;
void assertIJK(size_t i , size_t j , size_t k) const;

View File

@@ -151,15 +151,8 @@ namespace Opm {
IOConfig() = default;
explicit IOConfig( const Deck& );
explicit IOConfig( const std::string& input_path );
IOConfig(bool write_init, bool write_egrid,
bool unifin, bool unifout,
bool fmtin, bool fmtout,
const std::string& deck_name,
bool output_enabled,
const std::string& output_dir,
bool no_sim,
const std::string& base_name,
bool ecl_compatible_rst);
static IOConfig serializeObject();
void setEclCompatibleRST(bool ecl_rst);
bool getEclCompatibleRST() const;
@@ -169,8 +162,6 @@ namespace Opm {
bool getUNIFIN() const;
bool getFMTIN() const;
bool getFMTOUT() const;
const std::string& getDeckFileName() const;
bool getNoSim() const;
const std::string& getEclipseInputPath() const;
void overrideNOSIM(bool nosim);
@@ -195,6 +186,23 @@ namespace Opm {
bool operator==(const IOConfig& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_write_INIT_file);
serializer(m_write_EGRID_file);
serializer(m_UNIFIN);
serializer(m_UNIFOUT);
serializer(m_FMTIN);
serializer(m_FMTOUT);
serializer(m_deck_filename);
serializer(m_output_enabled);
serializer(m_output_dir);
serializer(m_nosim);
serializer(m_base_name);
serializer(ecl_compatible_rst);
}
private:
bool m_write_INIT_file = false;
bool m_write_EGRID_file = true;

View File

@@ -298,11 +298,22 @@ namespace Opm {
RestartSchedule() = default;
explicit RestartSchedule( size_t sched_restart);
RestartSchedule( size_t step, size_t b, size_t freq);
static RestartSchedule serializeObject();
bool writeRestartFile( size_t timestep , const TimeMap& timemap) const;
bool operator!=(const RestartSchedule& rhs) const;
bool operator==( const RestartSchedule& rhs ) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(timestep);
serializer(basic);
serializer(frequency);
serializer(rptsched_restart_set);
serializer(rptsched_restart);
}
//private:
size_t timestep = 0;
@@ -322,12 +333,8 @@ namespace Opm {
RestartConfig( const TimeMap& time_map, const Deck&, const ParseContext& parseContext, T&& errors );
RestartConfig( const TimeMap& time_map, const Deck&, const ParseContext& parseContext, ErrorGuard& errors );
RestartConfig( const TimeMap& time_map, const Deck& );
RestartConfig(const TimeMap& timeMap,
int firstRestartStep,
bool writeInitial,
const DynamicState<RestartSchedule>& restart_sched,
const DynamicState<std::map<std::string,int>>& restart_keyw,
const std::vector<bool>& save_keyw);
static RestartConfig serializeObject();
int getFirstRestartStep() const;
bool getWriteRestartFile(size_t timestep, bool log=true) const;
@@ -341,17 +348,20 @@ namespace Opm {
RestartSchedule getNode( size_t timestep ) const;
static std::string getRestartFileName(const std::string& restart_base, int report_step, bool unified, bool fmt_file);
const TimeMap& timeMap() const;
bool writeInitialRst() const;
const DynamicState<RestartSchedule>& restartSchedule() const;
const DynamicState<std::map<std::string,int>>& restartKeywords() const;
const std::vector<bool>& saveKeywords() const;
bool operator==(const RestartConfig& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
m_timemap.serializeOp(serializer);
serializer(m_first_restart_step);
serializer(m_write_initial_RST_file);
restart_schedule.serializeOp(serializer);
restart_keywords.serializeOp<Serializer, false>(serializer);
serializer(save_keywords);
}
private:
/// This method will internalize variables with information of
/// the first report step with restart and rft output
/// respectively. This information is important because right

View File

@@ -25,6 +25,20 @@ namespace Opm {
bool operator==(const EquilRecord& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(datum_depth);
serializer(datum_depth_ps);
serializer(water_oil_contact_depth);
serializer(water_oil_contact_capillary_pressure);
serializer(gas_oil_contact_depth);
serializer(gas_oil_contact_capillary_pressure);
serializer(live_oil_init_proc);
serializer(wet_gas_init_proc);
serializer(init_target_accuracy);
}
private:
double datum_depth;
double datum_depth_ps;
@@ -44,10 +58,10 @@ namespace Opm {
Equil() = default;
explicit Equil( const DeckKeyword& );
Equil(const std::vector<EquilRecord>& records);
static Equil serializeObject();
const EquilRecord& getRecord( size_t id ) const;
const std::vector<EquilRecord>& records() const;
size_t size() const;
bool empty() const;
@@ -57,6 +71,12 @@ namespace Opm {
bool operator==(const Equil& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_records);
}
private:
std::vector< EquilRecord > m_records;
};

View File

@@ -20,6 +20,8 @@
#ifndef OPM_FOAMCONFIG_HPP
#define OPM_FOAMCONFIG_HPP
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
#include <cstddef>
#include <vector>
@@ -36,11 +38,8 @@ public:
FoamData();
FoamData(const DeckRecord& FOAMFSC_record, const DeckRecord& FOAMROCK_record);
explicit FoamData(const DeckRecord& FOAMROCK_record);
FoamData(double reference_surfactant_concentration,
double exponent,
double minimum_surfactant_concentration,
bool allow_desorption,
double rock_density);
static FoamData serializeObject();
double referenceSurfactantConcentration() const;
double exponent() const;
@@ -51,6 +50,16 @@ public:
bool operator==(const FoamData& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(reference_surfactant_concentration_);
serializer(exponent_);
serializer(minimum_surfactant_concentration_);
serializer(allow_desorption_);
serializer(rock_density_);
}
private:
double reference_surfactant_concentration_;
double exponent_;
@@ -63,12 +72,20 @@ private:
class FoamConfig
{
public:
enum class MobilityModel {
TAB,
FUNC
};
FoamConfig() = default;
explicit FoamConfig(const Deck&);
FoamConfig(const std::vector<FoamData>& data);
static FoamConfig serializeObject();
const FoamData& getRecord(std::size_t index) const;
const std::vector<FoamData>& records() const;
Opm::Phase getTransportPhase() const;
MobilityModel getMobilityModel() const;
std::size_t size() const;
bool empty() const;
@@ -79,8 +96,18 @@ public:
bool operator==(const FoamConfig& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(data_);
serializer(transport_phase_);
serializer(mobility_model_);
}
private:
std::vector<FoamData> data_;
Phase transport_phase_ = Phase::GAS;
MobilityModel mobility_model_ = MobilityModel::TAB;
};
} // end namespace Opm

View File

@@ -34,9 +34,8 @@ namespace Opm {
public:
InitConfig();
explicit InitConfig(const Deck& deck);
InitConfig(const Equil& equil, const FoamConfig& foam,
bool filleps, bool gravity, bool restartReq, int restartStep,
const std::string& restartRootName);
static InitConfig serializeObject();
void setRestart( const std::string& root, int step);
bool restartRequested() const;
@@ -58,6 +57,18 @@ namespace Opm {
bool operator==(const InitConfig& config) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
equil.serializeOp(serializer);
foamconfig.serializeOp(serializer);
serializer(m_filleps);
serializer(m_gravity);
serializer(m_restartRequested);
serializer(m_restartStep);
serializer(m_restartRootName);
}
private:
Equil equil;
FoamConfig foamconfig;

View File

@@ -54,14 +54,26 @@ class Phases {
Phases() noexcept = default;
Phases( bool oil, bool gas, bool wat, bool solvent = false, bool polymer = false, bool energy = false,
bool polymw = false, bool foam = false, bool brine = false ) noexcept;
Phases(const std::bitset<NUM_PHASES_IN_ENUM>& bbits);
unsigned long getBits() const;
static Phases serializeObject();
bool active( Phase ) const noexcept;
size_t size() const noexcept;
bool operator==(const Phases& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
if (serializer.isSerializing())
serializer(bits.to_ulong());
else {
unsigned long Bits = 0;
serializer(Bits);
bits = std::bitset<NUM_PHASES_IN_ENUM>(Bits);
}
}
private:
std::bitset< NUM_PHASES_IN_ENUM > bits;
};
@@ -71,8 +83,8 @@ class Welldims {
public:
Welldims() = default;
explicit Welldims(const Deck& deck);
Welldims(int WMax, int CWMax, int WGMax, int GMax) :
nWMax(WMax), nCWMax(CWMax), nWGMax(WGMax), nGMax(GMax) {}
static Welldims serializeObject();
int maxConnPerWell() const
{
@@ -89,7 +101,7 @@ public:
return this->nGMax;
}
int maxWellsInField() const
int maxWellsInField() const
{
return this->nWMax;
}
@@ -101,6 +113,15 @@ public:
this->maxWellsInField() == data.maxWellsInField();
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(nWMax);
serializer(nCWMax);
serializer(nWGMax);
serializer(nGMax);
}
private:
int nWMax { 0 };
int nCWMax { 0 };
@@ -112,7 +133,8 @@ class WellSegmentDims {
public:
WellSegmentDims();
explicit WellSegmentDims(const Deck& deck);
WellSegmentDims(int segWellMax, int segMax, int latBranchMax);
static WellSegmentDims serializeObject();
int maxSegmentedWells() const
@@ -132,6 +154,14 @@ public:
bool operator==(const WellSegmentDims& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(nSegWellMax);
serializer(nSegmentMax);
serializer(nLatBranchMax);
}
private:
int nSegWellMax;
int nSegmentMax;
@@ -143,8 +173,8 @@ class EclHysterConfig
public:
EclHysterConfig() = default;
explicit EclHysterConfig(const Deck& deck);
EclHysterConfig(bool active, int pcMod, int krMod);
static EclHysterConfig serializeObject();
/*!
* \brief Specify whether hysteresis is enabled or not.
@@ -174,6 +204,14 @@ public:
bool operator==(const EclHysterConfig& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(activeHyst);
serializer(pcHystMod);
serializer(krHystMod);
}
private:
// enable hysteresis at all
bool activeHyst { false };
@@ -185,34 +223,50 @@ private:
class SatFuncControls {
public:
enum class ThreePhaseOilKrModel {
Default,
Stone1,
Stone2
};
SatFuncControls();
explicit SatFuncControls(const Deck& deck);
explicit SatFuncControls(const double tolcritArg);
SatFuncControls(const double tolcritArg,
ThreePhaseOilKrModel model);
static SatFuncControls serializeObject();
double minimumRelpermMobilityThreshold() const
{
return this->tolcrit;
}
ThreePhaseOilKrModel krModel() const
{
return this->krmodel;
}
bool operator==(const SatFuncControls& rhs) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(tolcrit);
serializer(krmodel);
}
private:
double tolcrit;
ThreePhaseOilKrModel krmodel = ThreePhaseOilKrModel::Default;
};
class Runspec {
public:
Runspec() = default;
explicit Runspec( const Deck& );
Runspec(const Phases& act_phases,
const Tabdims& tabdims,
const EndpointScaling& endScale,
const Welldims& wellDims,
const WellSegmentDims& wsegDims,
const UDQParams& udqparams,
const EclHysterConfig& hystPar,
const Actdims& actDims,
const SatFuncControls& sfuncctrl);
static Runspec serializeObject();
const UDQParams& udqParams() const noexcept;
const Phases& phases() const noexcept;
@@ -227,6 +281,20 @@ public:
bool operator==(const Runspec& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
active_phases.serializeOp(serializer);
m_tabdims.serializeOp(serializer);
endscale.serializeOp(serializer);
welldims.serializeOp(serializer);
wsegdims.serializeOp(serializer);
udq_params.serializeOp(serializer);
hystpar.serializeOp(serializer);
m_actdims.serializeOp(serializer);
m_sfuncctrl.serializeOp(serializer);
}
private:
Phases active_phases;
Tabdims m_tabdims;

View File

@@ -17,9 +17,8 @@ public:
ASTNode(TokenType type_arg);
ASTNode(double value);
ASTNode(TokenType type_arg, FuncType func_type_arg, const std::string& func_arg, const std::vector<std::string>& arg_list_arg);
ASTNode(TokenType type_arg, FuncType ftype, const std::string& func_arg,
const std::vector<std::string>& args, double number,
const std::vector<ASTNode>& childs);
static ASTNode serializeObject();
Action::Result eval(const Action::Context& context) const;
Action::Value value(const Action::Context& context) const;
@@ -29,12 +28,19 @@ public:
size_t size() const;
std::string func;
const std::vector<std::string>& argList() const;
const std::vector<ASTNode>& childrens() const;
double getNumber() const;
bool operator==(const ASTNode& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(type);
serializer(func_type);
serializer(func);
serializer(arg_list);
serializer(number);
serializer.vector(children);
}
private:
std::vector<std::string> arg_list;
double number = 0.0;

View File

@@ -28,8 +28,8 @@ class Actdims {
public:
Actdims();
explicit Actdims(const Deck& deck);
Actdims(std::size_t keyw, std::size_t line_cnt,
std::size_t chars, std::size_t conds);
static Actdims serializeObject();
std::size_t max_keywords() const;
std::size_t max_line_count() const;
@@ -38,6 +38,15 @@ public:
bool operator==(const Actdims& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(keywords);
serializer(line_count);
serializer(characters);
serializer(conditions);
}
private:
std::size_t keywords;
std::size_t line_count;

View File

@@ -44,12 +44,19 @@ class AST{
public:
AST() = default;
explicit AST(const std::vector<std::string>& tokens);
AST(const std::shared_ptr<ASTNode>& cond);
static AST serializeObject();
Result eval(const Context& context) const;
std::shared_ptr<ASTNode> getCondition() const;
bool operator==(const AST& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(condition);
}
private:
/*
The use of a pointer here is to be able to create this class with only a

View File

@@ -67,15 +67,8 @@ public:
ActionX(const std::string& name, size_t max_run, double max_wait, std::time_t start_time);
ActionX(const DeckKeyword& kw, std::time_t start_time);
ActionX(const DeckRecord& record, std::time_t start_time);
ActionX(const std::string& nam,
size_t maxRun,
double minWait,
std::time_t startTime,
const std::vector<DeckKeyword>& keyword,
const AST& cond,
const std::vector<Condition>& conditions,
size_t runCount,
std::time_t lastRun);
static ActionX serializeObject();
void addKeyword(const DeckKeyword& kw);
bool ready(std::time_t sim_time) const;
@@ -94,15 +87,25 @@ public:
The conditions() and keyword_strings() methods, and their underlying data
members are only present to support writing formatted restart files.
*/
const std::vector<DeckKeyword>& getKeywords() const;
const std::vector<Condition>& conditions() const;
const Action::AST& getCondition() const;
std::vector<std::string> keyword_strings() const;
size_t getRunCount() const;
std::time_t getLastRun() const;
bool operator==(const ActionX& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_name);
serializer(m_max_run);
serializer(m_min_wait);
serializer(m_start_time);
serializer.vector(keywords);
condition.serializeOp(serializer);
serializer.vector(m_conditions);
serializer(run_count);
serializer(last_run);
}
private:
std::string m_name;
size_t m_max_run = 0;

View File

@@ -26,6 +26,7 @@
#include <vector>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.hpp>
namespace Opm {
namespace Action {
@@ -38,25 +39,36 @@ namespace Action {
class Actions {
public:
Actions() = default;
Actions(const std::vector<ActionX>& action);
Actions(const std::vector<ActionX>& action, const std::vector<PyAction>& pyactions);
static Actions serializeObject();
size_t size() const;
int max_input_lines() const;
bool empty() const;
void add(const ActionX& action);
void add(const PyAction& pyaction);
bool ready(std::time_t sim_time) const;
const ActionX& get(const std::string& name) const;
const ActionX& get(std::size_t index) const;
std::vector<const ActionX *> pending(std::time_t sim_time) const;
std::vector<const PyAction *> pending_python() const;
std::vector<ActionX>::const_iterator begin() const;
std::vector<ActionX>::const_iterator end() const;
const std::vector<ActionX>& getActions() const;
bool operator==(const Actions& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(actions);
serializer.vector(pyactions);
}
private:
std::vector<ActionX> actions;
std::vector<PyAction> pyactions;
};
}
}

View File

@@ -46,6 +46,13 @@ public:
return quantity == data.quantity &&
args == data.args;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(quantity);
serializer(args);
}
};
@@ -80,6 +87,16 @@ enum class Comparator {
std::string cmp_string;
bool operator==(const Condition& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
lhs.serializeOp(serializer);
rhs.serializeOp(serializer);
serializer(logic);
serializer(cmp);
serializer(cmp_string);
}
};

View File

@@ -23,30 +23,56 @@
#include <string>
#include <memory>
namespace Opm {
class Python;
class EclipseState;
class Schedule;
class SummaryState;
class PyRunModule;
namespace Action {
class PyAction {
public:
explicit PyAction(const std::string& code_arg);
const std::string& code() const;
~PyAction();
enum class RunCount {
single,
unlimited,
first_true
};
/*
Storage is a void pointer to a Python dictionary: py::dict. It is represented
with a void pointer in this way to avoid adding the Pybind11 headers to this
file. Calling scope must do a cast before using the storage pointer:
py::dict * storage = static_cast<py::dict *>(py_action.storage());
static RunCount from_string(std::string run_count);
static PyAction serializeObject();
PyAction() = default;
PyAction(std::shared_ptr<const Python> python, const std::string& name, RunCount run_count, const std::string& module_file);
bool run(EclipseState& ecl_state, Schedule& schedule, std::size_t report_step, SummaryState& st) const;
const std::string& name() const;
bool active() const;
bool operator==(const PyAction& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_name);
serializer(m_run_count);
serializer(module_file);
serializer(m_active);
}
The purpose of this dictionary is to allow PYACTION scripts to store state
between invocations.
*/
void * storage() const;
private:
std::string input_code;
void * m_storage;
void update(bool result) const;
mutable std::shared_ptr< PyRunModule > run_module;
std::string m_name;
RunCount m_run_count;
std::string module_file;
mutable bool m_active = true;
};
}
}

View File

@@ -56,7 +56,7 @@ namespace Opm {
template< class T >
class DynamicState {
friend class Schedule;
public:
typedef typename std::vector< T >::iterator iterator;
@@ -118,6 +118,9 @@ class DynamicState {
return result;
}
bool is_new_data(size_t index) const {
return index == 0 || (at(index) != at(index - 1));
}
/**
If the current value has been changed the method will
@@ -227,9 +230,48 @@ class DynamicState {
initial_range == data.initial_range;
}
// complexType=true if contained type has a serializeOp
template<class Serializer, bool complexType = true>
void serializeOp(Serializer& serializer)
{
std::vector<T> unique;
auto indices = split(unique);
serializer.template vector<T,complexType>(unique);
serializer(indices);
if (!serializer.isSerializing())
reconstruct(unique, indices);
}
private:
std::vector< T > m_data;
size_t initial_range;
std::vector<size_t> split(std::vector<T>& unique) const {
std::vector<size_t> idxVec;
idxVec.reserve(m_data.size() + 1);
for (const auto& w : m_data) {
auto candidate = std::find(unique.begin(), unique.end(), w);
size_t idx = candidate - unique.begin();
if (candidate == unique.end()) {
unique.push_back(w);
idx = unique.size() - 1;
}
idxVec.push_back(idx);
}
idxVec.push_back(initial_range);
return idxVec;
}
void reconstruct(const std::vector<T>& unique,
const std::vector<size_t>& idxVec) {
m_data.clear();
m_data.reserve(idxVec.size() - 1);
for (size_t i = 0; i < idxVec.size() - 1; ++i)
m_data.push_back(unique[idxVec[i]]);
initial_range = idxVec.back();
}
};
}

View File

@@ -64,12 +64,14 @@ namespace Opm {
(*this)[index] = std::move( value );
}
const std::vector<T>& data() const {
return m_data;
bool operator==(const DynamicVector<T>& data) const {
return this->m_data == data.m_data;
}
bool operator==(const DynamicVector<T>& data) const {
return this->data() == data.data();
template<class Serializer, bool complexType = true>
void serializeOp(Serializer& serializer)
{
serializer.template vector<T, complexType>(m_data);
}
private:

View File

@@ -123,14 +123,20 @@ namespace Opm
public:
Events() = default;
explicit Events(const TimeMap& timeMap);
explicit Events(const DynamicVector<uint64_t>& events);
static Events serializeObject();
void addEvent(ScheduleEvents::Events event, size_t reportStep);
bool hasEvent(uint64_t eventMask, size_t reportStep) const;
const DynamicVector<uint64_t>& events() const;
bool operator==(const Events& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
m_events.template serializeOp<Serializer,false>(serializer);
}
private:
DynamicVector<uint64_t> m_events;
};

View File

@@ -52,6 +52,17 @@ namespace Opm {
udq_undefined == data.udq_undefined &&
unit_system == data.unit_system;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
sales_target.serializeOp(serializer);
max_sales_rate.serializeOp(serializer);
min_sales_rate.serializeOp(serializer);
serializer(max_proc);
serializer(udq_undefined);
unit_system.serializeOp(serializer);
}
};
struct GCONSALEGroupProp {
@@ -61,8 +72,7 @@ namespace Opm {
MaxProcedure max_proc;
};
GConSale() = default;
GConSale(const std::map<std::string, GCONSALEGroup>& group);
static GConSale serializeObject();
bool has(const std::string& name) const;
const GCONSALEGroup& get(const std::string& name) const;
@@ -71,10 +81,14 @@ namespace Opm {
void add(const std::string& name, const UDAValue& sales_target, const UDAValue& max_rate, const UDAValue& min_rate, const std::string& procedure, double udq_undefined_arg, const UnitSystem& unit_system);
size_t size() const;
const std::map<std::string, GCONSALEGroup>& getGroups() const;
bool operator==(const GConSale& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.map(groups);
}
private:
std::map<std::string, GCONSALEGroup> groups;
};

View File

@@ -45,6 +45,16 @@ namespace Opm {
udq_undefined == data.udq_undefined &&
unit_system == data.unit_system;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
consumption_rate.serializeOp(serializer);
import_rate.serializeOp(serializer);
serializer(network_node);
serializer(udq_undefined);
unit_system.serializeOp(serializer);
}
};
struct GCONSUMPGroupProp {
@@ -53,8 +63,7 @@ namespace Opm {
std::string network_node;
};
GConSump() = default;
GConSump(const std::map<std::string, GCONSUMPGroup>& group);
static GConSump serializeObject();
bool has(const std::string& name) const;
const GCONSUMPGroup& get(const std::string& name) const;
@@ -62,10 +71,14 @@ namespace Opm {
void add(const std::string& name, const UDAValue& consumption_rate, const UDAValue& import_rate, const std::string network_node, double udq_undefined_arg, const UnitSystem& unit_system);
size_t size() const;
const std::map<std::string, GCONSUMPGroup>& getGroups() const;
bool operator==(const GConSump& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.map(groups);
}
private:
std::map<std::string, GCONSUMPGroup> groups;
};

View File

@@ -17,6 +17,7 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <optional>
#include <vector>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
@@ -29,7 +30,7 @@ namespace Opm {
class GTNode {
public:
GTNode(const Group& group, const GTNode* parent);
GTNode(const Group& group, std::size_t level, const std::optional<std::string>& parent_name);
void add_group(const GTNode& child_group);
void add_well(const Well& well);
@@ -37,11 +38,13 @@ public:
const std::vector<Well>& wells() const;
const std::vector<GTNode>& groups() const;
const std::string& name() const;
const GTNode& parent() const;
const std::string& parent_name() const;
const Group& group() const;
private:
const Group m_group;
const GTNode * m_parent;
std::size_t m_level;
std::optional<std::string> m_parent_name;
/*
Class T with a stl container <T> - supposedly undefined behavior before
C++17 - but it compiles without warnings.

View File

@@ -21,8 +21,9 @@
#define GROUP2_HPP
#include <string>
#include <map>
#include <optional>
#include <string>
#include <opm/parser/eclipse/Deck/UDAValue.hpp>
#include <opm/parser/eclipse/EclipseState/Util/IOrderSet.hpp>
@@ -113,10 +114,28 @@ struct GroupInjectionProperties {
UDAValue target_void_fraction;
std::string reinj_group;
std::string voidage_group;
bool available_group_control;
static GroupInjectionProperties serializeObject();
int injection_controls = 0;
bool operator==(const GroupInjectionProperties& other) const;
bool operator!=(const GroupInjectionProperties& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(phase);
serializer(cmode);
surface_max_rate.serializeOp(serializer);
resv_max_rate.serializeOp(serializer);
target_reinj_fraction.serializeOp(serializer);
target_void_fraction.serializeOp(serializer);
serializer(reinj_group);
serializer(voidage_group);
serializer(injection_controls);
serializer(available_group_control);
}
};
struct InjectionControls {
@@ -142,12 +161,31 @@ struct GroupProductionProperties {
double guide_rate;
GuideRateTarget guide_rate_def;
double resv_target = 0;
bool available_group_control = true;
static GroupProductionProperties serializeObject();
int production_controls = 0;
bool operator==(const GroupProductionProperties& other) const;
bool operator!=(const GroupProductionProperties& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(cmode);
serializer(exceed_action);
oil_target.serializeOp(serializer);
water_target.serializeOp(serializer);
gas_target.serializeOp(serializer);
liquid_target.serializeOp(serializer);
serializer(guide_rate);
serializer(guide_rate_def);
serializer(resv_target);
serializer(available_group_control);
serializer(production_controls);
}
};
struct ProductionControls {
ProductionCMode cmode;
ExceedAction exceed_action;
@@ -165,38 +203,22 @@ struct ProductionControls {
Group();
Group(const std::string& group_name, std::size_t insert_index_arg, std::size_t init_step_arg, double udq_undefined_arg, const UnitSystem& unit_system);
Group(const std::string& gname,
std::size_t insert_idx,
std::size_t initstep,
double udqUndef,
const UnitSystem& units,
GroupType gtype,
double groupEF,
bool transferGroupEF,
bool availableForGroupControl,
int vfp,
const std::string& parent,
const IOrderSet<std::string>& well,
const IOrderSet<std::string>& group,
const std::map<Phase, GroupInjectionProperties> &injProps,
const GroupProductionProperties& prodProps);
static Group serializeObject();
bool defined(std::size_t timeStep) const;
std::size_t insert_index() const;
std::size_t initStep() const;
double udqUndefined() const;
const UnitSystem& units() const;
const std::string& name() const;
GroupType type() const;
int getGroupNetVFPTable() const;
const IOrderSet<std::string>& iwells() const;
const IOrderSet<std::string>& igroups() const;
bool updateNetVFPTable(int vfp_arg);
bool update_gefac(double gefac, bool transfer_gefac);
// [[deprecated("use Group::control_group() or Group::flow_group()")]]
const std::string& parent() const;
std::optional<std::string> control_group() const;
std::optional<std::string> flow_group() const;
bool updateParent(const std::string& parent);
bool updateInjection(const GroupInjectionProperties& injection);
bool updateProduction(const GroupProductionProperties& production);
@@ -206,8 +228,6 @@ struct ProductionControls {
void setInjectionGroup();
double getGroupEfficiencyFactor() const;
bool getTransferGroupEfficiencyFactor() const;
bool isAvailableForGroupControl() const;
void setAvailableForGroupControl(const bool available);
std::size_t numWells() const;
bool addGroup(const std::string& group_name);
@@ -231,11 +251,33 @@ struct ProductionControls {
Phase injection_phase() const;
bool has_control(ProductionCMode control) const;
bool has_control(InjectionCMode control) const;
bool productionGroupControlAvailable() const;
bool injectionGroupControlAvailable(const Phase phase) const;
bool operator==(const Group& data) const;
const Phase& topup_phase() const;
bool has_topup_phase() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_name);
serializer(m_insert_index);
serializer(init_step);
serializer(udq_undefined);
unit_system.serializeOp(serializer);
serializer(group_type);
serializer(gefac);
serializer(transfer_gefac);
serializer(vfp_table);
serializer(parent_group);
m_wells.serializeOp(serializer);
m_groups.serializeOp(serializer);
serializer.map(injection_properties);
production_properties.serializeOp(serializer);
serializer(m_topup_phase);
}
private:
bool hasType(GroupType gtype) const;
void addType(GroupType new_gtype);
@@ -248,7 +290,6 @@ private:
GroupType group_type;
double gefac;
bool transfer_gefac;
bool available_for_group_control;
int vfp_table;
std::string parent_group;

View File

@@ -27,11 +27,35 @@
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.hpp>
namespace Opm {
class Schedule;
class GuideRate {
public:
// used for potentials and well rates
struct RateVector {
RateVector () = default;
RateVector (double orat, double grat, double wrat) :
oil_rat(orat),
gas_rat(grat),
wat_rat(wrat)
{}
double eval(Group::GuideRateTarget target) const;
double eval(Well::GuideRateTarget target) const;
double eval(GuideRateModel::Target target) const;
double oil_rat;
double gas_rat;
double wat_rat;
};
private:
struct GuideRateValue {
@@ -56,31 +80,14 @@ struct GuideRateValue {
GuideRateModel::Target target;
};
struct Potential {
Potential() = default;
Potential(double op, double gp, double wp) :
oil_pot(op),
gas_pot(gp),
wat_pot(wp)
{}
double eval(Group::GuideRateTarget target) const;
double eval(Well::GuideRateTarget target) const;
double eval(GuideRateModel::Target target) const;
double oil_pot;
double gas_pot;
double wat_pot;
};
public:
GuideRate(const Schedule& schedule);
void compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot);
double get(const std::string& well, Well::GuideRateTarget target) const;
double get(const std::string& group, Group::GuideRateTarget target) const;
double get(const std::string& name, GuideRateModel::Target model_target) const;
double get(const std::string& well, Well::GuideRateTarget target, const RateVector& rates) const;
double get(const std::string& group, Group::GuideRateTarget target, const RateVector& rates) const;
double get(const std::string& name, GuideRateModel::Target model_target, const RateVector& rates) const;
bool has(const std::string& name) const;
private:
void well_compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot);
@@ -89,8 +96,8 @@ private:
double eval_group_pot() const;
double eval_group_resvinj() const;
std::unordered_map<std::string,GuideRateValue> values;
std::unordered_map<std::string,Potential> potentials;
std::unordered_map<std::string, GuideRateValue> values;
std::unordered_map<std::string, RateVector > potentials;
const Schedule& schedule;
};

View File

@@ -44,6 +44,14 @@ public:
target == data.target &&
scaling_factor == data.scaling_factor;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(guide_rate);
serializer(target);
serializer(scaling_factor);
}
};
struct GroupTarget {
@@ -54,12 +62,16 @@ struct GroupTarget {
return guide_rate == data.guide_rate &&
target == data.target;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(guide_rate);
serializer(target);
}
};
GuideRateConfig() = default;
GuideRateConfig(std::shared_ptr<GuideRateModel> model,
const std::unordered_map<std::string,WellTarget>& well,
const std::unordered_map<std::string,GroupTarget>& group);
static GuideRateConfig serializeObject();
const GuideRateModel& model() const;
bool has_model() const;
@@ -71,12 +83,16 @@ struct GroupTarget {
bool has_well(const std::string& well) const;
bool has_group(const std::string& group) const;
std::shared_ptr<GuideRateModel> getModel() const;
const std::unordered_map<std::string, WellTarget>& getWells() const;
const std::unordered_map<std::string, GroupTarget>& getGroups() const;
bool operator==(const GuideRateConfig& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_model);
serializer.map(wells);
serializer.map(groups);
}
private:
std::shared_ptr<GuideRateModel> m_model;
std::unordered_map<std::string, WellTarget> wells;

View File

@@ -52,17 +52,10 @@ public:
bool allow_increase_arg,
double damping_factor_arg,
bool use_free_gas_arg);
GuideRateModel(double time_interval_arg,
Target target_arg,
const std::array<double,6>& coefs_arg,
bool allow_increase_arg,
double damping_factor_arg,
bool use_free_gas_arg,
bool use_default_model_arg,
const std::array<UDAValue,3>& udaCoefs_arg);
GuideRateModel() = default;
static GuideRateModel serializeObject();
bool updateLINCOM(const UDAValue& alpha, const UDAValue& beta, const UDAValue& gamma);
double eval(double oil_pot, double gas_pot, double wat_pot) const;
double update_delay() const;
@@ -82,11 +75,26 @@ public:
static Target convert_target(Well::GuideRateTarget well_target);
static double pot(Target target, double oil_pot, double gas_pot, double wat_pot);
double timeInterval() const;
std::array<double, 6> coefs() const;
bool free_gas() const;
bool defaultModel() const;
std::array<UDAValue,3> udaCoefs() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(time_interval);
serializer(m_target),
serializer(A);
serializer(B);
serializer(C);
serializer(D);
serializer(E);
serializer(F);
serializer(allow_increase_);
serializer(damping_factor_);
serializer(use_free_gas);
serializer(default_model);
alpha.serializeOp(serializer);
beta.serializeOp(serializer);
gamma.serializeOp(serializer);
}
private:
double pot(double oil_pot, double gas_pot, double wat_pot) const;
/*

View File

@@ -51,25 +51,10 @@ namespace Opm {
Segment(const Segment& src, double new_volume);
Segment(int segment_number_in, int branch_in, int outlet_segment_in, double length_in, double depth_in,
double internal_diameter_in, double roughness_in, double cross_area_in, double volume_in, bool data_ready_in, SegmentType segment_type_in);
Segment(int segmentNumber,
int branchNumber,
int outlegSegment,
const std::vector<int>& inletSegments,
double totalLength,
double depth,
double internalDiameter,
double roughness,
double crossArea,
double volume,
bool dataReady,
SegmentType segmentType,
std::shared_ptr<SpiralICD> spiralICD,
std::shared_ptr<Valve> valv);
Segment(const RestartIO::RstSegment& rst_segment);
static Segment serializeObject();
int segmentNumber() const;
int branchNumber() const;
int outletSegment() const;
@@ -94,12 +79,31 @@ namespace Opm {
bool operator!=( const Segment& ) const;
const std::shared_ptr<SpiralICD>& spiralICD() const;
const std::shared_ptr<Valve>& getValve() const;
const Valve* valve() const;
void updateSpiralICD(const SpiralICD& spiral_icd);
void updateValve(const Valve& valve, const double segment_length);
void addInletSegment(const int segment_number);
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_segment_number);
serializer(m_branch);
serializer(m_outlet_segment);
serializer(m_inlet_segments);
serializer(m_total_length);
serializer(m_depth);
serializer(m_internal_diameter);
serializer(m_roughness);
serializer(m_cross_area);
serializer(m_volume);
serializer(m_data_ready);
serializer(m_segment_type);
serializer(m_spiral_icd);
serializer(m_valve);
}
private:
// segment number
// it should work as a ID.

View File

@@ -24,6 +24,7 @@
#include <map>
#include <utility>
#include <vector>
#include <string>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/icd.hpp>
@@ -49,6 +50,8 @@ namespace Opm {
ICDStatus status,
double scalingFactor);
static SpiralICD serializeObject();
// the function will return a map
// [
// "WELL1" : [<seg1, sicd1>, <seg2, sicd2> ...]
@@ -72,6 +75,22 @@ namespace Opm {
int ecl_status() const;
bool operator==(const SpiralICD& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_strength);
serializer(m_length);
serializer(m_density_calibration);
serializer(m_viscosity_calibration);
serializer(m_critical_value);
serializer(m_width_transition_region);
serializer(m_max_viscosity_ratio);
serializer(m_method_flow_scaling);
serializer(m_max_absolute_rate);
serializer(m_status);
serializer(m_scaling_factor);
}
private:
double m_strength;
double m_length;

View File

@@ -23,6 +23,7 @@
#include <map>
#include <utility>
#include <vector>
#include <string>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/icd.hpp>
@@ -47,6 +48,8 @@ namespace Opm {
double pipeCrossA,
ICDStatus stat);
static Valve serializeObject();
// the function will return a map
// [
// "WELL1" : [<seg1, valv1>, <seg2, valv2> ...]
@@ -76,6 +79,19 @@ namespace Opm {
bool operator==(const Valve& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_con_flow_coeff);
serializer(m_con_cross_area);
serializer(m_con_max_cross_area);
serializer(m_pipe_additional_length);
serializer(m_pipe_diameter);
serializer(m_pipe_roughness);
serializer(m_pipe_cross_area);
serializer(m_status);
}
private:
double m_con_flow_coeff;
double m_con_cross_area;

View File

@@ -62,9 +62,11 @@ namespace Opm {
WellSegments() = default;
WellSegments(const DeckKeyword& keyword);
WellSegments(CompPressureDrop compDrop,
const std::vector<Segment>& segments);
explicit WellSegments(const DeckKeyword& keyword);
static WellSegments serializeObject();
std::size_t size() const;
double depthTopSegment() const;
@@ -87,12 +89,23 @@ namespace Opm {
bool operator!=( const WellSegments& ) const;
double segmentLength(const int segment_number) const;
double segmentDepthChange(const int segment_number) const;
std::vector<Segment> branchSegments(int branch) const;
// it returns true if there is no error encountered during the update
bool updateWSEGSICD(const std::vector<std::pair<int, SpiralICD> >& sicd_pairs);
const std::vector<Segment>& segments() const;
bool updateWSEGVALV(const std::vector<std::pair<int, Valve> >& valve_pairs);
const std::vector<Segment>::const_iterator begin() const;
const std::vector<Segment>::const_iterator end() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_comp_pressure_drop);
serializer.vector(m_segments);
serializer(segment_number_to_index);
}
private:
void processABS();
@@ -100,6 +113,7 @@ namespace Opm {
void process(LengthDepth length_depth, double depth_top, double length_top);
void addSegment(const Segment& new_segment);
void loadWELSEGS( const DeckKeyword& welsegsKeyword);
const Segment& topSegment() const;
// components of the pressure drop to be included
CompPressureDrop m_comp_pressure_drop;

Some files were not shown because too many files have changed in this diff Show More