Compare commits

..

621 Commits

Author SHA1 Message Date
Markus Blatt
d2a2ee1b22 Bump version to 2023.10 (final) 2023-11-12 14:16:48 +01:00
Markus Blatt
5b2c69628d Merge pull request #3761 from blattms/backport-of-pr-3760
[backport] Fix build with older versions of boost
2023-11-10 11:28:04 +01:00
Arne Morten Kvarving
4586ca2185 fixed: earlier boosts did not support command line parameter separation
for older versions we will thus see '--' as argv[1] and the actual
parameter as argv[2].
2023-11-10 11:22:30 +01:00
Arne Morten Kvarving
e333311b5a fixed: adjust compare_at_tolerance namespace for earlier boost 2023-11-10 11:22:30 +01:00
Arne Morten Kvarving
ef24f51a97 fixed: adjust include path of float_point_comparison for earlier boost 2023-11-10 11:22:30 +01:00
Arne Morten Kvarving
d1ee5b1da5 fixed: BOOST_DATA_TEST_CASE was added in boost 1.67
use a loop for earlier versions
2023-11-10 11:22:30 +01:00
Arne Morten Kvarving
a9f8a279d4 fixed: earlier boosts only accepts boost::mpl::list for BOOST_AUTO_TEST_TEMPLATE 2023-11-10 11:22:30 +01:00
Markus Blatt
f847d42b9e Merge pull request #3759 from blattms/backport-man
[backport] Update and improve man pages for release
2023-11-09 16:39:53 +01:00
Markus Blatt
c055784352 Update and improve man pages for release 2023-11-09 16:38:19 +01:00
Markus Blatt
6bf30ec3f4 Merge pull request #3749 from blattms/backport-of-pr-3742
Fix to linker error in building tests (clang, macOS)
2023-11-06 10:03:15 +01:00
David Landa Marban
d37bb3abeb Fix to linker error in building tests (clang, macOS) 2023-11-06 09:58:30 +01:00
Markus Blatt
3716af7a04 Release candidate 2023.10-rc2 2023-10-30 15:32:28 +01:00
Markus Blatt
08ac19f242 Merge pull request #3736 from blattms/backport-of-pr-3712
Better error handling for problems in conditions of ACTIONX
2023-10-30 08:44:33 +01:00
Markus Blatt
574734680f Fixed shadowing variable warning. 2023-10-30 08:26:34 +01:00
Markus Blatt
89f14594e1 Improved the "improved" error message even more. 2023-10-30 08:26:34 +01:00
Markus Blatt
25de42037f Introduces method parseActionX returning the action and error strings.
This way there is no constructor with an output parameter and we
prevent introducing an additional member in ActionX that is only used
in one constructor.
2023-10-30 08:26:34 +01:00
Markus Blatt
f04ada2d44 Better error handling for problems in conditions of ACTIONX.
When encountering these (e.g. a number instead of an expression on
the left hand side) the simulator would immediately abort with an
error message like:
```
Error: An error occurred while creating the reservoir schedule
Internal error: Extra unhandled data starting with token[0] = 135

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

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

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

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

Error: Unrecoverable errors while loading input: Problem with keyword ACTIONX
In model.schedule line 562
condition of action EX1 has the following error: Left side of comparsion (135) has to be an expression!
2023-10-30 08:26:34 +01:00
Markus Blatt
722c3592a4 Merge pull request #3735 from blattms/backport-of-pr-3710
Backport of pr 3710
2023-10-30 08:25:09 +01:00
Markus Blatt
223e8c6877 Use LESS comparison to test if system is at least 64bit.
Indeed this is clearer and better.
2023-10-30 08:21:51 +01:00
Markus Blatt
5ecc7caa23 Make CMake fail on non-64bit systems.
Running simulations on those does not make sense as it seriously
limits the time span that can be simulated. In addition the OPM code
neglects 32bit issues at various places as it was written at a time
where 64bit was already ubiquitous.

Currently, we would fail in some regression tests on 32bit
systems. With this change CMake will already check whether it is run
on a 64bit system and already fail if this is not the case.
2023-10-30 08:21:51 +01:00
Markus Blatt
e494e6ba10 Release candidate 2023.10-rc1 2023-10-17 16:58:13 +02:00
Markus Blatt
69aaab7811 Merge pull request #3718 from blattms/backport-of-pr-3713
[fix] AggregateActionX: Do not assume an ACTIONX condition exists
2023-10-17 12:34:54 +02:00
Markus Blatt
157e1b0f86 [fix] AggregateActionX: Do not assume an ACTIONX condition exists
The rest of the code allows an ACTIONX keyword without any
condition (Such an action will never be evaluated). Yet
AggregateActionXData assumed that there is always at least one
condition. This lead to a segmentation fault if that was not the case.

It seemed like iAC[offset + Ix::FirstGreater] is used nowhere and
therefore we now always use 0 there. I was not brave enouogh to remove
the storage for it, because I fear this might break backwards
compatibility of the output layer.
2023-10-17 12:31:36 +02:00
Markus Blatt
25340d8ec7 Merge pull request #3717 from blattms/backport-of-pr-3714
adding ThreeComponentFluidSystem.hh to CMakeLists_files
2023-10-16 16:04:05 +02:00
Kai Bao
88fb98db6e adding ThreeComponentFluidSystem.hh to CMakeLists_files
to let other modules be able to access it.
2023-10-16 15:53:22 +02:00
Markus Blatt
0031f40ec5 Merge pull request #3716 from blattms/backport-of-pr-3705
Support for SGWFN sat functions (format type 2)
2023-10-16 15:44:57 +02:00
David Landa Marban
9696d58498 Support for SGWFN sat functions (format type 2) 2023-10-16 15:24:51 +02:00
Markus Blatt
c419f8951d Merge pull request #3715 from blattms/backport-of-pr-3708
Don't Reference Non-Existent W/G Names From UDQ Set
2023-10-16 15:18:34 +02:00
Bård Skaflestad
6f3b3f9efd Don't Reference Non-Existent W/G Names From UDQ Set
Member function SummaryState::update_udq() did not take into account
the possibility that wells or groups might not yet have come online.
In particular, UDQSet::operator[](const string&) will throw an
exception if the argument string does not name an existing member of
the UDQ set.

This commit makes the call to operator[]() conditional on the named
entity existing and thereby enables updating well and group level
UDQs before these names have been entered in, e.g., WELSPECS or
GRUPTREE.  Missing entities get the 'undefined_value'.
2023-10-16 13:19:56 +02:00
Markus Blatt
a4f9fb1dd8 Merge pull request #3706 from blattms/fix-missing-functional-gcc12
Include missing functional header to fix compilation with g++-12
2023-10-11 12:40:09 +02:00
Markus Blatt
f3bd34df71 Sort header includes as requested.
Sorting criteria is not 100% clear to me though. I hope this does not
break anything...
2023-10-11 11:41:40 +02:00
Markus Blatt
a309dbb4d0 Include missing functional header for g++-12
Fixes
```
/opm/input/eclipse/Schedule/Schedule.hpp:241:14: error: ‘function’ in namespace ‘std’ does not name a template type
  241 |         std::function<std::unique_ptr<SegmentMatcher>()> segmentMatcherFactory(std::size_t report_step) const;
      |              ^~~~~~~~
```
2023-10-10 21:12:15 +02:00
Markus Blatt
9e3fa794ce Merge pull request #3587 from bska/trigger-assign-from-actionx
Track Pending Assignments in UDQ Configuration Object
2023-10-10 12:41:33 +02:00
Bård Skaflestad
09ffacb5bf Track Pending Assignments in UDQ Configuration Object
The existing implementation used the UDQ State object to track
pending ASSIGN operations, mainly in terms of the report step index,
but this implies that the logic implicitly assumes an ASSIGN
operation can run at most once per report step.  That assumption
usually holds, but fails if the ASSIGN operation is triggered from
an ACTIONX block that happens to run multiple times within a report
step.

This commit instead introduces a new data member,

    UDQConfig::pending_assignments_

that keeps track of all ASSIGN operations that have been added for
the current report step.  We clear those pending assignments when
forming a new Schedule block (ScheduleState object), under the
assumption that all pending ASSIGN operations have been affected at
the previous time level (report step).

In effect, this new data member assumes the role of

    UDQState::assignments

and we therefore remove that data member and update the signature of

    UDQState::add_assign()

to account for the fact that the 'report_step' parameter is no
longer needed.
2023-10-09 15:32:48 +02:00
Tor Harald Sandve
8ed1b4c21e Merge pull request #3656 from svenn-t/co2store_enthalpy_reference
CO2STORE new reference state for enthalpy
2023-10-06 17:52:25 +02:00
Markus Blatt
4c511b788c Merge pull request #3375 from bska/eval-seg-udq
Compute Segment Level UDQ Values
2023-10-06 15:35:23 +02:00
Bård Skaflestad
2be2063906 Merge pull request #3700 from blattms/prominent-toplevel-topology-errors
Make top level section errors more prominent / Allow global keywords before RUNSPEC
2023-10-06 11:18:07 +02:00
Markus Blatt
4daaf493cb Fix documentation of isGlobalKeyword. 2023-10-06 10:55:03 +02:00
Markus Blatt
3a63c1723b Allow global keywords before RUNSPEC in input file. 2023-10-05 22:33:08 +02:00
Bård Skaflestad
7d16924f06 Defer Bounds Checking to Schedule::operator[]()
We don't need to reimplement logic that's already present and it is
always an error to pass a 'report_step' argument that exceeds
Schedule::size().

Pointed out by: [at]blattms.
2023-10-05 18:25:49 +02:00
Bård Skaflestad
0f1f2f74f0 Highlight Deferred Initialisation in EvalAssign::operator()
The logic and the reasoning behind it was too obtuse.
2023-10-05 18:23:38 +02:00
Bård Skaflestad
c93243f939 Rename Segment Matcher Factory Data Member
Invoking the factory creates a segment matcher object, not a new
factory.

Suggested by: [at]blattms
2023-10-05 18:22:07 +02:00
Markus Blatt
4caa693d71 Make top level section error more prominent to help users.
If there are errors at the top level (e.g. RUNSPEC comes after
NOECHO), we might get very many errors and the user might miss
the relevant ones on top.

To fix this we will now print those errors last just before exiting
the simulator because of these errors.
2023-10-05 17:09:38 +02:00
Bård Skaflestad
381ab825b1 Support Segment Level UDQ ASSIGN Statements
This commit adds parser and evaluation logic necessary to handle
ASSIGN statements for segment level UDQs.  This requires a segment
matching facility in UDQConfig::add_assign() which, in turn, must be
passed from the calling context in Schedule::handleUDQ().  Update
APIs accordingly.

We also split handling segment level UDQ assignments to a new helper
function, UDQConfig::add_enumerated_assign(), which might be
generalised to handle block level UDQs in the future.
2023-10-04 10:44:49 +02:00
Bård Skaflestad
f3245ad88a Refactor Assignment Evaluation Routine
In particular, use a single loop over the 'input_index' instead of
one separate loop for each supported variable type.  This is in
preparation of adding suport for segment level UDQ ASSIGN statements.
2023-10-04 10:44:49 +02:00
Bård Skaflestad
cf9b66d8ec Make Derivation of Enumerated Well Items Public
We need this ability to handle segment level UDQ ASSIGN statements
too, so give the operation a well defined home and call it where
applicable.
2023-10-04 10:44:49 +02:00
Bård Skaflestad
72519e3e1f Add Support for Outputting Segment Level UDQs to Summary
This commit adds logic that enables recognizing segment level UDQs
in the summary output writer.  We calculate all segment level UDQs
and add the values to the summary state for possible use in ACTIONX
too.  The latter is not yet tested.
2023-10-04 10:44:49 +02:00
Bård Skaflestad
adab33ac60 Compute Segment Level UDQ Values
This commit adds support for calculating UDQs at the segment level,
i.e., UDQs named 'SU*'.  This necessitates an API change for the UDQ
context constructor and, transitively, every function that forms UDQ
context objects.  We pass a factory function that will create
segment matcher objects on demand, and provide a default
implementation of this factory function in the Schedule class.
2023-10-04 10:44:49 +02:00
Bård Skaflestad
a8d3dff2a4 Merge pull request #3696 from bska/msw-rst-fixup
Fix Multiple Issues in MSW Output Array Creation Logic
2023-10-04 09:55:02 +02:00
Bård Skaflestad
6d3ee57dd5 Define ILBR/ILBS in Terms of Depth First Traversal
The existing algorithm was a little too fragile and dependent on
branch numbers.  This new version starts at segment 1/branch 1 and
follows Segment::inletSegments() in depth-first order, taking care
to enqueue new branches as they're encountered instead of in
numerical order.  We search to the end of each branch before
switching to the next branch.  This ensures determinism regardless
of branch numbering and input ordering.

While here, switch iLBR_ to a WindowedMatrix<int> to simplify branch
references in the output table.
2023-10-02 14:59:55 +02:00
Bård Skaflestad
d7edd7c2ee Fix ISEG[0] Output Order
The value in ISEG[0] does not necessarily correspond to the search
order of that segment.  Rather, ISEG[0] is the depth-first ordering
of the segment search tree when traversing kick-off branches before
the main stem from which those branches kick off.
2023-10-02 14:25:40 +02:00
Bård Skaflestad
1d5ae49cdc Set ISEG Open/Shut Flag for Valves
Missing in earlier editions of the segment output code.
2023-10-02 14:25:40 +02:00
Bård Skaflestad
d3bf44ce87 Tidy up Implementation of Aggregate MSW Data Module
This is in preparation of revising the algorithm for ILBR/ILBS.
Mostly splitting long lines, adding missing headers, passing scalars
by value, and making three helper structures private to the
implementation file.  There are no external users of these types.
2023-10-02 14:25:40 +02:00
Bård Skaflestad
fea67594b8 Tidy up AggregateMSW Test Code
In preparation of adding more test cases.
2023-10-02 14:25:40 +02:00
Kai Bao
f10399bb77 Merge pull request #3697 from bska/prevent-duplicate-inlet-segments
Prevent Duplicate Inlet Segments
2023-10-02 14:09:39 +02:00
Bård Skaflestad
006b65e054 Prevent Duplicate Inlet Segments
If one WELSEGS keyword does not redefine every existing segment,
then we risk adding the same inlet segment multiple times.  If that
happens, we get a segment structure for which there might appear to
be multiple inlet segments on the same branch which is not possible
in a tree structure.  This commit prevents that situation by only
adding the new segment number if it is not already listed in
'm_inlet_segments'.
2023-10-02 13:20:56 +02:00
Svenn Tveit
4769fa7bd6 Fix errors when Scalar = float 2023-09-29 08:27:52 +02:00
Svenn Tveit
6d300b8d13 Ensure that default reference state is used.
Throw error if STCOND is not default or classes are instantiated with (T, P) other than reference values.
2023-09-29 08:27:51 +02:00
Svenn Tveit
34024bfabe Update unit tests with new reference state.
New reference state (T, P)=(288.71 K, 101325.0 Pa) =(15.56 C, 1 atm).
2023-09-29 08:25:24 +02:00
Svenn Tveit
e690d06b54 Update enthalpy to same reference state.
New reference state (T, P) = (288.71 K, 101325.0 Pa) = (15.56 C, 1 atm).
2023-09-29 08:25:24 +02:00
Atgeirr Flø Rasmussen
8ff141a592 Merge pull request #3692 from hnil/more_timing
More timing
2023-09-28 15:40:33 +02:00
Markus Blatt
f66b713d0c Merge pull request #3693 from akva2/buildsystem_cleanups
Some buildsystem cleanup
2023-09-28 12:23:46 +02:00
Bård Skaflestad
da793e23fc Merge pull request #3689 from bska/reg-cache-global-ix
Match Connection-to-Region in Terms of Global Cell Indices
2023-09-28 11:48:56 +02:00
hnil
b6a0821992 added timing on co2store evaluation and new timing macros 2023-09-28 10:42:20 +02:00
Bård Skaflestad
ae2f052b37 Match Connection-to-Region in Terms of Global Cell Indices
The simulator reports data::Connection objects tied to global
Cartesian cell indices whence using the 'active_index' leads to
match failures and incorrect rate attribution at the region level.
In one field case we got region level rates and cumulatives, e.g.,
ROPR and ROPT, of zero reported to the summary file when the
expected values should be non-zero.
2023-09-28 10:36:43 +02:00
Markus Blatt
e3fd90f965 Merge pull request #3680 from bska/support-truncated-region-names-revised
Match Region Sets by Unique Prefix
2023-09-28 10:16:08 +02:00
Bård Skaflestad
9342040dbe Match Region Sets by Unique Prefix
This commit switches the region set tag matching algorithm to using
unique prefixes.  This enables the parser to recognise that the
summary vector

    ROPR_UNI

should match up with the user defined region set 'FIPUNIT'.  In the
current master sources, the above summary vector would produce a
diagnostic message saying that the region set 'FIPUNI' (without the
final 'T') does not exist.

We add a prefix-to-canonical region set name translation table to
the FieldProps class and funnel all FIP-like requests through this
translation table.  In the case of non-unique prefixes-e.g., FIPUNIT
and FIPUNIX, we currently elect to have the last keyword entered in
the simulation model "win".  This behaviour may be altered in the
future if deemed appropriate/necessary.
2023-09-26 15:31:20 +02:00
Arne Morten Kvarving
9d8826c2e5 fixed typo in status message 2023-09-26 14:53:45 +02:00
Arne Morten Kvarving
4041f9cc69 remove prereqs file for opm-vertex
this module is defunct and has been defunct for
10 years by now.
2023-09-26 14:53:45 +02:00
Arne Morten Kvarving
ca864e4be9 changed: remove generation of .pc files
this has been broken for a long time, yielding files
containing cmake target names in the linker lines.
2023-09-26 14:53:45 +02:00
Bård Skaflestad
b8816b474b Merge pull request #3690 from vkip/msw_no_conn
Allow multi-segment wells with no grid connections
2023-09-26 13:53:08 +02:00
Vegard Kippe
30a92cca1e Updated after review input 2023-09-26 13:30:43 +02:00
Vegard Kippe
776597e00b Allow multi-segment wells with no grid connections - warning is already issued. 2023-09-26 13:30:43 +02:00
Bård Skaflestad
53301b78d4 Merge pull request #3687 from bska/more-summary-vectors
Support More Summary Vectors
2023-09-25 12:44:32 +02:00
Bård Skaflestad
ad9ebd730d Support More Summary Vectors
In particular, add support for outputting the following vectors

  - WOGR  -- Well level oil/gas ratio
  - WWGRH -- Well level water/gas ratio (observed rates)
  - FPRH  -- Field level average pressure (hydrocarbon volume)
  - FHPV  -- Field level total hydrocarbon pore-volume
2023-09-22 10:44:44 +02:00
Bård Skaflestad
44cd3eafe2 Merge pull request #3679 from bska/rsmry-udef-regset
Support Region Set Tags For All Region Level Summary Vectors
2023-09-22 10:39:51 +02:00
Bård Skaflestad
fb37bf5db5 Merge pull request #3682 from bska/region-avgpress-hcvol
Emit Region Level Average Pressure Weighted by HC Volume
2023-09-22 10:39:00 +02:00
Bård Skaflestad
e366a940bf Merge pull request #3688 from bska/wpix-smry-vectors
Add Support for WPIx Summary Vectors
2023-09-22 10:38:24 +02:00
Bård Skaflestad
ecbfd4e9c4 Support Region Set Tags For All Region Level Summary Vectors
This commit switches the existing, somewhat spotty, support for
matching region set tags on region level summary vector keywords.
We leverage the recent support for 'deck_name_regex_suffix' keys in
the JSON keyword model to extend the keyword matching algorithm to
also account for these region set tags.

There is a potential for false positives here, but we'll use this
as an initial proof-of-concept implementation.
2023-09-21 18:26:36 +02:00
Markus Blatt
4f52acdc0f Merge pull request #3685 from bska/multregt-multiple-regsets
Accumulate Total Multiplier From All Region Sets
2023-09-21 17:37:26 +02:00
Bård Skaflestad
ca7fbea637 Accumulate Total Multiplier From All Region Sets
If multiple records, from different region sets and region
IDs--e.g., both regions 1/2 in 'M' (MULTNUM) and regions 2/3 in 'F'
(FLUXNUM) applies to the same connection as might be the case in

    MULTREGT
      1 2  0.5  1*  'NNC'  'F' /
      2 3  0.1  1*  'NNC'  'M' /
    /

then the total multiplier value is the product of the values from
each record.

This commit revises the region set loop to accumulate the total
multiplier value instead of "just" returning the first match.
2023-09-21 13:04:09 +02:00
Bård Skaflestad
7dd3c344cd Emit Region Level Average Pressure Weighted by HC Volume
The simulator already calculates the requisite values, but due to
the requisite summary keyword RPRH not being listed among the known
region level vectors the output layer did not write the values to
the summary file.  This commit adds the requisite table entry.
2023-09-21 11:53:13 +02:00
Bård Skaflestad
d225901733 Add Support for WPIx Summary Vectors
We calculate these, for now, as

   WPIx = WOPR / (WBPx - WBHP)

but it is possible that we may have to revise this definition,
especially for injectors.
2023-09-21 11:52:47 +02:00
Tor Harald Sandve
8ea35f2d0d Merge pull request #3683 from svenn-t/h2store_updates
H2STORE updates
2023-09-21 09:19:57 +02:00
Bård Skaflestad
e5bd4129a1 Merge pull request #3686 from vkip/aquifer_celldepths_bugfix
Fixing segfault due to use of uninitialized grid properties
2023-09-19 14:46:01 +02:00
Svenn Tveit
cf4a905660 Fixed compilation warnings 2023-09-18 14:47:35 +02:00
Bård Skaflestad
ef88eb3737 Merge pull request #3681 from svenn-t/cskin
Implementation of CSKIN
2023-09-18 14:11:38 +02:00
Vegard Kippe
6755ff8328 Fixing segfault due to use of uninitialized grid properties 2023-09-18 11:43:33 +02:00
Svenn Tveit
44f6a915fc Check for negative CF before calclating it 2023-09-15 19:06:01 +02:00
Svenn Tveit
a89bac6fdb Test CSKIN with WPIMULT, WELPI and COMPDAT 2023-09-15 18:51:35 +02:00
Svenn Tveit
0f40d2c42c wpimult must be multiplied and not overwritten.
Mulitple WPIMULT and WELPI entries are cumulative on same connections.
2023-09-15 18:49:55 +02:00
Bård Skaflestad
6e0e302796 Merge pull request #3677 from vkip/numaqcell_depth
Ensure numerical aquifer cells get the correct depth
2023-09-15 13:04:33 +02:00
Markus Blatt
bbb46325f0 Merge pull request #3678 from bska/normalise-region-keywords-for-lookup
Normalise Region Level Summary Keywords for Lookup Purposes
2023-09-15 10:35:37 +02:00
Markus Blatt
644c0115a1 Merge pull request #3655 from bska/multregt-item-5
Implement NOAQUNNC Region Multiplier Behaviour in MULTREGT
2023-09-15 10:23:20 +02:00
Bård Skaflestad
07ddc15068 Calculate Multiplier Values for Non-Neighbouring Connections
This is intended as a possibly temporary measure for processing
explicitly assigned NNCs (keywords NNC/EDITNNC/EDITNNCR) along with
those NNCs arising from numerical aquifers, and for which there is
no associate face direction.

Add a set of unit tests to probe the implementation of all MULTREGT
connection behaviours as exhibited by MULTREGTScanner member
functions getRegionMultiplier() and getRegionMultiplierNNC().
2023-09-14 15:29:58 +02:00
Svenn Tveit
ea4aebda5d Test H2-brine PVTs 2023-09-14 12:31:59 +02:00
Svenn Tveit
a11becab76 H2STORE updates.
- Enables use with THERMAL. Note that enthalpy of H2 dissolution process is not included due to lack of published data on this (as far as I have seen).
- Enables use with DIFFCGAS and DIFFCWAT.
- Enables use with dynamic brine module.
- New H2 table made with Coolprop which includes enthalpy data.
2023-09-14 12:31:59 +02:00
Svenn Tveit
338ee8dd4a H2STORE is a OPM only keyword 2023-09-14 12:31:59 +02:00
Svenn Tveit
30cd8b8141 Test CSKIN input 2023-09-14 09:48:55 +02:00
Svenn Tveit
d410d8c232 Recalculate pressure equivalent radius when Kh=0.
Kh is calculated from grid block info and r0 must be consistent with that.
2023-09-14 08:51:01 +02:00
Svenn Tveit
f933b0e113 Implementation of CSKIN keyword.
To work with WPIMULT, the PI scaling factor had to be stored and applied to calculated CF.
2023-09-14 08:51:01 +02:00
Bård Skaflestad
9a3e8dba23 Normalise Region Level Summary Keywords for Lookup Purposes
Region level summary keywords may have suffixes which refer to user
defined region sets ('FIP*' keyword).  This commit prunes those
suffixes when performing function lookup, so that we do not get
false negatives.

To this end, introduce a new helper function

  EclIO::SummaryNode::normalise_region_keyword()

and use this both when determining the summary keyword type (rate,
cumulative, pressure &c) and when looking up evaluation functions
for region level summary vectors.  The new helper could arguably
have been integrated into the existing 'normalise_keyword()' helper
function, but that would have necessitated a different change
elsewhere in the code base.  For now, we keep this helper as a
separate function.
2023-09-13 18:00:01 +02:00
Vegard Kippe
68f6c5f5af .. and renaming the last call to computeCellDepth.. 2023-09-13 15:49:29 +02:00
Vegard Kippe
e23e69d328 Re-introducing another line that somehow was deleted 2023-09-13 15:40:43 +02:00
Vegard Kippe
90b9f30f67 Re-introducing line that somehow was deleted 2023-09-13 15:34:42 +02:00
Vegard Kippe
74d77cfcc4 Renaming as suggested by reviewer 2023-09-13 15:13:58 +02:00
Vegard Kippe
37f62d4b0f Ensure numerical aquifer cells get the correct depth 2023-09-13 13:56:14 +02:00
Bård Skaflestad
51b1cf614d Make Region Multiplier Aware of Aquifer Connections
This commit implements the 'NOAQUNNC' behaviour in member function

    MULTREGTScanner::getRegionMultiplier()

We use the new 'aquifer_cells' data member to identify connections
to and within numerical aquifers and ignore those if the record
stipulates 'NOAQUNNC' behaviour.
2023-09-13 13:42:32 +02:00
Bård Skaflestad
f99ae4b7cc Make MULTREGT Processor Aware of Numerical Aquifers
This commit adds a new data member

    MULTREGTScanner::aquifer_cells

which holds a sorted sequence of Cartesian/global cell indices
corresponding to the cells which comprise the model's numerical
aquifers.  These are needed to properly identify whether or not a
connection--i.e., a cell pair--would constitute a "numerical aquifer
connection" and be subject to 'NOAQUNNC' treatment.

We assign the numerical aquifer cells as part of member function

    EclipseState::conveyNumericalAquiferEffects

which runs at EclipseState construction time.  We know all numerical
aquifers at that point.
2023-09-13 13:42:32 +02:00
Bård Skaflestad
139701b017 Merge pull request #3673 from bska/kw-regex-suffix
Support Regular Expression Suffix for Keyword Matching
2023-09-13 12:49:06 +02:00
Bård Skaflestad
5fc5c86815 Merge pull request #3675 from vkip/bflowijk
Adding support for the summary vectors BFLOW[I|J|K]
2023-09-13 11:54:25 +02:00
Bård Skaflestad
5fc87fa10c Support Regular Expression Suffix for Keyword Matching
This is mostly to have a general solution for matching region level
summary keywords which may reference a user-defined region set (FIP
keyword, e.g., FIPXYZ) through tags like

    RPR__XYZ -- Average pressure in region, FIPXYZ region set
    ROPR_XYZ -- Oil production rate in region, FIPXYZ region set
    RODENXYZ -- Average oil density in region, FIPXYZ region set

The initial approach introduced in commit cfbafc236 was limited to
selected keywords.

To this end, add a new data member

    std::string ParserKeyword::m_matchRegexSuffix

and introduce a new member function

    bool ParserKeyword::matchesDeckNames()

which matches a candidate keyword string against the m_deckNames,
and, if applicable, as a regular expression against m_deckNames when
appended m_matchRegexSuffix.
2023-09-13 11:11:32 +02:00
Kai Bao
0f2a02dc40 Merge pull request #3676 from akva2/add_missing_initialization
fixed: initialize data in ConditionalStorage
2023-09-13 10:59:52 +02:00
Arne Morten Kvarving
9f0ea44f9c fixed: initialize data in ConditionalStorage 2023-09-13 10:04:40 +02:00
Vegard Kippe
42434dd038 Adding support for the summary vectors BFLOWI|J|K 2023-09-13 09:15:03 +02:00
Bård Skaflestad
b1672210ba Merge pull request #3669 from steink/well_control_access
Utility functions for manipulation of well-controls
2023-09-12 13:33:53 +02:00
Bård Skaflestad
8cde088e19 Merge pull request #3665 from atgeirr/make-wconinjh-invalid-mode-a-warning
Allow invalid WCONINJH control mode
2023-09-12 13:29:03 +02:00
Atgeirr Flø Rasmussen
1e2f23ac03 Merge pull request #3672 from bska/remove-extra-semicolon
Remove Unnecessary Semicolons on Closing Braces
2023-09-11 17:54:20 +02:00
Atgeirr Flø Rasmussen
92a716fa18 Make it a warning instead of an error to specify an invalid control mode in WCONINJH.
Motivated by the need to accept deck output that contain this error,
that is generated by preprocessing tools.
2023-09-11 17:39:48 +02:00
Bård Skaflestad
1261cf2b5c Remove Unnecessary Semicolons on Closing Braces
These generate diagnostic messages from GCC at '-pedantic' levels.
2023-09-07 17:07:35 +02:00
Stein Krogstad
6ecabdbd7b Add access to injection controls 2023-09-07 13:48:09 +02:00
Stein Krogstad
703431ce61 Add functions to enable edit of prod controls 2023-09-07 13:48:09 +02:00
Bård Skaflestad
3411e1e0c6 Merge pull request #3651 from plgbrts/std-netw-gaslift
Adding item 6 (gas lift) to standard network keyword GRUPNET
2023-09-06 14:32:09 +02:00
Paul
ad076fc3c2 removed usage of Deckitem::to_bool() 2023-09-05 13:53:31 +02:00
Atgeirr Flø Rasmussen
5010643b0d Merge pull request #3654 from bska/tidy-multregt-scanner
Tidy Up MULTREGT Scanner Implementation File
2023-09-04 15:26:55 +02:00
Paul
ee8c0a28a1 changed a comment 2023-09-04 10:58:34 +02:00
Paul
bd878c2312 reverted file 2023-09-04 10:58:34 +02:00
Paul
75e6318474 rebase 2023-09-04 10:58:33 +02:00
Paul
f04bbefaee add gas-lift to standard network 2023-09-04 10:58:33 +02:00
Paul
d1eed2cd4d allow for wildcards 2023-09-04 10:58:32 +02:00
Paul
bf1b2dbef9 fixing unit test 2023-09-04 10:58:32 +02:00
Bård Skaflestad
53e2758649 Ignore Default Regions in MULTREGT
The MULTREGT keyword has an independent way of defining the default
region--the default value of item 6--and does not need the default
GRIDOPTS-base region protocol of the other *REG keywords.
2023-09-04 10:30:36 +02:00
Bård Skaflestad
f6676fcc1a Reorder MULTREGTScanner Implementation File
Mostly to group related functions and have the same order in the
declaration and the implementation files.  While here, replace an
'enum' with a strong enum since the type does not need to support
arithmetic operations.
2023-09-04 10:30:36 +02:00
Bård Skaflestad
383dbf27a9 Merge pull request #3653 from bska/identify-aqunum-cells
Add Method for Identifying Numerical Aquifer Cell IDs
2023-09-04 10:14:06 +02:00
Bård Skaflestad
b84c5f46bf Add Method for Identifying Numerical Aquifer Cell IDs
This commit adds a new, focused, member function

  NumericalAquifers::allAquiferCellIds()

which returns a vector of those Cartesian/global cells that have
been marked as defining the model's numerical aquifers through the
AQUNUM keyword.  We intend to use this to identify those NNCs that
go to numerical aquifers--or between numerical aquifer cells--as
those may need special treatment when processing the MULTREGT
keyword.
2023-09-04 08:52:08 +02:00
Kai Bao
3ab1f65485 Merge pull request #3640 from vkip/top_segment_perfdepth
Avoid top segment perforation depth outside perforated grid cell.
2023-09-01 23:55:37 +02:00
Vegard Kippe
7d7d15e331 Removing unused include 2023-09-01 16:01:20 +02:00
Vegard Kippe
1728d9d310 Addressing test failure in MulgisegmentWellTests + slight change to avoid modifying Connection.cpp 2023-09-01 15:59:28 +02:00
Vegard Kippe
57a70082bc Updated comment 2023-09-01 15:59:28 +02:00
Vegard Kippe
4f74385dc0 Avoid connection depths outside perforated cell. 2023-09-01 15:59:27 +02:00
Tor Harald Sandve
263070f9b4 Merge pull request #3657 from hakonhagland/gecon2
Implement support for GECON keyword
2023-09-01 15:06:36 +02:00
Tor Harald Sandve
1d048e43d2 Merge pull request #3648 from totto82/fix_waghystr
avoid negative C factor
2023-09-01 15:03:02 +02:00
Atgeirr Flø Rasmussen
8dab1ea48a Merge pull request #3642 from bska/parser-accept-registered-long-keywords
Recognise Extension Keywords Whose Names Exceed Size Limits
2023-09-01 12:42:14 +02:00
Bård Skaflestad
f14621aeba Recognise Extension Keywords Whose Names Exceed Size Limits
This commit adds targeted support for identifying keywords whose
names exceed the maximum compatibility keyword length limit.  This,
in turn, enables seamless recognition of extension keywords such as

  STRESSEQUILNUM

without compromising the parser's ability to identify long keyword
names that match existing keywords in the first eight characters.
For example, the input string 'GUIDERATE' will still match the
keyword 'GUIDERAT' (without the trailing 'E') and will not be
accidentally treated as a SUMMARY section request to output a group
level UDQ vector.
2023-08-30 15:27:06 +02:00
Bård Skaflestad
e179bf87dd Split Keyword Recognition Into Two Parts
The 'base' checks that the input string looks like a valid keyword
and, if so, matches the string against the builtin set of known
keywords.  The full keyword recognition process additionally
includes those keywords that match against keyword collections,
typically the SUMMARY section "meta" keywords in the *_PROBE files.

We will use the 'base' recognition separately to introduce support
for extension keywords with long--more than eight character--names.
2023-08-30 15:27:06 +02:00
Bård Skaflestad
d3a68ff861 Merge pull request #3628 from GitPaean/filtration_summary_keywords
Filtration summary keywords
2023-08-30 13:31:54 +02:00
Kai Bao
63a2c77063 optimizing filtration summary keyword output evaluation 2023-08-29 22:29:41 +02:00
Tor Harald Sandve
0fad30d7cb Fix three phase check in waghystr model. Also check for oil phase 2023-08-29 12:39:46 +02:00
Håkon Hægland
612e4c0e9c Move template implementation to header file 2023-08-29 10:36:54 +02:00
Håkon Hægland
7d1f1b103e Move template implementation to header file 2023-08-29 10:28:42 +02:00
Kai Bao
48b759178c fixing the parallel running and testing related to filtrate 2023-08-29 09:08:45 +02:00
Kai Bao
2d35b1e20c adding support for the filtrate summary keywords 2023-08-29 09:08:45 +02:00
Kai Bao
b2eb44423a adding some OPM-specific Well and Connection Summary keywords
for the development of the filtration modeling during the water
injection.
2023-08-29 09:08:45 +02:00
Håkon Hægland
bec10dbfbe Implement GECON keyword
Implements support for the GECON keyword.
2023-08-29 01:10:21 +02:00
Bård Skaflestad
a0e72a62c4 Merge pull request #3528 from vkip/tuning_max_next_tstep
TUNING/NEXT[STEP]: Facilitate using max time step only when specified
2023-08-28 15:03:31 +02:00
Vegard Kippe
b47324e42f Actually check the TSINIT value in TuningTests.cpp 2023-08-28 11:21:34 +02:00
Vegard Kippe
98adf5a536 Workaround to avoid failing tests, also fixed some tab indenting. 2023-08-28 11:21:34 +02:00
Vegard Kippe
128ba83810 Facilitate using max time step from TUNING/NEXT[STEP] only when specified. Also corrects the persistent behaviour of NEXTSTEP. 2023-08-28 11:21:33 +02:00
Kai Bao
325ee7bbb3 Merge pull request #3652 from GitPaean/remvoing_vfp_group
removing the vfp_table member from Group class
2023-08-25 23:18:36 +02:00
Kai Bao
0c64a142c1 removing the vfp_table member from Group class
after GRUPNET is processed, vfp_table is not useful for GROUP class
anymore.
2023-08-25 00:21:45 +02:00
Kai Bao
b4c30cf93b Merge pull request #3643 from vkip/avoid_zero_conndepth
Avoid connection depth = 0 when segment is specified without depth in COMPSEGS
2023-08-23 23:53:19 +02:00
Kai Bao
d9278cf053 Merge pull request #3609 from plgbrts/std-network
Enable standard network using GRUPNET
2023-08-23 23:03:12 +02:00
Paul
a90d899bc0 removed repeated line 2023-08-23 16:16:53 +02:00
Paul
7d2083b948 restructuring 2023-08-23 16:16:52 +02:00
Paul
83157a01dd added unit standard network test in NMetworkTests and removed test in GroupTests 2023-08-23 16:16:52 +02:00
Paul
feb9c9c948 added two throws 2023-08-23 16:16:52 +02:00
Paul
1d1bd74cf8 add const for group 2023-08-23 16:16:51 +02:00
Paul
262c325960 Adressing review comments 2023-08-23 16:16:51 +02:00
Paul
dbeb7405ba add_node -> update_node 2023-08-23 16:16:51 +02:00
Paul
7fa0d94e7b code fixes based on review comments 2023-08-23 16:16:50 +02:00
Paul
88b654fb57 allow for wildcards 2023-08-23 16:16:50 +02:00
Paul
f70a0e50e0 Rebasing 2023-08-23 16:16:49 +02:00
Paul
5a342db5a3 removed an include 2023-08-23 16:16:49 +02:00
Paul
4c1ea1f478 Enable standard network using GRUPNET 2023-08-23 16:16:48 +02:00
Markus Blatt
4ab9de18ed Merge pull request #3649 from GitPaean/fixing_numerical_aquifer
not considering numerical aquifers cells inside reservoir
2023-08-23 15:52:19 +02:00
Kai Bao
06a4d3ef51 not considering numerical aquifers cells inside reservoir
since we forcefully make numerical aquifer cells active. If a connection
cells is neighboring a numerical aquifer cell, we should be able to create
NNC to connection the cell and the nuermical aquifer cell.
2023-08-23 14:24:12 +02:00
Bård Skaflestad
5c09a1ed62 Merge pull request #3614 from GitPaean/udq_winjclcn
handle UDQ value for WINJFCNC
2023-08-23 13:37:18 +02:00
Kai Bao
6a25eadee7 using PPM as the unit for VOL_CONCENTRATION in keyword WINJFCNC 2023-08-23 11:44:13 +02:00
Kai Bao
9a7147bead handle UDQ value for WINJFCNC
restarting related is missing for now
2023-08-23 11:44:13 +02:00
Bård Skaflestad
e8502c2d6d Merge pull request #3650 from akva2/init_file_restore_order
fixed: restore order of 'standard' fields in init file
2023-08-23 11:29:20 +02:00
Arne Morten Kvarving
0e99224e12 fixed: restore order of 'standard' fields in init file
we want to match the commercial simulator here
2023-08-23 10:46:03 +02:00
Tor Harald Sandve
e08a4efe65 avoid negative C factor 2023-08-22 12:23:38 +02:00
Markus Blatt
45ec2f9c89 Merge pull request #3645 from blattms/fix_esmry-scale-factors
Pevent undefined behavior of ESMry scale factors for values <=0.
2023-08-22 07:21:20 +02:00
Markus Blatt
d9cdfac302 Merge pull request #3639 from bska/multregt-revise-nnc-identification
Use Existing Cartesian-to-IJK Functionality to Determine NNCs in MULTREGT
2023-08-22 07:19:16 +02:00
Markus Blatt
6b194d8758 Merge pull request #3644 from bska/multregt-no-pointers
Switch to Numeric Indices for Record References
2023-08-22 07:18:13 +02:00
Bård Skaflestad
f32ff86638 Use Existing Cartesian-to-IJK Functionality
This commit replaces the data members 'nx', 'ny', and 'nz' with a
copy of the GridDims object passed as an argument to the
constructor.  In turn, this enables using GridDims::getIJK() to
compute the cell's IJK tuple from its global Cartesian index instead
of implementing the same calculation locally (and incorrectly).

While here, also include the layer index (K) in determining whether
or not a connection is an NNC, and do this just once instead of once
for each MULTREGT record.  Cells (I,J,K) and (I,J,K+3) might be
connected across pinched-out layers and for the purposes of MULTREGT
that connection should be treated as an NNC.
2023-08-21 11:41:03 +02:00
Bård Skaflestad
2c74d036d6 Tidy Up MULTREGT Scanner Files
In particular, ensure that we include all requisite headers, hide
type aliases that are not needed outside the class, consistently use
std::size_t, split a few long lines, and switch to range-for in one
location.
2023-08-21 11:41:03 +02:00
Bård Skaflestad
2dc650ff72 Switch to Numeric Indices for Record References
A numeric index serves the same purpose as a pointer in this very
specific instance and also has the benefit of being easily
transferable between processes.  This, in turn, means we can remove
the 'getSearchMap()' and 'constructSearchMap()' member functions.
2023-08-21 11:40:44 +02:00
Markus Blatt
07d1d5f161 Pevent undefined behavior of ESMry scale factors for values <=0.
We use log10 of the value to compute the scale factor. This only makes
sense for positive values. For zero it returns -HUGE_VAL and for
negative values it returns nan where supported.

Unfortunately on some platforms (e.g. mips64el) further operations in
nan resulted in values so large that the scale factors were to large
for the columns. This resulted in invalid_argument exceptions in
strtod which were hard to debug. Out of pure luck on many platforms
the scale factors still were zero in this case.

To fix this we now always use a scale factor 0 for values less or
equal to zero. This fixes e.g. Debian packages on mips64el.

In addition we now make sure that printed scale factors have less
characters than the column width. Otherwise parsing the *.RSM file
might fail because of throwing strtod function.
2023-08-21 07:54:04 +02:00
Vegard Kippe
570666afea Removed commented-out lines 2023-08-18 16:51:09 +02:00
Vegard Kippe
624ff6f771 Perform the connection-depth-from-segments calculations even if the segment number is specified. 2023-08-18 16:47:43 +02:00
Bård Skaflestad
99e3608bf3 Merge pull request #3626 from GitPaean/adding_unit_area
adding unit area
2023-08-17 15:09:49 +02:00
Kai Bao
13eaf8a271 adding unit area 2023-08-17 13:55:33 +02:00
Bård Skaflestad
ddb94c15a3 Merge pull request #3637 from akva2/mech_props
Add field properties used for mechanics
2023-08-17 13:12:15 +02:00
hnil
d157bd627f add THELCOEF field property
this is the thermal expansion coefficient for each cell in a mechanics model
write this to the .INIT file for relevant models
2023-08-17 11:54:18 +02:00
hnil
861be6be91 add THERMEXR field property
this is the thermal expansion ratio for each cell in a mechanics model
write this to the .INIT file for relevant models
2023-08-17 11:54:18 +02:00
hnil
1948dc5d51 add PRATIO field property
this is the Poisson's ratio for each cell in a mechanics model
write this to the .INIT file for relevant models
2023-08-17 11:54:18 +02:00
hnil
27dcd6e246 add POELCOEF field property
this is the coefficient of elasticity for each cell in a mechanics model
write this to the .INIT file for relevant models
2023-08-17 11:54:18 +02:00
hnil
191364d2f3 add BIOTCOEF field property
this is the Biot coefficient for each cell in a mechanics model
write this to the .INIT file for relevant models
2023-08-17 11:54:18 +02:00
hnil
6ed7370db3 add STRESSEQUILNUM field property
this is used to set the stress equilibration region for cells in
mechanics models
2023-08-17 11:54:18 +02:00
hnil
217f8f7b60 add YMODULE field property
this is the Young's modulus for each cell in a mechanics model
write this to the .INIT file for relevant models
2023-08-17 08:34:51 +02:00
hnil
3a66f7c9b6 added: Ymodule dimension in UnitSystem 2023-08-17 08:14:09 +02:00
Bård Skaflestad
e22b0944dd Merge pull request #3632 from vkip/correct_rft_depths_and_pressures
Make DEPTH and PRESSURE contain the cell values
2023-08-16 17:50:32 +02:00
Bård Skaflestad
58ff8944c4 Merge pull request #3636 from akva2/mech_bc
Add support for MECH boundary conditions
2023-08-16 16:52:21 +02:00
Bård Skaflestad
0c037db51c Merge pull request #3635 from akva2/add_strequil
Add STREQUIL keyword and internalization
2023-08-16 16:12:19 +02:00
Bård Skaflestad
6e4c37d05f Merge pull request #3634 from akva2/mech_runspec
-- added MECH to runspec
2023-08-16 16:11:38 +02:00
hnil
614d71666d add mech boundary conditions 2023-08-16 15:56:45 +02:00
hnil
a0ba0be7cc -- added stress equilibrium data for initconfig 2023-08-16 15:13:38 +02:00
Arne Morten Kvarving
111aa44936 changed: refactorize Equil class into a container template over a record type
make Equil a type alias for EquilContainer<EquilRecord>
2023-08-16 15:13:38 +02:00
Arne Morten Kvarving
df6345e15d EquilRecord: add in-class initializers
then we can default the default constructor
2023-08-16 15:13:38 +02:00
Arne Morten Kvarving
a93e285552 changed: add EquilRecord::serializationTestObject
and use this in Equil::serializationTestObject()
2023-08-16 15:13:38 +02:00
Arne Morten Kvarving
89f59e0050 changed: add a DeckRecord constructor for EquilRecord and use this in Equil 2023-08-16 15:13:38 +02:00
Bård Skaflestad
3fd1815078 Merge pull request #3633 from akva2/bcconfig_tests
added: basic tests for BCCON / BCPROP
2023-08-16 15:06:52 +02:00
Vegard Kippe
12c20f4188 Removing unused parameter 2023-08-16 14:44:16 +02:00
hnil
980a160651 -- added MECH to runspec 2023-08-16 14:15:23 +02:00
Arne Morten Kvarving
bd3328b15c added: basic tests for BCCON / BCPROP 2023-08-16 13:58:39 +02:00
Vegard Kippe
c97ef332f0 Removing duplicate lines.. 2023-08-16 13:22:32 +02:00
Vegard Kippe
25cf268b56 Removing unnecessary changes to PLT record (only renaming to conn_depth_ and conn_pressure_ for clarity, as suggested) 2023-08-16 13:20:53 +02:00
Markus Blatt
d23d2288c7 Merge pull request #3629 from bska/reclassify-PCx-keywords
Properly Classify Capillary Pressure Keywords
2023-08-16 10:18:21 +02:00
Vegard Kippe
8031eaf9d0 Make DEPTH and PRESSURE contain the cell values, not the connection values (which are reported in CONDEPTH/CONPRES when PLTs are requested) 2023-08-16 09:41:28 +02:00
Bård Skaflestad
f68fe9b484 Properly Classify Capillary Pressure Keywords
These are not directionally dependent, and they have a unit string
of 'Pressure'.  This didn't use to matter, but upcoming changes
will depend on the unit string being correct.
2023-08-15 17:27:47 +02:00
Bård Skaflestad
5495eca413 Properly Remove 'satfunc' Macro
The macro should not escape the FieldProps.hpp header.
2023-08-15 17:27:47 +02:00
Bård Skaflestad
cda61b46c0 Remove sogcr_shit Helper Array
This array became unused in commit 146be0aa2 and should have been
removed at that time.
2023-08-15 17:27:47 +02:00
Bård Skaflestad
4f3d22f655 Merge pull request #3631 from akva2/tracy_macro_definitions
TimingMacros: add definitions for using tracy
2023-08-15 17:18:42 +02:00
Arne Morten Kvarving
89deeea9d5 TimingMacros: add definitions for using tracy 2023-08-15 15:55:03 +02:00
Atgeirr Flø Rasmussen
ed8489ada6 Merge pull request #3630 from svenn-t/h2store_new_visc
Improved gas viscosity model for hydrogen
2023-08-15 08:31:01 +02:00
Svenn Tveit
c6cd71df08 Improved viscosity model for hydrogen.
Model from Muzney et al., J. Chem. Eng. Data 2013, 58, 4, 969–979 implemented. Same as NIST and Coolprop.
2023-08-14 12:31:01 +02:00
Bård Skaflestad
f95cbea921 Merge pull request #3625 from GitPaean/adding_unit_ppm
adding unit PPM
2023-08-10 16:29:34 +02:00
Kai Bao
22de6c1480 adding unit PPM
Parts per million (ppm). We are not distinguishing PPM volume or PPM
mass, or other forms. Will update when it comes to be necessary.
2023-08-10 15:23:14 +02:00
Bård Skaflestad
0895983ac1 Merge pull request #3619 from bska/field-props-janitor
Preventive Maintenance of FieldProps Class
2023-08-09 17:06:08 +02:00
Bård Skaflestad
3caf79a99a Disambiguate Potentially Dependent Names
It's probably not strictly necessary, but better safe than sorry.
2023-08-09 14:37:57 +02:00
Bård Skaflestad
027c15800a Preventive Maintenance of FieldProps Class
In particular:
  - Order include statements
  - Simplify logic
  - Adjust whitespace

This is in preparation of making FIP* array names unique only up to
the first six characters (i.e., "FIP" + at most three others).
2023-08-09 14:37:57 +02:00
Kai Bao
144faaf645 Merge pull request #3623 from atgeirr/allow-default-network-nodes
Allow implicit creation of production network nodes.
2023-08-09 14:31:50 +02:00
Atgeirr Flø Rasmussen
67c7f858a4 Rename add_node() -> update_node(). 2023-08-09 13:28:24 +02:00
Bård Skaflestad
aab5d1125b Merge pull request #3584 from svenn-t/unittests
Component unit tests and some minor updates
2023-08-08 18:14:37 +02:00
Bård Skaflestad
40d806987c Merge pull request #3624 from blattms/move-lambda-prevent-warn
[janitor] Move lambda to prevent warning.
2023-08-08 17:22:19 +02:00
Markus Blatt
ee30e6f42d [janitor] Move lambda to prevent warning.
Fixes the warning introduced by #3605
2023-08-08 16:13:40 +02:00
Atgeirr Flø Rasmussen
508ed49388 Add test for defaulted network nodes. 2023-08-08 16:00:21 +02:00
Atgeirr Flø Rasmussen
f3d1eea2dc Allow implicit creation of nodes.
Nodes with default properties do not need any
NODEPROP entries and can be implicitly created
by being referred to in BRANPROP.
2023-08-08 15:46:57 +02:00
Atgeirr Flø Rasmussen
fb37377324 Merge pull request #3605 from blattms/fatal-section-topology-errors
Register errors concerning section topology in ErrorGuard.
2023-08-08 11:30:02 +02:00
Markus Blatt
395d85fb55 Merge pull request #3618 from bska/ordered-map-string-view
Implement OrderedMap in Terms of String_View
2023-08-08 11:14:45 +02:00
Bård Skaflestad
7533eadb2e Implement OrderedMap in Terms of String_View
We don't need std::string in the hashing operations, so lift those
restrictions.
2023-08-07 17:04:13 +02:00
Atgeirr Flø Rasmussen
e51c5cb4dd Merge pull request #3616 from GitPaean/removing_duplicated_clang_key
removing duplicated key in .clang-format
2023-08-07 10:09:20 +02:00
Kai Bao
2551050974 removing duplicated key in .clang-format 2023-08-04 15:00:56 +02:00
Bård Skaflestad
f0c5ed5f83 Merge pull request #3613 from akva2/grouptests_raw
GroupTests: use raw string literals
2023-08-01 23:33:31 +02:00
Arne Morten Kvarving
bd59b6caab GroupTests: remove leading whitespace in decks 2023-08-01 14:38:54 +02:00
Arne Morten Kvarving
2ba0caab7f GroupTests: use raw string literals 2023-08-01 14:38:54 +02:00
Atgeirr Flø Rasmussen
9b22346255 Merge pull request #3612 from akva2/janitoring
quell unused parameter warnings
2023-07-31 12:50:02 +02:00
Arne Morten Kvarving
b1cf35168a quell unused parameter warnings 2023-07-31 08:37:58 +02:00
Atgeirr Flø Rasmussen
a50513c971 Merge pull request #3585 from hnil/twophaseFixes
Fixes for two-phase relperm
2023-07-26 15:31:02 +02:00
hnil
6de987eaec fixed after review 2023-07-26 14:09:15 +02:00
Markus Blatt
3eddcb8936 Merge pull request #3607 from blattms/rename-time-step-breakdown
Rename LinearTimeSteppingBreakdown to TimeSteppingBreakdown
2023-07-26 09:49:15 +02:00
Markus Blatt
0a916c4b73 Rename LinearTimeSteppingBreakdown to TimeSteppingBreakdown
Indeed that is more intuitive. I guess the previous name was due to
copy & paste and forgetting to change things afterwards.
2023-07-25 14:56:47 +02:00
Tor Harald Sandve
79137ae882 Merge pull request #3604 from blattms/fix-ptflash
[bugfix] Use numComponents when accessing K_/moleFractions_ in PTFlash.
2023-07-25 12:24:58 +02:00
Markus Blatt
e5c44baf38 Also detect keywords after operate key words in wrong section.
This will find keywords in statements like
MULTIPLY
  'TRANX' 2.0 /
  'TRANY' 2.0 /
 /
2023-07-24 15:59:01 +02:00
Bård Skaflestad
ebd2ab4e59 Merge pull request #3573 from goncalvesmachadoc/collectCarfin
Store Multiple Lgrs
2023-07-21 09:34:48 +02:00
goncalvesmachadoc
946462e377 delete carfin from string 2023-07-20 11:15:23 +02:00
Markus Blatt
016dfa9ea7 Prevent std::exit(1) in tests due to ErrorGuard's destructor.
If ErrorGuard's lists have not been cleared, then it's destructor
will call std::exit(1). As that is quite unfortunate in a test, we
clear it's message stack at the end of the tests.
2023-07-20 10:36:05 +02:00
Markus Blatt
e56e2f4d26 Register errors concerning section topology in ErrorGuard.
That will make those (e.g. EDITNNC in the GRiD section) fatal.
2023-07-19 17:44:59 +02:00
goncalvesmachadoc
d23b045905 delete prefix for testing 2023-07-19 11:18:15 +02:00
goncalvesmachadoc
1c780e78f4 towards serialization 2023-07-18 16:42:11 +02:00
goncalvesmachadoc
5df7a148e9 get lgr by index 2023-07-18 12:02:09 +02:00
goncalvesmachadoc
0c897eb51d update for loops 2023-07-18 11:15:23 +02:00
goncalvesmachadoc
fb2290a07a extra line 2023-07-18 10:32:54 +02:00
goncalvesmachadoc
c0404e798e update tests 2023-07-18 10:32:53 +02:00
goncalvesmachadoc
c5f664650e collectLGRinEclState 2023-07-18 10:32:53 +02:00
goncalvesmachadoc
ca6f232486 expand methods 2023-07-18 10:32:52 +02:00
goncalvesmachadoc
0aa2941150 start for unit tests 2023-07-18 10:32:52 +02:00
goncalvesmachadoc
94e9900d39 small fix class 2023-07-18 10:32:51 +02:00
goncalvesmachadoc
4e7fde0c64 simplify collection 2023-07-18 10:32:51 +02:00
goncalvesmachadoc
22c5965fb5 add carfin collection 2023-07-18 10:32:50 +02:00
Bård Skaflestad
ee44c0fbe5 Merge pull request #3602 from blattms/gcc-13-missing-include
Added missing include of cstdint for GCC-13
2023-07-18 10:21:46 +02:00
Markus Blatt
e694e465e0 Use int type from std namespace. 2023-07-17 12:40:27 +02:00
Bård Skaflestad
d7f1b6bd27 Merge pull request #3601 from plgbrts/gconprod
Enable items, 11, 12 and 13 of GCONPROD
2023-07-14 21:23:23 +02:00
Paul
babf4c590d fix for test GroupTests 2023-07-14 13:18:13 +02:00
Paul
2470cf2ed7 Use bitwise or 2023-07-14 11:26:03 +02:00
Paul
c422724422 Struct for collecting group limit actions 2023-07-14 11:16:29 +02:00
Markus Blatt
063b1f284a [bugfix] Use numComponents when accessing K_/moleFractions_ in PTFlash.
Previously we did read and write out of bounds as num_equations might
be bigger than numComponents. For GCC-13 this even caused endless loops.
2023-07-14 10:18:07 +02:00
Markus Blatt
f284a7e7fb Added missing include of cstdint for GCC13
Without the include compilation fails with
```
/opm/io/eclipse/EclFile.hpp:92:17: error: ‘uint64_t’ was not declared in this scope
   92 |     std::vector<uint64_t> ifStreamPos;
      |                 ^~~~~~~~
In file included from src/opm/io/eclipse/EclOutput.cpp:20:
opm/io/eclipse/EclUtil.hpp:56:5: error: 'uint64_t' does not name a type
   56 |     uint64_t sizeOnDiskBinary(int64_t num, Opm::EclIO::eclArrType arrType, int elementSize);
      |     ^~~~~~~~

```
2023-07-14 08:37:56 +02:00
Paul
f8dac94ac9 some formatting 2023-07-13 13:17:45 +02:00
Markus Blatt
bb94b09c79 Merge pull request #3600 from bska/record-actionx-well-structure-change
Add Facility for Recording ACTIONX Well Structure Changes
2023-07-13 10:27:37 +02:00
Paul
7d6391b1fa added serializer items 2023-07-12 22:12:39 +02:00
Paul
e86f7f2d2d Enable items, 11, 12 and 13 of GCONPROD 2023-07-12 20:45:09 +02:00
Bård Skaflestad
5f0941677a Add Facility for Recording ACTIONX Well Structure Changes
This commit adds a new member, well_structure_change, to the
SimulatorUpdate structure.  The member defaults to 'false', but
will be set to 'true' if an ACTIONX block contains at least one of
a select group of keywords that affect the model's well topology.

In particular, set this member to 'true' if the ACTIONX block has
at least one of the keywords

  - COMPDAT
  - WELOPEN
  - WELSPECS

This will enable adding simulator logic to open or create wells in
the middle of a report step.
2023-07-12 17:31:30 +02:00
Bård Skaflestad
684dbb21b4 Merge pull request #3599 from blattms/exception-time-stepper
Added exception to mark time step being cut too often.
2023-07-12 16:52:28 +02:00
Markus Blatt
7e3eeb34b0 Added exception to mark time step being cut too often.
This is needed for a more user friendly message in the simulator.
2023-07-12 14:17:56 +02:00
Bård Skaflestad
7c6af8584f Merge pull request #3560 from bska/wbp-emit-values
Emit WBPn Summary Vectors to Summary Result File
2023-07-11 14:15:05 +02:00
Bård Skaflestad
dbaf600fcf Emit WBPn Summary Vectors to Summary Result File
This commit hooks the WBPn result vectors up to the summary file
writing process.
2023-07-11 13:15:43 +02:00
Bård Skaflestad
e549690df4 Merge pull request #3598 from goncalvesmachadoc/gconprod
Make only one json for GCONPROD
2023-07-11 13:09:26 +02:00
goncalvesmachadoc
29cd408d99 one json 2023-07-11 11:49:07 +02:00
Bård Skaflestad
35a99be016 Merge pull request #3597 from bska/use-algorithm-for-keyword-list
Use Algorithm Instead of Raw Loop
2023-07-10 16:06:26 +02:00
Bård Skaflestad
f0d0a87606 Use Algorithm Instead of Raw Loop
Mostly for maintainability.
2023-07-10 14:39:16 +02:00
Bård Skaflestad
264cd13138 Merge pull request #3594 from bska/smry-emit-phase-densities
Add Summary Output of Fluid Densities at Block and Segment Levels
2023-07-10 13:58:47 +02:00
Bård Skaflestad
7f80ae8e2a Add Summary Output of Segment Level Fluid Densities
In particular, recognize the summary vectors

  - SDENx -- Phase density of phase 'x' (segment conditions)
  - SDENM -- Fluid mixture density without flowing fraction exponents
  - SMDEN -- Fluid mixture density with flowing fraction exponents
2023-07-07 16:26:58 +02:00
Bård Skaflestad
6dae660cc9 Add Summary Output for Block Level Phase Densities
In particular, recognize block level summary vectors

    BxDEN, BDENx

for the phase densities of phase 'x' (O, G, W).
2023-07-07 16:26:58 +02:00
Bård Skaflestad
3e6a5cfc2d Push Block Level Unit Conversion to Summary Output
The 'BLOCK_VARIABLES' test was doing manual unit conversion and
there's no need for that.
2023-07-07 13:56:18 +02:00
Bård Skaflestad
2f164e84b2 Merge pull request #3596 from bska/fix-rseg-item-description
Revise Description of Item 7 in RSEG
2023-07-06 12:58:23 +02:00
Bård Skaflestad
6590ea2e78 Merge pull request #3595 from blattms/warn-operations-empty-regions
Issue warning for operations on empty regions.
2023-07-06 12:58:02 +02:00
Bård Skaflestad
8fc1389de0 Revise Description of Item 7 in RSEG
This item is the depth of the node segment, not the depth change
relative to the top segment.  Rename the associate variables
accordingly.
2023-07-06 12:02:45 +02:00
Markus Blatt
267e1b07bd Issue warning for operations on empty regions.
If the user did not set MULTNUM but has e.g.
```
MULTIREG
PORV    0.8     2 /
PORV    0.8     7 /
PORV    0.8   3 /
PORV    0.8   8 /
PORV    1   4 /
PORV    1   9 /
/
```

he at least gets a warning like
```
Warning: MULTNUM region 2 has no active cells when processing operation MULTIREG on keyword PORV.
Please check whether this is on purpose or you missed defining the region properly.
In file /path/to/model/porvmultsny.inc, line 1
```

This should aid him with detecting possible errors.
2023-07-05 17:32:36 +02:00
Markus Blatt
98fe4e4d29 Merge pull request #3524 from verveerpj/fix-table-error-msgs
Fix table-related error messages
2023-07-05 15:12:59 +02:00
Bård Skaflestad
13e4394b45 Merge pull request #3593 from bska/smry-phase-densities
Add Transport Protocol for Segment Level Phase Densities
2023-07-05 12:10:29 +02:00
Bård Skaflestad
e7226d4ca8 Add Transport Protocol for Segment Level Phase Densities
This commit adds the requisite backing storage and parser support
for capturing and transporting simulator-level calculation of phase
and mixture density value for purpose of summary file output.  To
this end, make 'SegmentQuantity' into a template on a set of defined
items and make SegmentPhaseQuantity into a specialisation of this
template.  Add a new specialisation, SegmentPhaseDensity, which
holds phase densities (oil, gas, water), and fluid mixture densities
with and without flowing fraction exponents.

These will be used to transport the values needed to output segment
level summary vectors

    SDENx -- Phase density of phase 'x' (O, G, W)
    SDENM -- Fluid mixture density without flowing fraction exponents
    SMDEN -- Fluid mixture density with flowing fraction exponents
2023-07-05 11:31:10 +02:00
Bård Skaflestad
784faa2b05 Merge pull request #3592 from bska/adjust-smry-whitespace
Group Block Level Summary Vectors by Phase
2023-07-05 11:23:49 +02:00
Bård Skaflestad
5f3e6f9084 Group Block Level Summary Vectors by Phase
Mostly to aid future maintenance.  While here, also re-indent the
other unit tables and add a type alias (UnitTable) to avoid spelling
out the 'unordered_map<>' type repeatedly.
2023-07-05 10:57:53 +02:00
Markus Blatt
c2cc368f42 Merge pull request #3591 from bska/more-segment-smry-vecs
Add More Segment Level Summary Vectors
2023-07-05 10:24:19 +02:00
Bård Skaflestad
5b6f064804 Add More Segment Level Summary Vectors
In particular, add support for

   SxFT  - Cumulative flow of phase 'x'
   SxFV  - Free flow velocity of phase 'x'
   SxHF  - Free flow holdup fraction of phase 'x'
   SxVIS - Phase viscosity of phase 'x'

The last three of these were added to the RFT file in 802a401a8,
but are also useful in the summary output file.  In the interest of
avoiding duplicate logic, refactor the existing segment-related
quantity calculation/extraction in terms of callbacks.
2023-06-30 16:42:53 +02:00
Bård Skaflestad
4fb2a3557b Merge pull request #3313 from GitPaean/support_cake_filteration
A simple cake model to simulate formation damage due to suspended solids in injection water
2023-06-30 15:51:41 +02:00
Kai Bao
508c123eed addressing the reviewing comments for PR #3313 2023-06-30 11:35:25 +02:00
Svenn Tveit
f3e2960a5c Correct tolerance 2023-06-29 14:28:35 +02:00
Svenn Tveit
945642724e Tests output more useful error messages 2023-06-29 14:23:39 +02:00
Kai Bao
39608fa1ed re-organizing the filter cake related
to address the reviewing comments and improve the code.
2023-06-29 11:42:26 +02:00
Svenn Tveit
5e3a8b0ae1 Get rid of pow() 2023-06-29 11:06:02 +02:00
Tor Harald Sandve
d07d8675ae Merge pull request #3574 from totto82/fixSalinity
BUGFIX: Use salinity values when salt concentration (BRINE) is not considered
2023-06-29 09:00:28 +02:00
Bård Skaflestad
b76b22b697 Merge pull request #3583 from blattms/file-trailing-ws-error
trim trailing and leading whitespace of paths in INCLUDE
2023-06-28 21:36:33 +02:00
Bård Skaflestad
17f740dab1 Merge pull request #3588 from atgeirr/silence-vsprintf-warning
Fix warning from external code.
2023-06-28 21:34:40 +02:00
Bård Skaflestad
7e31d9605f Merge pull request #3589 from blattms/file-line-unknown-keyword
Provide file and line for errors because of unknown keywords.
2023-06-28 21:26:08 +02:00
Svenn Tveit
cc34178e59 Adjust unit test to reverted co2tables.inc.
Have to correct for different reference state between test data and co2tables.inc. Took out some enthalpy data due to one data point giving unreasonably large error (probably related to reference state difference).
2023-06-28 19:41:14 +02:00
Markus Blatt
b5f7d9e3f8 Provide file and line for errors because of unknown keywords.
```
Error: Unknown keyword: KEY6

Error: Unrecoverable errors while loading input: Problem with keyword
In <memory string> line 0
Unknown keyword: KEY6
```
does not tell the user where his/her error is.

This is now changed to
```
Error: Unknown keyword: KEY6

Error: Unrecoverable errors while loading input: Problem with keyword NE6
In /path/to/include/grid/file.inc line 7
Unknown keyword: KEY6
```
which gives the user a greater chance of finding out what is wrong.
2023-06-28 18:59:25 +02:00
Svenn Tveit
605115c628 Revert "Expanded T-p domain and included more data points"
This reverts commit d891255ba4.
2023-06-28 18:51:19 +02:00
Svenn Tveit
b469a14598 Corrected path to reference data 2023-06-28 18:07:49 +02:00
Markus Blatt
2fa51c6edb Also cater for trailing/leading ws for GDFILE/IMPORT keywords.
By trimming the strings.
2023-06-28 16:48:55 +02:00
Tor Harald Sandve
adfe24dbcd Merge pull request #3482 from totto82/bc_schedule
BC in Schedule
2023-06-28 16:27:09 +02:00
Atgeirr Flø Rasmussen
0b930bc45c Fix warning from external code. 2023-06-28 16:10:13 +02:00
Bård Skaflestad
c9b1f01c23 Merge pull request #3586 from bska/fix-msim-report-step
Fix MSIM UDQ Configuration Lookup
2023-06-28 15:24:52 +02:00
Bård Skaflestad
928f37735c Merge pull request #3582 from vkip/num_pressure_points_equil_default
Changing default value for number of pressure points used in equilibration
2023-06-28 14:53:57 +02:00
Tor Harald Sandve
bf9ca70ff6 Cleanup based on review 2023-06-28 14:07:33 +02:00
Tor Harald Sandve
4b36741f33 Rename BC to BCPROP and add error message for BC 2023-06-28 14:07:33 +02:00
Tor Harald Sandve
c7a7e80698 splitt BC into BCCON in grid section and BC in Schedule 2023-06-28 14:07:33 +02:00
Tor Harald Sandve
ff58ca550f Support BC in Schedule section 2023-06-28 14:07:33 +02:00
Vegard Kippe
0cb4d90494 Changing default value for number of pressure points used in equilibration to be consistent with current implementation. 2023-06-28 14:01:14 +02:00
Bård Skaflestad
ec87ad1f61 Fix MSIM UDQ Configuration Lookup
The MSIM 'report_step' is a one-based index so we must subtract
one before looking up the pertinent Schedule information.
2023-06-28 13:42:16 +02:00
Bård Skaflestad
d6ed5f754c Merge pull request #3581 from vkip/constexpr_parseritem_defaults
Let int and float parser items have constexpr default values
2023-06-28 13:35:59 +02:00
hnil
3e7f74d384 -- fixes for twophase relperm 2023-06-28 13:09:04 +02:00
Svenn Tveit
0b4f420aaa Added reference data files to cmake list 2023-06-28 10:05:32 +02:00
Svenn Tveit
c1fef5c52a Added unittests for CO2, H2O, brine and H2.
Reference data is located in JSON files.
Some code is commented out due to insufficient reference data, or in the case of CO2, interpolation around saturation curve does not capture the liquid/vapor jump to a reasonable tolerance.
2023-06-28 10:05:32 +02:00
Svenn Tveit
d891255ba4 Expanded T-p domain and included more data points 2023-06-28 10:05:32 +02:00
Svenn Tveit
e7faf82096 Improved enthalpy approximation.
Polynomial fit using Coolprop data.
2023-06-28 10:05:32 +02:00
Vegard Kippe
68173b49a4 Let int and float parser items have constexpr default values 2023-06-27 20:13:04 +02:00
Kai Bao
aafafba4b1 draft version of handling keyword WINJCLN 2023-06-27 15:50:54 +02:00
Kai Bao
781f7f2a96 revising FilterCake class for downstream use 2023-06-27 15:50:54 +02:00
Kai Bao
a335542424 adding accessing function for FilterCake for Connection 2023-06-27 15:50:54 +02:00
Kai Bao
e2a70bfabd fixing the Well and Connection comparison operator
taking into consideration of the parameters related to filter cake
2023-06-27 15:50:54 +02:00
Kai Bao
3bc451ad94 parsing WINJFCNC 2023-06-27 15:50:54 +02:00
Kai Bao
5e1b398550 parsing the keywor WINJDAM 2023-06-27 15:50:54 +02:00
Kai Bao
e94c1aa386 WIP in supporting the keyword WINJDAM 2023-06-27 15:50:54 +02:00
Kai Bao
5710164a7b adding keywords WINJDAM WINJCLN WINJFCNC to keyword_list 2023-06-27 15:50:53 +02:00
Kai Bao
7fc41b99aa adding the definition of keyword WINJCLN 2023-06-27 15:50:53 +02:00
Kai Bao
951e747f32 adding keyword definition for keyword WINJFCNC 2023-06-27 15:50:53 +02:00
Kai Bao
4096468ab3 adding keyword definition WINJDAM 2023-06-27 15:50:53 +02:00
Markus Blatt
4129543457 Trim trailing and leading whitespace from path in INCLUDE directive.
Just like the other simulator. This prevents hard to find input errors
of useers.
2023-06-27 15:34:27 +02:00
Markus Blatt
340b3dc450 Quote file path if file not found to make trailing ws apparent.
For an include directive with a path with trailing whitespace, e.g.

```
INCLUDE
  '/home/model/../include/file_trailing_ws.ext ' /
```
the current error message
```
Error: No such file: /home/model/../include/file_trailing_ws.ext
```
is changed to
```
File '/home/model/../include/file_trailing_ws.ext ' included via
INCLUDE directive does not exist. Note that the file name contains trailing whitespace.
```

This should at least make it easier to spot this error.

An alternative would be to trim the string, but people using quotes
should actually know what they are doing.
2023-06-27 14:25:38 +02:00
Bård Skaflestad
5709708016 Merge pull request #3559 from bska/wbp-compute-values
Reimplement WBPn Calculation Procedure
2023-06-26 15:24:23 +02:00
Bård Skaflestad
d9cfd1288a Reimplement WBPn Calculation Procedure
This commit implements the WPAVE keyword and its associate WBPn
well level report quantities.  We support all valid settings of
WPAVE and WWPAVE.  The various weighted averages are accumulated
through compensated summation of both the numerator and denominator
terms for the inner block, the direct/immediate level 1 neighbours,
and the diagonal level 2 neighbours.  We combine those contributions
to the WBP, WBP4, WBP5, and WBP9 terms when we "commit" the
contributions (Accumulator::commitContributions()), per connection
for values weighted by the connection transmissibility factor, and
per well for values weighted by pore volumes.

We distinguish OPEN from ALL connections through callback functions
in the implementation of accumulateLocalContributions() and the per
connection weighting terms are provided as another set of callback
functions depending on the value of the inner block weighting factor
F1.

Depth correction (NONE, WELL, or RES) is affected through a separate
set of callback functions used in the implementation of
'connectionPressureOffset'.

We discover source locations in a two-step process.  At WBPn
calculation construction time, we exclude only those cells that are
outside the model's dimensions.  The user is then expected to call
member function pruneInactiveWBPCells(), typically at the
CalculatorCollection level, at a later time in order to prune
inactive cells.  This two-step split is necessary because we do not
have a complete global view of the model's active cells in a
parallel run.  It is very possible that the WBPn calculation on one
rank will require source values from another rank and that begets
this extra caution.

The user must call inferBlockAveragePressures() to compute the WBPn
values.  Once completed, the result values may be extracted by
calling member function averagePressures().  We expect that the user
will provide a complete set of up-to-date source values when calling
this member function, both at the reservoir and the well connection
levels.
2023-06-22 16:46:54 +02:00
Bård Skaflestad
d06dff1a83 Add Input Value Santity Checking to WPAVE Keyword Handler
In particular, the inner block weighting factor F1 must not exceed
the value 1.0 and the CTF-vs-PV contribution weighting factor F2
must not be less than 0.0 or greater than 1.0.

Stop input parsing if either of these two conditions are violated.
2023-06-22 16:46:54 +02:00
Bård Skaflestad
c6d4a635e3 Merge pull request #3577 from GitPaean/fixing_winjmult
separating the WINJMULT for well and connections
2023-06-22 12:53:27 +02:00
Kai Bao
9572d5ecf3 addressing the reviewing comments for PR #3577 2023-06-22 11:59:45 +02:00
Arne Morten Kvarving
f8ebecd3b1 Merge pull request #3569 from bska/fix-hist-rates-sumry-output
Don't Generate History Rates for Shut/Stopped Wells
2023-06-21 14:46:11 +02:00
Bård Skaflestad
a4d2674c6d Merge pull request #3579 from bska/wbp-reformat-pavg
Reformat PAvg Class
2023-06-21 14:36:48 +02:00
Bård Skaflestad
53f946e776 Don't Generate History Rates for Shut/Stopped Wells
The *_history() helper functions assumed that all wells would be
flowing.  This is an incorrect assumption and would lead to, e.g.,
field-level observed rates being non-zero even if all wells were
stopped/shut.

This commit adds a check for non-flowing wells, and omits flow rate
contributions in that case.
2023-06-21 13:54:47 +02:00
Bård Skaflestad
f8d9f74d91 Reformat PAvg Class
Mostly for readability.  While here, also switch to using compiled
item names instead of raw strings to access the DeckItems which
constitute the WPAVE and WWPAVE keywords.
2023-06-21 13:46:28 +02:00
Bård Skaflestad
7614a739ca Merge pull request #3578 from akva2/extnetwork_serialization_test
ExtNetwork: add serialization test
2023-06-21 13:10:31 +02:00
Kai Bao
68e586bf7a separating the WINJMULT for well and connections
with more testing, it looks like when multiple records are entered. The
records with WREV mode and records with CIRR and CREV modes work
differently in term of overwriting the previous records. So it is
necessary to store them separately.
2023-06-21 11:38:31 +02:00
Arne Morten Kvarving
68ffa2ea1f add serialization test for Network::ExtNetwork 2023-06-21 10:48:39 +02:00
Arne Morten Kvarving
75bd0e915e ExtNetwork: use a non-default instance in serializationTestObject 2023-06-21 10:45:30 +02:00
Arne Morten Kvarving
74acf7080b implement ExtNetwork::operator== 2023-06-21 10:45:18 +02:00
Bård Skaflestad
b7617f9469 Merge pull request #3575 from bska/fix-narrowing
Don't Narrow String Literal to Bool
2023-06-16 17:09:04 +02:00
Bård Skaflestad
35117aa037 Don't Narrow String Literal to Bool
This isn't portable.
2023-06-16 15:54:18 +02:00
Bård Skaflestad
dda3effdb3 Merge pull request #3570 from svenn-t/ppcwmax
Implementation of PPCWMAX
2023-06-16 15:04:03 +02:00
Svenn Tveit
a008c303ab Removed unecessary code 2023-06-16 11:34:34 +02:00
Svenn Tveit
32692b750e Added actual values to serialization test 2023-06-16 11:33:52 +02:00
Tor Harald Sandve
7f33731d19 BUG: Use salinity values when salt concentration (BRINE) is not considered 2023-06-16 10:03:56 +02:00
Bård Skaflestad
30c7110720 Merge pull request #3542 from totto82/wagHysteresis
Wag hysteresis
2023-06-15 16:41:05 +02:00
Svenn Tveit
af3f44423b Changed from std::tuple to std::pair 2023-06-15 14:59:42 +02:00
Tor Harald Sandve
c270dc2ff3 Minor clean-up and fixes of the WAG hysteresis model 2023-06-15 12:31:27 +02:00
Svenn Tveit
89f0b2c31e Changes in docstring and removed include 2023-06-15 12:26:43 +02:00
Ove Sævareid
34a9d9c949 Some support for WAG hysteresis (material). 2023-06-15 11:22:44 +02:00
Ove Sævareid
0fc0b6f4fa Some support for WAG hysteresis (input). 2023-06-15 11:18:58 +02:00
Bård Skaflestad
fdfbecc742 Merge pull request #3572 from hnil/ecldefault
-- added function need to test solver without multiplexer
2023-06-14 16:26:44 +02:00
hnil
3b06ff2757 -- added function need to test solver without multiplexer 2023-06-14 14:37:07 +02:00
Bård Skaflestad
bca989343c Merge pull request #3161 from GitPaean/support_winjmult
adding the parsing support for keyword WINJMULT
2023-06-14 14:32:00 +02:00
Bård Skaflestad
b7e4f28b95 Merge pull request #3571 from bska/fix-warnings
Fix A Couple of Compiler and Static Code Analysis Warnings
2023-06-14 14:25:28 +02:00
Bård Skaflestad
e6590f2169 Fix A Couple of Compiler and Static Code Analysis Warnings
In particular

  * Tag a single argument constructor as 'explicit',
  * Remove an unused private function
  * Fix mismatched tags (struct vs. class) in forward declaration
  * Return 'false' in an impossible updateHyst() case

While here, also use a real UnitSystem object instead of creating
a METRIC system just to infer unit strings.
2023-06-14 13:31:41 +02:00
Bård Skaflestad
f46b90f5db Merge pull request #3568 from bska/fix-udq-assign-well-level
Don't Run ASSIGN on Every Report Step
2023-06-14 11:59:22 +02:00
Kai Bao
3b731a3da2 return true for handleWINJMULT() when the mode is changed 2023-06-14 11:56:49 +02:00
Bård Skaflestad
250c8b7a1c Merge pull request #3458 from hnil/changed_hyst
Changed hyst
2023-06-14 10:34:34 +02:00
Bård Skaflestad
4c2617f537 Don't Run ASSIGN on Every Report Step
Commit 5a060910a distinguished ASSIGN from DEFINE at the field
level, but did not make the same distinction at the well or group
levels.  Passing 'report_step' instead of assign.report_step() as an
argument to UDQState::assign() means we'd be running every ASSIGN
operation on every report step which would reset the state.  That's
a bug if the model defines some sort of cumulative UDQ at the well
or group levels.
2023-06-14 09:46:10 +02:00
Bård Skaflestad
c33b94ca3a Default UDQ Assignments to All Wells in Model
An assignment of the form

    ASSIGN WUPPERTAL 354.572 /

should create a UDQ set of size equal to the number of wells in
the model, not just the wells already flowing-especially if the
assignment happens on the very first report step before any wells
are flowing.
2023-06-14 09:46:10 +02:00
hnil
12da4dbe02 --changed for bska comments. All tests ok locally 2023-06-14 09:31:20 +02:00
Svenn Tveit
de814bc577 Apply PPCWMAX in SWATINIT calculations.
Note that re-calculation of initial water saturation (after PPCWMAX is applied) is currently done in opm-simulators.
2023-06-14 08:33:51 +02:00
Svenn Tveit
5e6dfc1f1a Add Ppcwmax to serialization test 2023-06-14 08:33:51 +02:00
Svenn Tveit
ccc010c8d3 Internalize PPCWMAX as vector of structs 2023-06-14 08:33:51 +02:00
Markus Blatt
90497b745b Merge pull request #3556 from akva2/multflt_grid_and_edit
fixed: properly combine MULTFLT from GRID and EDIT
2023-06-14 07:16:02 +02:00
Bård Skaflestad
809c9be8dd Merge pull request #3566 from GitPaean/throw_multiple_segment_abs
we do not support entering multiple segments with ABS type in keyword WELSEGS.
2023-06-13 17:02:34 +02:00
Kai Bao
edd762c084 cleaning up the implementation related to WINJMULT 2023-06-13 15:10:56 +02:00
hnil
b50cef1af2 added fix based on review 2023-06-13 14:39:42 +02:00
hnil
f8d652f758 - fixed missing return after adding change 2023-06-13 14:39:42 +02:00
hnil
d0422bfc74 -- added bool return value of hysteresis update.
-- this make it possible to localy update intensive quanities if something changed.
2023-06-13 14:39:42 +02:00
Peter Verveer
fb4514aa88 Fix table related error messages 2023-06-13 11:21:59 +02:00
Kai Bao
30f0a358f1 we do not support entering multiple segments with ABS type
in keyword WELSEGS.

Before we fix it, we throw here.
2023-06-13 10:44:09 +02:00
Kai Bao
759f0b8449 revising the function handleWINJMULT a little bit 2023-06-12 10:42:15 +02:00
Kai Bao
a8a10bb81f InjMultMode is assigned to per well
not per connection anymore based on new finding in the reference result.
2023-06-12 10:42:15 +02:00
Kai Bao
2f8f019226 updating the WINJMULT keyword with correct dimension 2023-06-12 10:42:15 +02:00
Kai Bao
da17ef3174 adding the parsing support for keyword WINJMULT 2023-06-12 10:42:15 +02:00
Bård Skaflestad
dd34926062 Merge pull request #3558 from bska/wbp-source-values
Add Container for Dynamic WBPn Source Values
2023-06-10 11:36:19 +02:00
Bård Skaflestad
c7d6604d98 Add Container for Dynamic WBPn Source Values
This commit adds a new container class,

    PAvgDynamicSourceData

which wraps a single vector<double> which in turn backs source data
items for

    - pressure values
    - fluid mixture densities
    - dynamic pore-volumes

at a collection of source locations-active cells or well reservoir
connections.  We provide read-only and read-write accessors to the
underlying data items for a single source location through subscript
operator (read only) and named assignment (set(), read-write) member
functions.  The latter is available only when the underlying range
of data values is mutable (e.g., SourceDataSpan<double>) as opposed
to immutable (e.g., SourceDataSpan<const double>).
2023-06-09 15:42:46 +02:00
Bård Skaflestad
46415cebed Merge pull request #3557 from bska/wbp-comm-api-change
Prepare for Revised Implementation of WBPn
2023-06-09 15:13:35 +02:00
Bård Skaflestad
89bc182876 Prepare for Revised Implementation of WBPn
This initial commit changes the Summary class's API for consuming
block-averaged well level pressure values (summary keywords WBPn).
The former approach was intended to consume a collection of source
values--pressures, densities, and pore-volumes--and then to defer
calculation of the WBPn summary vectors to the Summary class.

This commit introduces a 'WellBlockAvgPress' container class which
holds precomputed WBPn results and the intention is to move the
calculation to the simulator side for greater parallelism.
2023-06-09 13:29:10 +02:00
Tor Harald Sandve
ba0845c5f3 Merge pull request #3526 from plgbrts/well-control
Allow NONE for item 7 in GCONPROD
2023-06-09 10:50:57 +02:00
Arne Morten Kvarving
78c527fb53 Merge pull request #3567 from akva2/embedded_params
fixed: avoid unused parameters when built without embedded python
2023-06-08 12:55:50 +02:00
Arne Morten Kvarving
e4b609c294 fixed: avoid unused parameters when built without embedded python 2023-06-08 12:01:27 +02:00
Arne Morten Kvarving
9cb247058e Merge pull request #3564 from bska/fix-embedded-python-test
Fix Embedded Python Test
2023-06-08 11:47:18 +02:00
Bård Skaflestad
9cf61a57b4 Merge pull request #3565 from totto82/addFPRP
add missing FPRP and RPRP
2023-06-08 11:29:16 +02:00
Arne Morten Kvarving
ca6cab5c54 Merge pull request #3563 from bska/omit-rsm-version-information
Omit OPM Version Information in RSM File
2023-06-08 10:42:32 +02:00
Tor Harald Sandve
0221ac9932 add missing FPRP and RPRP 2023-06-08 10:23:53 +02:00
Arne Morten Kvarving
b7a888fcfa fixed: properly combine MULTFLT from GRID and EDIT 2023-06-08 10:12:41 +02:00
Bård Skaflestad
1bde14655a Omit OPM Version Information in RSM File
The version information leads to long install times and doesn't
really provide any benefit to the user.
2023-06-08 10:09:23 +02:00
Bård Skaflestad
3e08b187ff Don't Return Constant Objects
There's no longer any reason to return 'const string', since that
inhibits move semantics.  While here, also reorder the include
statements and split a few long lines.
2023-06-08 10:08:22 +02:00
Bård Skaflestad
ff4db11528 Handle Case of Nonexistent NumPy Module
The NumPy module might not be available on the host system.  In that
situation the PYINPUT_BASIC unit test would fail with a segmentation
violation.  Guard against this problem by catching ImportError and
checking if the result deck has 'DX' instead of blindly asserting
that 'DX' exists.
2023-06-08 09:24:27 +02:00
Bård Skaflestad
222e6133b1 Catch Up to Changed Semantics of Certain Member Functions
In particular Python::exec() now returns 'false' instead of throwing
an exception if we don't have 'EMBEDDED_PYTHON'.  Similarly for the
Python::Python constructor when called with an 'Enable::ON' argument.
2023-06-08 09:23:22 +02:00
Bård Skaflestad
45e4762302 Emit Useful Diagnostic Message if Test Fails
While here, also mark a few objects 'const' and reorder the headers.
2023-06-08 09:19:32 +02:00
Bård Skaflestad
7692a5401d Merge pull request #3561 from hnil/no_python_onemore
Remove throw in normal runs
2023-06-07 11:29:57 +02:00
hnil
dea519c89a -- add config.h 2023-06-07 10:35:13 +02:00
Markus Blatt
cd1831be94 Merge pull request #3509 from blattms/install-co2brinepvt
Also install co2brinepvt as we install the manpage.
2023-06-07 10:29:03 +02:00
hnil
47f6b6ffb2 -- hopefully removed the python throw 2023-06-07 10:24:06 +02:00
Tor Harald Sandve
5a08a17978 Merge pull request #3504 from hakonhagland/wvfpdp
Add support for WVFPDP
2023-06-05 09:13:49 +02:00
Håkon Hægland
5a99e005fb Fixed naming convention 2023-06-02 09:24:59 +02:00
Håkon Hægland
2f260fe90a Fixed SWell indices 2023-06-02 09:24:59 +02:00
Håkon Hægland
0d38acebaf Set correct default value 2023-06-02 09:24:59 +02:00
Håkon Hægland
5463420a85 Add support for WVFPDP 2023-06-02 09:24:59 +02:00
Bård Skaflestad
d036f6aaaa Merge pull request #3553 from akva2/pvt_set_vappars
added: setters for the vappars in pvt classes
2023-06-01 19:03:48 +02:00
Bård Skaflestad
e30fce2c9f Merge pull request #3552 from akva2/janitoring
Some janitoring
2023-06-01 18:59:35 +02:00
Arne Morten Kvarving
39006ecd71 added: setters for the vappars in pvt classes 2023-06-01 11:03:20 +02:00
Arne Morten Kvarving
6700e08c84 avoid dead store 2023-06-01 09:38:45 +02:00
Arne Morten Kvarving
f64f587055 mark variable maybe_unused to avoid dead store warnings 2023-06-01 09:38:45 +02:00
Arne Morten Kvarving
237b63e674 reduce scope of variables to avoid dead store warnings 2023-06-01 09:38:45 +02:00
Arne Morten Kvarving
5ab4c3dfa0 initialize variables 2023-06-01 09:38:45 +02:00
Arne Morten Kvarving
19f103db9b check pointer to avoid nullptr dereference sca warning
the assert above is a noop under normal conditions
2023-06-01 09:38:45 +02:00
Arne Morten Kvarving
1492182866 make variable constexpr to avoid dead store warning 2023-06-01 09:38:45 +02:00
Arne Morten Kvarving
ba4d3271c4 remove unnecessary initialization 2023-06-01 09:35:10 +02:00
Bård Skaflestad
03d31409e5 Merge pull request #3550 from akva2/vappars_solution_section
fixed: apply VAPPARS from SOLUTION section
2023-05-31 17:12:47 +02:00
Arne Morten Kvarving
89ce51af81 added: unit test for VAPPARS in SOLUTION section
also revise existing test using SCHEDULE to check
that level 0 is UNDEF
2023-05-31 15:49:23 +02:00
Arne Morten Kvarving
51aecfb2de fixed: apply VAPPARS from SOLUTION section 2023-05-31 15:13:55 +02:00
Bård Skaflestad
24ce7e05a7 Merge pull request #3549 from blattms/fix-string-preplace-empty-dunecommon_CXXFLGAS
[cmake] Make sure that string(REPLACE ...) always has 4 arguments.
2023-05-31 12:51:07 +02:00
Bård Skaflestad
682e6d8763 Merge pull request #3541 from akva2/test_spline_janitoring
test_spline: convert to boost::test
2023-05-30 14:21:47 +02:00
Bård Skaflestad
d61c9c7b99 Merge pull request #3501 from bska/check-wsegdims-consistency
Test Dynamic Segment Dimensions Against WSEGDIMS Limits
2023-05-30 12:39:55 +02:00
Bård Skaflestad
5a79e0f8fb Test Dynamic Segment Dimensions Against WSEGDIMS Limits
In particular, check that

  1. Number of MS wells <= WSEGDIMS(1)
  2. Number of segments per well <= WSEGDIMS(2)
  3. Number of branches per well <= WSEGDIMS(3)

for all report steps in the simulation run.

Example diagnostic message of a case that violates limits 2 and 3:

Error: Problem with keyword WSEGDIMS
  In CASE.DATA line 60
  The case has a multi-segmented well with 246 well segments, but at most 200 are allowed in WSEGDIMS.
  Please increase item 2 of WSEGDIMS to at least 246

Error: Problem with keyword WSEGDIMS
  In CASE.DATA line 60
  The case has a multi-segmented well with 105 lateral branches, but at most 5 are allowed in WSEGDIMS.
  Please increase item 3 of WSEGDIMS to at least 105
2023-05-30 11:47:50 +02:00
Bård Skaflestad
0bc74799ca Merge pull request #3465 from plgbrts/well-specs-new
adding defaults to json files
2023-05-30 11:43:53 +02:00
Bård Skaflestad
b4ccb9df69 Merge pull request #3548 from akva2/test_ncpflash_janitoring
test_ncpflash: convert to boost::test
2023-05-30 11:09:13 +02:00
Paul
4d5b4aba2b changed return type to reference-to-const 2023-05-30 10:49:52 +02:00
Markus Blatt
083451817d [cmake] Make sure that string(REPACE always has 4 arguments.
This was missing proper quoting for the case that dune-common_CXX_FLAGS
is empty.

Error I got was:
```
-- Version 2.10.0 of dune-common from /home/mblatt/src/dune/opm-master/dune-common/opm-parallel
CMake Error at CMakeLists.txt:369 (string):
  string sub-command REPLACE requires at least four arguments.

-- Configuring incomplete, errors occurred!
```
2023-05-30 10:40:55 +02:00
Arne Morten Kvarving
edeb7679b0 test_ncpflash: convert to boost::test 2023-05-30 10:31:56 +02:00
Tor Harald Sandve
a456c36a31 Merge pull request #3513 from goncalvesmachadoc/gasvisct
Implement GASVISCT for black-oil [Bug fix]
2023-05-30 08:37:46 +02:00
Bård Skaflestad
86a2f856d3 Merge pull request #3547 from akva2/test_fluidmatrixinteractions_janitoring
test_fluidmatrixinteractions: convert to boost::test
2023-05-30 08:36:31 +02:00
Bård Skaflestad
6d60158022 Merge pull request #3546 from akva2/test_eclmateriallawmanager_janitoring
test_eclmateriallawmanager: convert to boost::test
2023-05-30 08:34:51 +02:00
Arne Morten Kvarving
59ce72d04f test_fluidmatrixinteractions: convert to boost::test 2023-05-30 07:23:55 +02:00
Arne Morten Kvarving
98a9367b19 test_eclmateriallawmanager: convert to boost::test 2023-05-30 07:08:56 +02:00
goncalvesmachadoc
b30f297053 add comments on reference values 2023-05-29 13:20:53 +02:00
Bård Skaflestad
4146ce75f3 Merge pull request #3545 from akva2/test_eclblackoilpvt_janitoring
test_eclblackoilpvt: convert to boost::test
2023-05-26 16:25:31 +02:00
Bård Skaflestad
4e1333deda Merge pull request #3544 from akva2/test_eclblackoilfluidsystem_janitoring
test_eclblackoilfluidsystem: convert to boost::test
2023-05-26 16:10:00 +02:00
Bård Skaflestad
b5f9dd4312 Merge pull request #3543 from akva2/test_blackoilfluidstate_janitoring
test_blackoilfluidstate: convert to boost::test
2023-05-26 16:05:09 +02:00
Arne Morten Kvarving
4eac0243ae test_eclblackoilpvt: convert to boost::test 2023-05-26 15:51:41 +02:00
Arne Morten Kvarving
f424e8ec6e test_eclblackoilfluidsystem: convert to boost::test 2023-05-26 15:28:30 +02:00
Arne Morten Kvarving
492823d8dd test_blackoilfluidstate: convert to boost::test 2023-05-26 15:12:47 +02:00
Arne Morten Kvarving
eb84d95263 test_spline: convert to boost::test 2023-05-26 13:48:43 +02:00
Bård Skaflestad
857f9e39e4 Merge pull request #3540 from akva2/test_threecomponents_ptflash_janitoring
test_threecomponents_ptflash: convert to boost::test
2023-05-26 12:57:43 +02:00
Bård Skaflestad
823788a7c8 Merge pull request #3539 from akva2/test_2dtables_janitoring
test_2dtables: convert to boost::test
2023-05-26 12:57:13 +02:00
Bård Skaflestad
da73e9898e Merge pull request #3538 from akva2/test_immiscibleflash_janitoring
test_immiscibleflash: convert to boost::test
2023-05-26 12:56:43 +02:00
Arne Morten Kvarving
99035c4400 test_co2brine_ptflash: use stream 2023-05-26 12:37:06 +02:00
Arne Morten Kvarving
949d14d7c7 test_threecomponents_ptflash: convert to boost::test 2023-05-26 12:35:56 +02:00
Arne Morten Kvarving
e650889965 test_2dtables: convert to boost::test 2023-05-26 12:21:53 +02:00
Arne Morten Kvarving
4abfc8115e test_immiscibleflash: convert to boost::test 2023-05-26 12:20:35 +02:00
Bård Skaflestad
9e10a598f1 Merge pull request #3537 from akva2/test_co2brine_ptflash_janitoring
test_co2brine_ptflash: convert to boost::test
2023-05-25 23:25:39 +02:00
Bård Skaflestad
bac38961b7 Merge pull request #3534 from GitPaean/tesiting_summary_ouptut
[testing] update summary quantities even there is no wells associated with it
2023-05-25 23:24:59 +02:00
Arne Morten Kvarving
4bd20c6364 test_co2brine_ptflash: convert to boost::test 2023-05-25 22:53:25 +02:00
Bård Skaflestad
51f21f86bd Merge pull request #3535 from akva2/test_tabulation_janitoring
test_tabulation: Some janitoring
2023-05-25 22:23:40 +02:00
Bård Skaflestad
621dcad31d Merge pull request #3533 from akva2/test_fluidsystems_janitoring
test_fluidsystems: Some janitoring
2023-05-25 22:22:42 +02:00
Bård Skaflestad
80bdd0f999 Merge pull request #3532 from akva2/test_co2brinepvt_janitoring
test_co2brinepvt: Some janitoring
2023-05-25 22:21:30 +02:00
Bård Skaflestad
6c053c457a Merge pull request #3536 from akva2/test_components_janitoring
test_components: Some janitoring
2023-05-25 22:16:11 +02:00
Arne Morten Kvarving
edefd93f38 test_components: convert to boost::test 2023-05-25 21:49:07 +02:00
Arne Morten Kvarving
180f34dea7 checkComponent: improve output
as this is called multiple times for a component
we get duplicate output. improve by also including the
Evaluation template parameters in the output.
2023-05-25 21:49:07 +02:00
Arne Morten Kvarving
0baa0f441a test_tabulation: convert to boost::test 2023-05-25 21:15:38 +02:00
Arne Morten Kvarving
860bc2e7f6 test_tabulation: adjust tolerances so there are no failed comparisons 2023-05-25 21:13:04 +02:00
Markus Blatt
69aaf44fd2 Merge pull request #3531 from vkip/compare_ecl_sign_deviation
Calculate deviation such that different signs are accounted for.
2023-05-25 12:17:15 +02:00
Kai Bao
b16f2ed8be update summary quantities even there is no wells associated with it
then it should get a zero. otherwise, the old values will be used.
2023-05-25 09:10:02 +02:00
Arne Morten Kvarving
174e19c35d test_fluidsystems: convert to Boost::Test 2023-05-24 22:04:39 +02:00
Arne Morten Kvarving
3e4146030e checkFluidSystem: improve output
as this is called multiple times for a fluidsystem
we get duplicate output. improve by also including the
other template parameters in the output.
2023-05-24 22:04:39 +02:00
Arne Morten Kvarving
91d5db381a fixed: avoid dead stores in test_fluidsystems 2023-05-24 22:04:39 +02:00
Arne Morten Kvarving
89b1a95a2d test_co2brinepvt: convert to Boost::Test 2023-05-23 22:31:50 +02:00
Vegard Kippe
22b5d9a568 Calculate deviation such that different signs are accounted for. 2023-05-23 22:30:45 +02:00
Arne Morten Kvarving
38fb67496d fixed: avoid dead stores in test_co2brinepvt 2023-05-23 22:16:47 +02:00
Kai Bao
ca2dbd1c09 Merge pull request #3523 from totto82/foam_solvent
Add Solvent and Water as transport phase for foam model
2023-05-23 12:27:32 +02:00
Paul
7a8fb7b832 improved error message 2023-05-23 10:48:13 +02:00
Tor Harald Sandve
0514ba2e44 remove INSTANCE(11) as it is not needed 2023-05-23 09:28:22 +02:00
Tor Harald Sandve
54dbf3a9ce add solvent and water as transport fluid for foam 2023-05-23 08:52:25 +02:00
Tor Harald Sandve
ec8a76414a compile for evaluation with 11 derivatives 2023-05-23 08:52:25 +02:00
Bård Skaflestad
35264e7ab8 Merge pull request #3530 from akva2/janitoring
Some janitoring
2023-05-22 23:49:47 +02:00
Bård Skaflestad
03e8617ff7 Merge pull request #3529 from akva2/fix_ndebug_build
BrineH2Pvt: include prerequisite headers
2023-05-22 23:28:44 +02:00
Arne Morten Kvarving
553ac0a14c reduce scope of variable
avoids sca warnings
2023-05-22 23:00:30 +02:00
Arne Morten Kvarving
4572a7135f avoid some dead stores 2023-05-22 23:00:20 +02:00
Arne Morten Kvarving
32b526993d changed: mark explicit units constexpr
these constants are known at compile time.
as a bonus, this also quells warnings
emitted by infer due to it not seeing through
the implicit lambda captures
2023-05-22 22:57:14 +02:00
Arne Morten Kvarving
1c7240977c remove pointless increments 2023-05-22 22:12:18 +02:00
Arne Morten Kvarving
b68f5f1226 add arguments by const ref 2023-05-22 22:08:12 +02:00
Arne Morten Kvarving
9ba304f5cf BrineH2Pvt: include prerequisite headers
in particular the missing header broke build with -DNDEBUG
2023-05-22 22:01:54 +02:00
Arne Morten Kvarving
e6280fc80d add override qualifier to virtual methods 2023-05-22 20:53:33 +02:00
Paul
db4c2d7f38 correction of parsing item 7 of GCONPROD 2023-05-22 17:32:46 +02:00
Paul
bc4d7bcb5d fix in unit test 2023-05-22 17:29:56 +02:00
Paul
d0be00d59e fix in unit test 2023-05-22 17:27:20 +02:00
Tor Harald Sandve
005ff3e982 Merge pull request #3445 from svenn-t/h2store
Hydrogen-brine simulations - H2STORE
2023-05-22 11:23:48 +02:00
Bård Skaflestad
c000ad101a Merge pull request #3517 from totto82/outputhyst
Add method to get trapped saturation for output
2023-05-19 09:56:36 +02:00
Bård Skaflestad
82226cc0b9 Merge pull request #3527 from akva2/explicit_ctors
mark constructors explicit
2023-05-16 12:06:54 +02:00
Arne Morten Kvarving
6553e8d0b7 mark constructors explicit 2023-05-16 10:50:01 +02:00
Bård Skaflestad
4308305421 Merge pull request #3433 from totto82/brine_co2store
Combine brine + co2store
2023-05-16 10:25:32 +02:00
Arne Morten Kvarving
cb394ed19c Merge pull request #3525 from akva2/fix_cvfVector4_Zero
fixed: do not compare index 2 twice
2023-05-15 13:43:32 +02:00
Arne Morten Kvarving
a428d09ad3 fixed: do not compare index 2 twice 2023-05-15 12:28:07 +02:00
Arne Morten Kvarving
3ae5fa9f80 Merge pull request #3503 from totto82/default_ehystr
Use default values for EHYSTR if not present but Hysteresis is activated by HYST in SATOPTS
2023-05-15 08:48:32 +02:00
Paul
05d59a14f4 add throw in case a well has a non-increasing MD column 2023-05-12 16:14:58 +02:00
Bård Skaflestad
196807d023 Merge pull request #3522 from vkip/tuning_only_update_when_set
Changing TUNING semantics to 'only change when specified'.
2023-05-12 14:22:35 +02:00
Vegard Kippe
899a1176c2 Changing TUNING semantics to 'only change when specified'. No impact on next time step needs to be handled separately. 2023-05-12 13:02:22 +02:00
Arne Morten Kvarving
3702d81011 Merge pull request #3520 from akva2/fix_pypi_static_boost
fixed: build pypi packages using static boost libs
2023-05-12 09:18:56 +02:00
Tor Harald Sandve
1aff5fc604 add test that compares Brine and BrineDynamic 2023-05-12 09:07:55 +02:00
Arne Morten Kvarving
60d79a170e fixed: build pypi packages using static boost libs 2023-05-12 08:39:06 +02:00
Bård Skaflestad
6895568a21 Merge pull request #3507 from akva2/fix_dyneval_format
fixed: handle dynamically sized evaluations in {fmt} formatter
2023-05-11 21:27:32 +02:00
Bård Skaflestad
910cd4cf41 Merge pull request #3516 from goncalvesmachadoc/keywordsummary
Parse compositional summary keywords
2023-05-11 21:18:30 +02:00
Bård Skaflestad
45017090f8 Merge pull request #3518 from totto82/extendRstconfig
Add supported mnemonic to list
2023-05-11 21:08:57 +02:00
Markus Blatt
5657a3109c Merge pull request #3289 from akva2/thermal_enums_to_class
Convert thermal enums to enum class
2023-05-11 16:58:34 +02:00
Tor Harald Sandve
09b69ae644 Add supported mnemonic to list to avoid warning 2023-05-11 12:00:10 +02:00
Arne Morten Kvarving
d599c6874d EclThermalConductionApproach: convert to enum class 2023-05-11 08:46:25 +02:00
Arne Morten Kvarving
7d38661810 EclSolidEnergyApproach: convert to enum class 2023-05-11 08:40:44 +02:00
Arne Morten Kvarving
644d371026 Merge pull request #3508 from blattms/prevent-crash
Fixes segfaulting PYACTION test with pybind 2.10.3 and python 3.11
2023-05-10 15:49:21 +02:00
Tor Harald Sandve
c3a3d894df Add method to get trapped saturation for output 2023-05-10 15:25:47 +02:00
goncalvesmachadoc
c6421a5b9c parse comp summary keywords 2023-05-10 11:29:25 +02:00
Paul
d6e73df9cf allow NONE for item 7 in GCONPROD 2023-05-10 11:25:05 +02:00
Arne Morten Kvarving
9f07ec68dd Merge pull request #3514 from akva2/jenkins_no_gpu_tests
jenkins: do not execute GPU tests
2023-05-09 12:47:03 +02:00
Arne Morten Kvarving
134c9641ff jenkins: do not execute GPU tests 2023-05-09 11:53:20 +02:00
Bård Skaflestad
7a22eb4bf3 Merge pull request #3512 from akva2/janitoring
Some janitoring
2023-05-09 11:45:27 +02:00
goncalvesmachadoc
abaa1074ff implement gasvisct 2023-05-09 10:48:25 +02:00
Arne Morten Kvarving
651693e623 avoid unused expression warning 2023-05-09 10:35:40 +02:00
Arne Morten Kvarving
cd4aec3a0b avoid out of bounds deref warning 2023-05-09 10:35:40 +02:00
Arne Morten Kvarving
1c8df58353 avoid uninitialized use warning 2023-05-09 10:35:40 +02:00
Arne Morten Kvarving
a7d77e2ed3 avoid dead store 2023-05-09 10:35:40 +02:00
Arne Morten Kvarving
ad251bb8aa quell unused variable warning
value is only used for WIN32
2023-05-09 10:35:40 +02:00
Atgeirr Flø Rasmussen
1a4a7ec147 Merge pull request #3511 from bska/std-memcmp-2
Use Memcmp From Standard Namespace
2023-05-09 09:23:14 +02:00
Bård Skaflestad
53383fd875 Sort headers in alphabetical order 2023-05-08 22:40:24 +02:00
Bård Skaflestad
b17d618c7b Use memcmp() from namespace std
Don't rely on clients using

    #include <string.h>

before including cmp.hpp .
2023-05-08 22:40:14 +02:00
Markus Blatt
b38cedf113 Merge pull request #3510 from bska/smry-check-cell-ids
Check for Invalid Cells in Block Level Summary Vectors
2023-05-08 09:31:55 +02:00
Bård Skaflestad
991ac2ca84 Check for Invalid Cells in Block Level Summary Vectors
This commit adds sanity checking to the cell references of block
level summary vectors (e.g., BPR or BGSAT).  If the summary vector
references a cell that's outside the models declared dimensions we
issue a warning and ignore that particular summary vector request.
2023-05-07 16:10:42 +02:00
Markus Blatt
dc9b9b719f Also install co2brinepvt as we install the manpage.
This must have been missed when merging opm-material with this module.
2023-05-05 17:27:53 +02:00
Markus Blatt
84aa367b19 Exception type differs beween pybind11 versions, use std::exception. 2023-05-05 16:09:58 +02:00
Markus Blatt
3e5ac55c1b Prevent segmentation faults for exceptions thrown in Python code
If for example pybind11 or python changes the type of exception thrown
and we expect a different (the old one) in our boost test, then the python
of pybind11 is left in an unusable condition and the next attempt of
running might produce hard to debug exception, This happened on Debian
bookworm (pybind 2.10.3, python 3.11) for syntax errors.
2023-05-05 16:03:17 +02:00
Arne Morten Kvarving
392d57d02a fixed: handle dynamically sized evaluations in {fmt} formatter 2023-05-05 11:01:13 +02:00
Tor Harald Sandve
4f3b67fa77 use 58.44 as molar mass of salt 2023-05-04 09:48:03 +02:00
Tor Harald Sandve
46f5558b59 Combine brine and the co2store module
This commit allows for dynamically changes in salinity in the co2 storage module

I.e. It allows for modeling salt precipition for co2 storage cases.
2023-05-03 15:09:06 +02:00
Tor Harald Sandve
8dfc9a12f5 Use default values for EHYSTR if not present but Hysteresis is activated by HYST in SATOPTS 2023-05-03 15:04:16 +02:00
Markus Blatt
7fd9a261f4 Merge pull request #3497 from bska/refactor-array-dims-checker-impl
Split WELLDIMS Error Message Formatting Out to Helper Functions
2023-05-02 22:57:59 +02:00
Bård Skaflestad
d1087f6463 Split WELLDIMS Error Message Formatting Out to Helper Functions
That way, they could become reusable for other keywords and we can
exploit the commonality between MAXWELLS and MAXGROUPS.  Moreover,
we can reduce the visual clutter of the body of each checking
function and fix some singular/plural mismatches in the diagnostic
messages.
2023-05-02 21:33:50 +02:00
Markus Blatt
e4faf011bc Merge pull request #3498 from bska/dynamic-segdims-restart
Dimension Segment Related Restart Arrays According to Dynamic Size
2023-05-02 20:41:47 +02:00
Bård Skaflestad
9a5b3721cb Dimension Segment Related Restart Arrays According to Dynamic Size
The [IR]SEG and ILB[RS] arrays must be able to accommodate the
maximum number of segments and branches used in the run.  This
commit incorporates the dynamic maximum sizes.  If those sizes
exceed the maximum values entered in WSEGDIMS, then the resulting
restart file will not be fully compatible with other simulation
software.
2023-05-02 09:44:06 +02:00
Arne Morten Kvarving
9a8c018506 Merge pull request #3499 from akva2/fix_python_old_cmake
fixed: conditionally use Development.XXX in python find module
2023-05-02 09:25:51 +02:00
Arne Morten Kvarving
adb0701a57 fixed: conditionally use Development.XXX in python find module
the split into Development.Module and Development.Embed was is introduced in cmake 3.18
2023-05-02 08:57:39 +02:00
Bård Skaflestad
28e057af39 Merge pull request #3488 from goncalvesmachadoc/summary
Add WWGR to summary
2023-04-28 11:35:18 +02:00
Bård Skaflestad
40b2fe3c14 Merge pull request #3496 from akva2/janitoring
Some janitoring
2023-04-28 10:03:24 +02:00
Arne Morten Kvarving
d659aa567f reorder initialization lists 2023-04-28 09:43:02 +02:00
Arne Morten Kvarving
54966e074f add forward declarations for explicit template instantations
causes a clang-tidy warning
2023-04-28 09:43:02 +02:00
Arne Morten Kvarving
bf39554b12 remove unused include 2023-04-28 09:43:02 +02:00
Arne Morten Kvarving
02fc95d0f7 remove trailing semicolon in package dependency list
causes a cmake warning,
"Empty dependency in find module for dune-polygongrid (check for trailing semi-colon)"
2023-04-28 09:43:02 +02:00
Markus Blatt
6a00383cdc Merge pull request #3494 from akva2/remove_unused_cmake_module
remove unused cmake module
2023-04-28 09:33:40 +02:00
Arne Morten Kvarving
344e920956 remove unused cmake module 2023-04-28 08:26:31 +02:00
Bård Skaflestad
28e030ff80 Merge pull request #3489 from akva2/python_fix_embed
Python: avoid searching from Development.Embed unless required
2023-04-27 13:33:54 +02:00
Arne Morten Kvarving
f76bda06e4 Merge pull request #3490 from akva2/pypi_fix_wheels
changed: build python wheels using skbuild
2023-04-27 13:29:46 +02:00
Arne Morten Kvarving
6316768bbb changed: build python wheels using skbuild
the vanilla setup-tools doesn't get the triplet correctly for some
reason. also use cmake from pip as cmake 3.16 in the image has a bug
in the python find rule
2023-04-27 13:17:19 +02:00
Arne Morten Kvarving
ba14a9e126 fixed: setuptools are no longer required to build the python bindings
only required if building packages for pypi, which is done separately
from the main buildsystem.
2023-04-27 13:03:08 +02:00
Arne Morten Kvarving
33c416b3e8 changed: only search for Development.Module if not building embedded python
the embedding headers are not available on the manylinux2014 containers
used to build the pypi packages. since this is anyways more correct
fix it this way
2023-04-27 13:03:08 +02:00
goncalvesmachadoc
21e4e9d2f1 add_wwgr 2023-04-27 12:03:25 +02:00
Paul
b171cbc3af Calculate headI/headJ from trajectory data when they are defaulted in WELSPECS 2023-04-26 17:30:53 +02:00
Markus Blatt
149fcdc88d Merge pull request #3481 from bska/rock-with-default-record-copy
Implement Proper Record Copying Behaviour for ROCK
2023-04-26 16:58:47 +02:00
Bård Skaflestad
91bb2b47e7 Use Base Class' serializeOp() Where Possible
Classes which inherit from FlatTableWithCopy and just call the base
class implementation of 'serializeOp()' don't really need a separate
implementation of that member function.

Noticed by: [at]blattms.
2023-04-26 15:29:12 +02:00
Bård Skaflestad
5cdeb6137b Implement Proper Record Copying Behaviour for ROCK
This commit adds the expected behaviour for all-defaulted records in
ROCK, provided the all-defaulted records are not the first of the
keyword.  Similarly to, e.g. PVTW, all-defaulted records are treated as
copies of the immediately preceding record.

In other words, given

    ROCK
    -- REF. PRES   COMPRESSIBILITY
       280.000        5.6E-5 /
    /

the second record is supposed to be a copy of the first.
2023-04-26 14:29:28 +02:00
Markus Blatt
8beebd49e3 Merge pull request #3485 from atgeirr/allow-field-wells
Allow FIELD group as parent for wells
2023-04-26 14:14:33 +02:00
Markus Blatt
f16b433b53 Merge pull request #3484 from akva2/fix_udqdefine_serialize
fixed: missing serialization of tokens in UDQDefine
2023-04-26 12:54:52 +02:00
Markus Blatt
0c64097e05 Merge pull request #3479 from bska/dynamic-rock-size
Implement Full Size Protocol for ROCK Keyword
2023-04-26 12:30:51 +02:00
Atgeirr Flø Rasmussen
a055f11392 Update tests for new behaviour. 2023-04-26 12:02:34 +02:00
Atgeirr Flø Rasmussen
33843346b4 Use ParseContext system to handle well under FIELD situation.
Also downgrade from a throw to a warning.
2023-04-26 11:43:21 +02:00
Arne Morten Kvarving
6ff355a141 fixed: missing serialization of tokens in UDQDefine
this went unnoticed since there are no UDQDefines in the pre-simulation
Schedule broadcast for parallel. however it causes issues for serialized
restarts
2023-04-26 11:35:12 +02:00
Atgeirr Flø Rasmussen
6de95332be Avoid printing "Internal error" for user input problems.
This is done by:
 - splitting the catch(std::exception) in KeywordHandlers.cpp
   in two and catching std::logic_error separately,
 - not adding "Internal error" in the OpmInputError constructor
   taking std::exception.
In addition, two possible user errors related to mixing groups
and wells as children of a single group have been changed to
std::runtime_error.
2023-04-26 11:35:05 +02:00
Bård Skaflestad
ffea242f7e Reimplement Enum->String Conversion in Terms of Array
Improves lookup speed.

Suggested by: [at]blattms.
2023-04-25 19:49:18 +02:00
Bård Skaflestad
0c6aff9b68 Make Diagnostic Message Reflect Reality
We also need to include DOUBLE_SLASH_TERMINATED in the list of
alternatives.
2023-04-25 19:47:02 +02:00
Paul Egberts
26daf8e544 adding defaults to json files 2023-04-24 16:12:00 +02:00
Bård Skaflestad
599194191d Implement Full Size Protocol for ROCK Keyword
This commit adds a special case for handling the dynamic nature of
the number of records in the ROCK keyword.  In particular, if the
ROCKOPTS keyword is NOT entered before ROCK, then the number of
records is NTPVT--item 2 from TABDIMS.  Conversely, when ROCKOPTS is
entered before ROCK, the number of records in the latter depends on
the setting in item 3 of ROCKOPTS.

This interaction cannot be easily captured in our JSON-based models,
so we introduce a special size class, SPECIAL_CASE_ROCK, that only
applies to the ROCK keyword and implement the logic in a dedicated
function in 'Parser.cpp'.  Once we have determined the correct
number of records, we form a RawKeyword of type FIXED and defer
further processing to the existing handling of fixed-sized keywords.

Add a selection of unit tests to exercise the new behaviour.
2023-04-24 12:54:41 +02:00
Bård Skaflestad
2c6f08269d Prefer Data to Logic
Switch if/else chain out in favour of a map-based approach.  This
simplifies adding new enumerators.  While here, also return string
objects instead of constant string objects.
2023-04-24 12:54:41 +02:00
Bård Skaflestad
d5d17bff2f Adjust Whitespace in Preparation of Special New Size Class
In particular, split long lines where appropriate.
2023-04-24 12:54:41 +02:00
Arne Morten Kvarving
4a2cc1a64a Merge pull request #3478 from blattms/python-development-component-is-mandatory
Always search for Development component of Python.
2023-04-24 08:46:08 +02:00
Markus Blatt
59ca5b1ba8 Always search for Development component of Python.
It is needed as we will call pybind11_add_module which calls
python3_add_library (in recent pybind11 versions). That
function is only there if the development component is searched for
and found.
2023-04-19 15:26:23 +02:00
Bård Skaflestad
b59ecf2d3b Merge pull request #3476 from GitPaean/remove_canOpen
removing Well::canOpen() function
2023-04-14 12:27:16 +02:00
Kai Bao
909cfdcdb7 removing Well::canOpen() function
which is not needed anymore.
2023-04-14 11:17:28 +02:00
Arne Morten Kvarving
5048b4e9ec Merge pull request #3467 from akva2/bump_2023.10
bump version to 2023.10-pre
2023-04-13 15:21:42 +02:00
Svenn Tveit
cf185442b9 Accommodate new Rvw input 2023-04-12 14:50:34 +02:00
Svenn Tveit
e8119e7adb Fix narrowing warnings 2023-04-12 14:28:02 +02:00
Svenn Tveit
620008ac06 Throw runtime error and comment out unused input.
Should fix return-type and unused-parameter warnings.
2023-04-12 14:28:02 +02:00
Svenn Tveit
c498234879 Re-added deleted code 2023-04-12 14:28:02 +02:00
Svenn Tveit
451a4d7657 Enable GAS/WATER with DISGASW in H2-brine PVT 2023-04-12 14:28:02 +02:00
Svenn Tveit
6cb0070d8d Bug fix: check for H2STORE keyword not CO2STORE 2023-04-12 14:28:02 +02:00
Svenn Tveit
fb70d31ba0 Update to restructure and latest developments. 2023-04-12 14:28:02 +02:00
Svenn Tveit
423141eb30 Re-add information lost in rebase 2023-04-12 14:28:02 +02:00
Svenn Tveit
9ae33902f1 rsSat=0 when DISGAS is disabled.
See commit: d546a8bb9c2fb4ed1697dab1878b8de3a81a26bc
2023-04-12 14:28:02 +02:00
Svenn Tveit
816300e8f2 Lookup table for density instead of calculating it
Significant speed-up since we don't need to run bisection anymore!
2023-04-12 14:28:02 +02:00
Svenn Tveit
11ff66a4bd Accommodate for Rvw implementation.
See commit: 3a25016eb09b8c87d11ca172d5170b935c675bd2
2023-04-12 14:28:01 +02:00
Svenn Tveit
9d54988d14 Diffusion coefficient for H2.
NOTE: while the diffusion in pure water is based on experimental data, diffusion in brine is dubious at best (no experimental basis).
2023-04-12 14:28:01 +02:00
Svenn Tveit
c2e0ea5721 Accommodate for implementation of vaporized water.
See commit: e74901b63f5e5db938dfa5760c5ed72116d4451e
2023-04-12 14:28:01 +02:00
Svenn Tveit
1fe37f7b60 Correction in volume factor calculations.
See commit: 8c2f3f6f37c57f3d772f0ee4d4332f6a6f19f3bf
2023-04-12 14:28:01 +02:00
Svenn Tveit
066601ae52 Improved H2 property calculations.
Most H2 properties are calculated using Helmholtz free energy EOS.
Moved Helmholtz equations from Brine_H2 to H2 class.
New file with simple H2 property calculations based on ideal gas.
2023-04-12 14:28:01 +02:00
Svenn Tveit
ef94fb8896 Corrected unit errors.
Pressure in MPa and apparent molar volume in m3/mol.
2023-04-12 14:28:01 +02:00
Svenn Tveit
437ff4691d Calculate H2 mole fractions directly.
More robust bisection method to get reduced density.
Erroneous T_red (it was supposed to be the reciprocal red. temp.)
2023-04-12 14:28:01 +02:00
Svenn Tveit
4eaf199dbe Minor fixes to make it compile 2023-04-12 14:28:01 +02:00
Svenn Tveit
fa12917a6c Added missing conversion function 2023-04-12 14:28:01 +02:00
Svenn Tveit
f5d02c8049 Remove duplex gasViscosity 2023-04-12 14:28:01 +02:00
Svenn Tveit
f400b3b189 Brine-H2 PVT model To be used with H2STORE
Mostly copied CO2STORE and added specifications for brine-H2.
2023-04-12 14:28:01 +02:00
Svenn Tveit
337b24de87 Added hydrogen component.
Most of this is copied from Dumux with some additions and modifications.
2023-04-12 14:28:01 +02:00
Svenn Tveit
2502e05a6f Move H2STORE test below CO2STORE tests 2023-04-12 14:28:01 +02:00
Svenn Tveit
c7713c41f5 Added H2STORE keyword.
Activates H2-Brine PVT models in opm-material.
2023-04-12 14:28:01 +02:00
Arne Morten Kvarving
25da109206 bump version to 2023.10-pre 2023-04-12 11:31:55 +02:00
418 changed files with 182681 additions and 48122 deletions

View File

@@ -1,6 +1,5 @@
{
BasedOnStyle: WebKit,
AlignAfterOpenBracket: AlwaysBreak,
AlignConsecutiveAssignments: false,
AlignConsecutiveDeclarations: false,
AlignAfterOpenBracket: Align,

View File

@@ -219,9 +219,17 @@ if (OPM_ENABLE_PYTHON)
# We always need to search for Development as we use
# pybind11_add_module even if don't embed Python
if (NOT OPM_ENABLE_EMBEDDED_PYTHON)
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
if(${CMAKE_VERSION} VERSION_LESS "3.18.0")
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
else()
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
endif()
else()
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Embed Development.Module)
if(${CMAKE_VERSION} VERSION_LESS "3.18.0")
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
else()
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Embed Development.Module)
endif()
get_target_property(_lib_path Python3::Python IMPORTED_LOCATION)
set(PYTHON_LIBRARY ${_lib_path})
set(PYTHON_LIBRARIES {PYTHON_LIBRARY})
@@ -358,7 +366,7 @@ endif()
find_package(dune-common REQUIRED)
opm_need_version_of ("dune-common")
target_include_directories(dunecommon INTERFACE ${dune-common_INCLUDE_DIRS})
string(REPLACE " " ";" dflags ${dune-common_CXX_FLAGS})
string(REPLACE " " ";" dflags "${dune-common_CXX_FLAGS}")
target_compile_options(dunecommon INTERFACE ${dflags})
target_compile_definitions(dunecommon INTERFACE DUNE_COMMON_VERSION_MAJOR=${DUNE_COMMON_VERSION_MAJOR})
target_compile_definitions(dunecommon INTERFACE DUNE_COMMON_VERSION_MINOR=${DUNE_COMMON_VERSION_MINOR})
@@ -371,6 +379,7 @@ if(Boost_UNIT_TEST_FRAMEWORK_FOUND)
endif()
if(BUILD_EXAMPLES)
target_link_libraries(co2brinepvt dunecommon)
install(TARGETS co2brinepvt DESTINATION bin)
endif()
# Install build system files and documentation

View File

@@ -51,6 +51,7 @@ list (APPEND MAIN_SOURCE_FILES
src/opm/material/common/TridiagonalMatrix.cpp
src/opm/material/common/UniformXTabulated2DFunction.cpp
src/opm/material/components/CO2.cpp
src/opm/material/components/H2.cpp
src/opm/material/densead/Evaluation.cpp
src/opm/material/fluidmatrixinteractions/EclEpsScalingPoints.cpp
src/opm/material/fluidsystems/BlackOilFluidSystem.cpp
@@ -118,6 +119,7 @@ if(ENABLE_ECL_INPUT)
src/opm/input/eclipse/EclipseState/Grid/BoxManager.cpp
src/opm/input/eclipse/EclipseState/Grid/Carfin.cpp
src/opm/input/eclipse/EclipseState/Grid/CarfinManager.cpp
src/opm/input/eclipse/EclipseState/Grid/LgrCollection.cpp
src/opm/input/eclipse/EclipseState/Grid/EclipseGrid.cpp
src/opm/input/eclipse/EclipseState/Grid/FieldProps.cpp
src/opm/input/eclipse/EclipseState/Grid/FieldPropsManager.cpp
@@ -145,6 +147,7 @@ if(ENABLE_ECL_INPUT)
src/opm/input/eclipse/EclipseState/Phase.cpp
src/opm/input/eclipse/EclipseState/TracerConfig.cpp
src/opm/input/eclipse/EclipseState/MICPpara.cpp
src/opm/input/eclipse/EclipseState/WagHysteresisConfig.cpp
src/opm/input/eclipse/Schedule/Action/ActionAST.cpp
src/opm/input/eclipse/Schedule/Action/ActionContext.cpp
src/opm/input/eclipse/Schedule/Action/ActionResult.cpp
@@ -159,6 +162,7 @@ if(ENABLE_ECL_INPUT)
src/opm/input/eclipse/Schedule/Action/State.cpp
src/opm/input/eclipse/Schedule/Action/WGNames.cpp
src/opm/input/eclipse/Schedule/ArrayDimChecker.cpp
src/opm/input/eclipse/Schedule/BCProp.cpp
src/opm/input/eclipse/Schedule/CompletedCells.cpp
src/opm/input/eclipse/Schedule/eval_uda.cpp
src/opm/input/eclipse/Schedule/Events.cpp
@@ -170,6 +174,7 @@ if(ENABLE_ECL_INPUT)
src/opm/input/eclipse/Schedule/Group/GuideRateModel.cpp
src/opm/input/eclipse/Schedule/Group/GConSale.cpp
src/opm/input/eclipse/Schedule/Group/GConSump.cpp
src/opm/input/eclipse/Schedule/Group/GroupEconProductionLimits.cpp
src/opm/input/eclipse/Schedule/Group/GTNode.cpp
src/opm/input/eclipse/Schedule/KeywordHandlers.cpp
src/opm/input/eclipse/Schedule/MessageLimits.cpp
@@ -198,11 +203,13 @@ if(ENABLE_ECL_INPUT)
src/opm/input/eclipse/Schedule/Tuning.cpp
src/opm/input/eclipse/Schedule/WriteRestartFileEvents.cpp
src/opm/input/eclipse/Schedule/Well/Connection.cpp
src/opm/input/eclipse/Schedule/Well/FilterCake.cpp
src/opm/input/eclipse/Schedule/Well/injection.cpp
src/opm/input/eclipse/Schedule/Well/NameOrder.cpp
src/opm/input/eclipse/Schedule/Well/PAvg.cpp
src/opm/input/eclipse/Schedule/Well/PAvgCalculator.cpp
src/opm/input/eclipse/Schedule/Well/PAvgCalculatorCollection.cpp
src/opm/input/eclipse/Schedule/Well/PAvgDynamicSourceData.cpp
src/opm/input/eclipse/Schedule/Well/Well.cpp
src/opm/input/eclipse/Schedule/Well/WellConnections.cpp
src/opm/input/eclipse/Schedule/Well/WellMatcher.cpp
@@ -218,8 +225,10 @@ if(ENABLE_ECL_INPUT)
src/opm/input/eclipse/Schedule/Well/WellTestState.cpp
src/opm/input/eclipse/Schedule/WellTraj/RigEclipseWellLogExtractor.cpp
src/opm/input/eclipse/Schedule/Well/WellTracerProperties.cpp
src/opm/input/eclipse/Schedule/Well/WINJMULT.cpp
src/opm/input/eclipse/Schedule/Well/WList.cpp
src/opm/input/eclipse/Schedule/Well/WListManager.cpp
src/opm/input/eclipse/Schedule/Well/WVFPDP.cpp
src/opm/input/eclipse/Schedule/Well/WVFPEXP.cpp
src/opm/input/eclipse/Schedule/WellTraj/RigEclipseWellLogExtractor.cpp
src/opm/input/eclipse/EclipseState/SimulationConfig/BCConfig.cpp
@@ -242,6 +251,7 @@ if(ENABLE_ECL_INPUT)
src/opm/input/eclipse/EclipseState/Tables/TableContainer.cpp
src/opm/input/eclipse/EclipseState/Tables/TableIndex.cpp
src/opm/input/eclipse/EclipseState/Tables/TLMixpar.cpp
src/opm/input/eclipse/EclipseState/Tables/Ppcwmax.cpp
src/opm/input/eclipse/EclipseState/Tables/TableManager.cpp
src/opm/input/eclipse/EclipseState/Tables/TableSchema.cpp
src/opm/input/eclipse/EclipseState/Tables/Tables.cpp
@@ -291,6 +301,8 @@ if(ENABLE_ECL_INPUT)
src/opm/material/fluidmatrixinteractions/EclMaterialLawManagerHystParams.cpp
src/opm/material/fluidsystems/blackoilpvt/BrineCo2Pvt.cpp
src/opm/material/fluidsystems/blackoilpvt/Co2GasPvt.cpp
src/opm/material/fluidsystems/blackoilpvt/BrineH2Pvt.cpp
src/opm/material/fluidsystems/blackoilpvt/H2GasPvt.cpp
src/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityBrinePvt.cpp
src/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityOilPvt.cpp
src/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.cpp
@@ -456,19 +468,23 @@ if(ENABLE_ECL_INPUT)
tests/test_RestartFileView.cpp
tests/test_EclIO.cpp
tests/test_EGrid.cpp
tests/test_EInit.cpp
tests/test_ERft.cpp
tests/test_ERst.cpp
tests/test_ESmry.cpp
tests/test_EInit.cpp
tests/test_ExtESmry.cpp
tests/test_PAvgCalculator.cpp
tests/test_PAvgDynamicSourceData.cpp
tests/test_Serialization.cpp
tests/material/test_co2brinepvt.cpp
tests/material/test_h2brinepvt.cpp
tests/material/test_eclblackoilfluidsystem.cpp
tests/material/test_eclblackoilpvt.cpp
tests/material/test_eclmateriallawmanager.cpp
tests/parser/ACTIONX.cpp
tests/parser/ADDREGTests.cpp
tests/parser/AquiferTests.cpp
tests/parser/BCConfigTests.cpp
tests/parser/BoxTests.cpp
tests/parser/CarfinTests.cpp
tests/parser/ColumnSchemaTests.cpp
@@ -491,6 +507,7 @@ if(ENABLE_ECL_INPUT)
tests/parser/ImportTests.cpp
tests/parser/InitConfigTest.cpp
tests/parser/IOConfigTests.cpp
tests/parser/LgrTests.cpp
tests/parser/MICPTests.cpp
tests/parser/MessageLimitTests.cpp
tests/parser/MultiRegTests.cpp
@@ -584,6 +601,13 @@ list(APPEND TEST_SOURCE_FILES ${DUNE_TEST_SOURCE_FILES})
list (APPEND TEST_DATA_FILES
tests/testdata.param
tests/material/brine_unittest.json
tests/material/co2_unittest_part1.json
tests/material/co2_unittest_part2.json
tests/material/co2_unittest_above_sat.json
tests/material/co2_unittest_below_sat.json
tests/material/h2o_unittest.json
tests/material/h2_unittest.json
)
if(ENABLE_ECL_OUTPUT)
list (APPEND TEST_DATA_FILES
@@ -782,6 +806,7 @@ list( APPEND PUBLIC_HEADER_FILES
opm/material/components/Air.hpp
opm/material/components/C1.hpp
opm/material/components/Brine.hpp
opm/material/components/BrineDynamic.hpp
opm/material/fluidstates/BlackOilFluidState.hpp
opm/material/fluidstates/NonEquilibriumFluidState.hpp
opm/material/fluidstates/FluidStateSaturationModules.hpp
@@ -815,6 +840,7 @@ list( APPEND PUBLIC_HEADER_FILES
opm/material/binarycoefficients/H2O_CO2.hpp
opm/material/binarycoefficients/Air_Xylene.hpp
opm/material/binarycoefficients/Brine_CO2.hpp
opm/material/binarycoefficients/Brine_H2.hpp
opm/material/binarycoefficients/HenryIapws.hpp
opm/material/Constants.hpp
opm/material/fluidsystems/NullParameterCache.hpp
@@ -838,6 +864,7 @@ list( APPEND PUBLIC_HEADER_FILES
opm/material/fluidsystems/blackoilpvt/WaterPvtThermal.hpp
opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp
opm/material/fluidsystems/blackoilpvt/BrineCo2Pvt.hpp
opm/material/fluidsystems/blackoilpvt/BrineH2Pvt.hpp
opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp
opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp
opm/material/fluidsystems/blackoilpvt/DryHumidGasPvt.hpp
@@ -850,9 +877,11 @@ list( APPEND PUBLIC_HEADER_FILES
opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityBrinePvt.hpp
opm/material/fluidsystems/blackoilpvt/GasPvtThermal.hpp
opm/material/fluidsystems/blackoilpvt/Co2GasPvt.hpp
opm/material/fluidsystems/blackoilpvt/H2GasPvt.hpp
opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityOilPvt.hpp
opm/material/fluidsystems/H2OAirFluidSystem.hpp
opm/material/fluidsystems/H2ON2FluidSystem.hpp
opm/material/fluidsystems/ThreeComponentFluidSystem.hh
opm/material/fluidmatrixinteractions/EclTwoPhaseMaterial.hpp
opm/material/fluidmatrixinteractions/SatCurveMultiplexerParams.hpp
opm/material/fluidmatrixinteractions/EclTwoPhaseMaterialParams.hpp
@@ -1068,6 +1097,7 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/EclipseState/Grid/Fault.hpp
opm/input/eclipse/EclipseState/Grid/Box.hpp
opm/input/eclipse/EclipseState/Grid/Carfin.hpp
opm/input/eclipse/EclipseState/Grid/LgrCollection.hpp
opm/input/eclipse/EclipseState/Grid/FieldProps.hpp
opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp
opm/input/eclipse/EclipseState/Grid/FaultFace.hpp
@@ -1081,6 +1111,7 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/EclipseState/EndpointScaling.hpp
opm/input/eclipse/EclipseState/TracerConfig.hpp
opm/input/eclipse/EclipseState/MICPpara.hpp
opm/input/eclipse/EclipseState/WagHysteresisConfig.hpp
opm/input/eclipse/EclipseState/Tables/DenT.hpp
opm/input/eclipse/EclipseState/Tables/JouleThomson.hpp
opm/input/eclipse/EclipseState/Tables/SimpleTable.hpp
@@ -1112,6 +1143,7 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/EclipseState/Tables/SgcwmisTable.hpp
opm/input/eclipse/EclipseState/Tables/Sof2Table.hpp
opm/input/eclipse/EclipseState/Tables/TLMixpar.hpp
opm/input/eclipse/EclipseState/Tables/Ppcwmax.hpp
opm/input/eclipse/EclipseState/Tables/TableManager.hpp
opm/input/eclipse/EclipseState/Tables/SwfnTable.hpp
opm/input/eclipse/EclipseState/Tables/EnptvdTable.hpp
@@ -1193,6 +1225,7 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/Schedule/Action/State.hpp
opm/input/eclipse/Schedule/Action/WGNames.hpp
opm/input/eclipse/Schedule/ArrayDimChecker.hpp
opm/input/eclipse/Schedule/BCProp.hpp
opm/input/eclipse/Schedule/GasLiftOpt.hpp
opm/input/eclipse/Schedule/Network/Balance.hpp
opm/input/eclipse/Schedule/Network/Branch.hpp
@@ -1201,9 +1234,11 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/Schedule/VFPInjTable.hpp
opm/input/eclipse/Schedule/VFPProdTable.hpp
opm/input/eclipse/Schedule/Well/Connection.hpp
opm/input/eclipse/Schedule/Well/FilterCake.hpp
opm/input/eclipse/Schedule/Well/PAvg.hpp
opm/input/eclipse/Schedule/Well/PAvgCalculator.hpp
opm/input/eclipse/Schedule/Well/PAvgCalculatorCollection.hpp
opm/input/eclipse/Schedule/Well/PAvgDynamicSourceData.hpp
opm/input/eclipse/Schedule/Well/Well.hpp
opm/input/eclipse/Schedule/Well/WellEnums.hpp
opm/input/eclipse/Schedule/Well/WellInjectionControls.hpp
@@ -1218,6 +1253,8 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/Schedule/Well/WellMICPProperties.hpp
opm/input/eclipse/Schedule/Well/WellPolymerProperties.hpp
opm/input/eclipse/Schedule/Well/WellTracerProperties.hpp
opm/input/eclipse/Schedule/Well/WINJMULT.hpp
opm/input/eclipse/Schedule/Well/WVFPDP.hpp
opm/input/eclipse/Schedule/Well/WVFPEXP.hpp
opm/input/eclipse/Schedule/Well/WellTestConfig.hpp
opm/input/eclipse/Schedule/Well/WellTestState.hpp
@@ -1240,6 +1277,7 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/Schedule/Group/GuideRate.hpp
opm/input/eclipse/Schedule/Group/GConSale.hpp
opm/input/eclipse/Schedule/Group/GConSump.hpp
opm/input/eclipse/Schedule/Group/GroupEconProductionLimits.hpp
opm/input/eclipse/Schedule/Group/GuideRateConfig.hpp
opm/input/eclipse/Schedule/Group/GuideRateModel.hpp
opm/input/eclipse/Schedule/MessageLimits.hpp

View File

@@ -294,7 +294,7 @@ if(SuiteSparse_FOUND)
string (TOUPPER ${_module} _MODULE)
if(SuiteSparse_${_MODULE}_FOUND)
if(NOT TARGET SuiteSparse::${_module})
message(STATUS "Creating target SuitSparse::${_module}")
message(STATUS "Creating target SuiteSparse::${_module}")
add_library(SuiteSparse::${_module} UNKNOWN IMPORTED GLOBAL)
set_target_properties(SuiteSparse::${_module} PROPERTIES
IMPORTED_LOCATION ${${_MODULE}_LIBRARY}

View File

@@ -19,8 +19,7 @@ find_opm_package (
# TODO: we should probe for all the HAVE_* values listed below;
# however, we don't actually use them in our implementation, so
# we just include them to forward here in case anyone else does
"dune-common REQUIRED;
"
"dune-common REQUIRED"
# header to search for
"dune/polygongrid/mesh.hh"

View File

@@ -1,200 +0,0 @@
# translate a list of libraries into a command-line that can be passed to the
# compiler/linker. first parameter is the name of the variable that will
# receive this list, the rest is considered the list of libraries
function (linker_cmdline what INTO outvar FROM)
if (NOT (UNIX OR MSYS OR MINGW))
return ()
endif (NOT (UNIX OR MSYS OR MINGW))
# if we are going to put these in regexps, we must escape period
string (REPLACE "." "\\." esc_dl_pref "${CMAKE_SHARED_LIBRARY_PREFIX}")
string (REPLACE "." "\\." esc_dl_suff "${CMAKE_SHARED_LIBRARY_SUFFIX}")
string (REPLACE "." "\\." esc_ar_pref "${CMAKE_STATIC_LIBRARY_PREFIX}")
string (REPLACE "." "\\." esc_ar_suff "${CMAKE_STATIC_LIBRARY_PREFIX}")
# CMake loves absolute paths, whereas libtool won't have any of it!
# (you get an error message about argument not parsed). translate each
# of the libraries into a linker option
set (deplib_list "")
set (deplib_list_tmp "")
foreach (deplib IN LISTS ARGN)
# resolve imported targets
string(FIND ${deplib} "::" _sep)
if (_sep GREATER "-1")
set(_lib "")
# the code below does not really work for imported interface library
# as cmake will error out whene querying IMPORTED_LOCATION, because the
# property is not whitelisted. I have no idea how to determine if
# a library is an imported interface library
# At least it works for resolving OpenMP::OpenMP_CXX
#
# get_property(_def TARGET ${deplib} PROPERTY IMPORTED_LOCATION DEFINED)
# if (_def)
# get_property(_def TARGET ${deplib} PROPERTY IMPORTED_LOCATION SET)
# if (_def)
# get_target_property(_tmp_lib ${deplib} IMPORTED_LOCATION)
# list(APPEND _lib ${_tmp_lib})
# endif()
# endif()
get_property(_def TARGET ${deplib} PROPERTY INTERFACE_LINK_LIBRARIES SET)
if (_def)
get_target_property(_tmp_lib ${deplib} INTERFACE_LINK_LIBRARIES)
list(APPEND _lib ${_tmp_lib})
endif()
set(deplib ${_lib})
endif()
list(APPEND deplib_list_tmp ${deplib})
endforeach()
foreach (deplib IN LISTS deplib_list_tmp)
# starts with a hyphen already? then just add it
string (SUBSTRING ${deplib} 0 1 dash)
if (${dash} STREQUAL "-")
list (APPEND deplib_list ${deplib})
else (${dash} STREQUAL "-")
# otherwise, parse the name into a directory and a name
get_filename_component (deplib_dir ${deplib} PATH)
get_filename_component (deplib_orig ${deplib} NAME)
string (REGEX REPLACE
"^${esc_dl_pref}(.*)${esc_dl_suff}$"
"\\1"
deplib_name
${deplib_orig}
)
string (REGEX REPLACE
"^${esc_ar_pref}(.*)${esc_ar_suff}$"
"\\1"
deplib_name
${deplib_name}
)
# directory and name each on their own; this is somewhat
# unsatisfactory because it may be that a system dir is specified
# by an earlier directory and you start picking up libraries from
# there instead of the "closest" path here. also, the soversion
# is more or less lost. remove system default path, to lessen the
# chance that we pick the wrong library
if (NOT ((deplib_dir STREQUAL "/usr/lib") OR
(deplib_dir STREQUAL "") OR
(deplib_dir STREQUAL "/usr/${CMAKE_INSTALL_LIBDIR}")))
list (APPEND deplib_list "-L${deplib_dir}")
endif ()
# if there was no translation of the name, the library is named
# unconventionally (.so.3gf, I'm looking at you), so pass this
# name unmodified to the linker switch
if (deplib_orig STREQUAL deplib_name AND
NOT deplib_orig STREQUAL "stdc++fs")
list (APPEND deplib_list "-l:${deplib_orig}")
else ()
list (APPEND deplib_list "-l${deplib_name}")
endif (deplib_orig STREQUAL deplib_name AND
NOT deplib_orig STREQUAL "stdc++fs")
endif (${dash} STREQUAL "-")
endforeach (deplib)
# caller determines whether we want it returned as a list or a string
if ("${what}" STREQUAL "LIST")
set (${outvar} ${deplib_list})
else ("${what}" STREQUAL "LIST")
set (${outvar} "${deplib_list}")
string (REPLACE ";" " " ${outvar} "${${outvar}}")
endif ("${what}" STREQUAL "LIST")
set (${outvar} "${${outvar}}" PARENT_SCOPE)
endfunction (linker_cmdline what INTO outvar FROM)
function (configure_la name target)
if (NOT (UNIX OR MSYS OR MINGW))
return ()
endif (NOT (UNIX OR MSYS OR MINGW))
# these generic variables are initialized from the project info
set (current "${${name}_VERSION_MAJOR}")
set (age "${${name}_VERSION_MINOR}")
set (inherited_linker_flags "${${name}_LINKER_FLAGS}")
set (dependency_libs "${${name}_LIBRARIES}")
# translate list of libraries to command line
linker_cmdline (LIST INTO dependency_libs FROM ${dependency_libs})
# convert from CMake list (i.e. semi-colon separated)
string (REPLACE ";" " " inherited_linker_flags "${inherited_linker_flags}")
string (REPLACE ";" " " dependency_libs "${dependency_libs}")
# this is the preferred installation path
set (libdir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
# ${name}_LIBRARY_TYPE is either SHARED or STATIC
if (${name}_LIBRARY_TYPE STREQUAL "SHARED")
set (libprefix "${CMAKE_SHARED_LIBRARY_PREFIX}")
set (libsuffix "${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (libname "${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX}")
# only Unix has soversion in library names
if (UNIX)
set (dlname "${libname}.${current}")
set (library_names "${libname}.${current}.${age} ${libname}.${current} ${libname}")
else (UNIX)
set (dlname "${libname}")
set (library_names "${libname}")
endif (UNIX)
set (old_library "")
else (${name}_LIBRARY_TYPE STREQUAL "SHARED")
set (dlname "")
set (library_names "")
set (old_library "${CMAKE_STATIC_LIBRARY_PREFIX}${target}${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif (${name}_LIBRARY_TYPE STREQUAL "SHARED")
# get the version of libtool installed on the system; this is
# necessary because libtool checks that the file contains its own
# signature(!)
if (NOT libtool_MAIN)
find_file (
libtool_MAIN
ltmain.sh
PATHS /usr
PATH_SUFFIXES share/libtool/config/
DOC "Location of libtool"
)
mark_as_advanced (libtool_MAIN)
# notify the user if it not found after we explicitly searched
if (NOT libtool_MAIN)
message (STATUS "Not generating libtool archive (.la) since libtool was not found")
endif (NOT libtool_MAIN)
endif (NOT libtool_MAIN)
if (libtool_MAIN)
file (STRINGS
${libtool_MAIN}
ltversion_STRING
REGEX "^VERSION=\".*\""
)
endif (libtool_MAIN)
if (ltversion_STRING)
string (REGEX REPLACE
"^VERSION=\"?(.*)\"?"
"\\1"
ltversion
${ltversion_STRING}
)
endif (ltversion_STRING)
# assume that we are in cmake/Modules, and that the template have been
# put in cmake/Templates. we cannot use CMAKE_CURRENT_LIST_DIR because
# this is in a function, and we cannot know who's calling us
set (templ_dir "${OPM_MACROS_ROOT}/cmake/Templates")
# only write an .la if libtool is found; otherwise we have no use
# for it.
if (ltversion)
set (la_file "lib${target}.la")
message (STATUS "Writing libtool archive for ${target}")
configure_file (
${templ_dir}/la.in
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${la_file}
@ONLY@
)
else (ltversion)
set (la_file "")
endif (ltversion)
# return this variable to the caller
if (ARGV2)
set (${ARGV2} "${la_file}" PARENT_SCOPE)
endif (ARGV2)
endfunction (configure_la target)

View File

@@ -110,6 +110,10 @@ macro (OpmInitDirVars)
endif (COMMAND dir_hook)
endmacro ()
if("${CMAKE_SIZEOF_VOID_P}" LESS 8)
message(FATAL_ERROR "OPM will only work correctly on 64bit (or higher) systems!")
endif()
OpmInitProjVars ()
OpmInitDirVars ()

View File

@@ -1,38 +1,5 @@
# - Helper routines for opm-core like projects
include (LibtoolArchives) # linker_cmdline
# convert a list back to a command-line string
function (unseparate_args var_name prefix value)
separate_arguments (value)
foreach (item IN LISTS value)
set (prefixed_item "${prefix}${item}")
if (${var_name})
set (${var_name} "${${var_name}} ${prefixed_item}")
else (${var_name})
set (${var_name} "${prefixed_item}")
endif (${var_name})
endforeach (item)
set (${var_name} "${${var_name}}" PARENT_SCOPE)
endfunction (unseparate_args var_name prefix value)
# wrapper to set variables in pkg-config file
function (configure_pc_file name source dest prefix libdir includedir)
# escape set of standard strings
unseparate_args (includes "-I" "${${name}_INCLUDE_DIRS}")
unseparate_args (defs "" "${${name}_DEFINITIONS}")
linker_cmdline (STRING INTO libs FROM ${${name}_LIBRARIES})
# necessary to make these variables visible to configure_file
set (name "${${name}_NAME}")
set (description "${${name}_DESCRIPTION}")
set (major "${${name}_VERSION_MAJOR}")
set (minor "${${name}_VERSION_MINOR}")
set (target "${${name}_LIBRARY}")
linker_cmdline (STRING INTO target from ${target})
configure_file (${source} ${dest} @ONLY)
endfunction (configure_pc_file name source dist prefix libdir includedir)
function (configure_cmake_file name variant version)
# declarative list of the variable names that are used in the template
# and that must be defined in the project to be exported
@@ -91,16 +58,6 @@ function (opm_cmake_config name)
APPEND "${${name}_CONFIG_VARS}"
)
# config-mode .pc file; use this to find the build tree
configure_pc_file (
${name}
${template_dir}/opm-project.pc.in
${PROJECT_BINARY_DIR}/${${name}_NAME}.pc
${PROJECT_BINARY_DIR}
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
${PROJECT_SOURCE_DIR}
)
# The next replace will result in bogus entries if install directory is
# a subdirectory of source tree,
# and we have existing entries pointing to that install directory.
@@ -154,28 +111,4 @@ function (opm_cmake_config name)
FILES ${PROJECT_BINARY_DIR}/${${name}_NAME}-config-version.cmake
DESTINATION share/cmake${${name}_VER_DIR}/${${name}_NAME}
)
# find-mode .pc file; use this to locate system installation
configure_pc_file (
${name}
${template_dir}/opm-project.pc.in
${PROJECT_BINARY_DIR}/${${name}_NAME}-install.pc
${CMAKE_INSTALL_PREFIX}
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${${name}_VER_DIR}
${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}
)
# put this in the right system location; if we have binaries then it
# should go in the arch-specific lib/ directory, otherwise use the
# common/noarch lib/ directory (these targets come from UseMultiArch)
if (${name}_TARGET)
set (_pkg_dir ${CMAKE_INSTALL_LIBDIR})
else ()
set (_pkg_dir lib)
endif ()
install (
FILES ${PROJECT_BINARY_DIR}/${${name}_NAME}-install.pc
DESTINATION ${CMAKE_INSTALL_PREFIX}/${_pkg_dir}/pkgconfig${${name}_VER_DIR}/
RENAME ${${name}_NAME}.pc
)
endfunction (opm_cmake_config name)

View File

@@ -305,7 +305,10 @@ macro(opm_add_test TestName)
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
add_static_analysis_tests(CURTEST_SOURCES dirs)
if(HAVE_DYNAMIC_BOOST_TEST)
set_target_properties (${CURTEST_EXE_NAME} PROPERTIES
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK)
endif()
if(TARGET ${project}_prepare)
add_dependencies("${CURTEST_EXE_NAME}" ${project}_prepare)
endif()

View File

@@ -1,103 +0,0 @@
####################################################################
# #
# Setup static targets for all submodules. #
# Useful when building a static benchmark executable #
# #
####################################################################
# Macros
# Clone a git and build it statically
# If ARGN is specified installation is skipped, ARGN0 is
# a build-system target name and the rest of ARGN are build tool parameters
function(opm_from_git repo name revision)
if(ARGN)
list(GET ARGN 0 target)
list(REMOVE_AT ARGN 0)
# This is used for top build of benchmarks.
# Clones the local source tree and builds it against the static libraries,
# skipping the install step. Note that in pricinple URL instead of GIT_REPOSITORY
# could have been used, but externalproject cannot handle build directories
# which are a subdirectory of the source tree, and since that is typically the case
# we work-around by re-cloning the local git.
# The ommision of GIT_TAG ensures that we build the tip of the local git.
set(COMMANDS BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --target ${target} -- ${ARGN}
GIT_TAG ${revision}
INSTALL_COMMAND)
else()
# This is used with "normal" static builds.
set(COMMANDS GIT_TAG ${revision})
endif()
externalproject_add(${name}-static
GIT_REPOSITORY ${repo}
PREFIX static/${name}
CONFIGURE_COMMAND PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/static/installed/lib/pkgconfig:${CMAKE_BINARY_DIR}/static/installed/${CMAKE_INSTALL_LIBDIR}/pkgconfig:$ENV{PKG_CONFIG_PATH}
${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/static/installed
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DBUILD_SHARED_LIBS=0
-DBUILD_TESTING=0 -DBUILD_EXAMPLES=0 <SOURCE_DIR>
-G ${CMAKE_GENERATOR}
${COMMANDS} "")
set_target_properties(${name}-static PROPERTIES EXCLUDE_FROM_ALL 1)
endfunction()
# Convenience macro for adding dependencies without having to include the -static all over
macro(opm_static_add_dependencies target)
foreach(arg ${ARGN})
add_dependencies(${target}-static ${arg}-static)
endforeach()
endmacro()
include(ExternalProject)
include(GNUInstallDirs)
# Defaults to building master
if(NOT OPM_BENCHMARK_VERSION)
set(OPM_BENCHMARK_VERSION "origin/master")
endif()
# ERT
externalproject_add(ert-static
GIT_REPOSITORY https://github.com/Ensembles/ert
PREFIX static/ert
GIT_TAG ${revision}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/static/installed
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DBUILD_SHARED_LIBS=0 <SOURCE_DIR>/devel)
set_target_properties(ert-static PROPERTIES EXCLUDE_FROM_ALL 1)
# 2015.04 release used dune v2.3.1
if(OPM_BENCHMARK_VERSION STREQUAL "release/2015.04/final")
set(DUNE_VERSION v2.3.1)
endif()
# Master currently uses dune v2.3.1
if(OPM_BENCHMARK_VERSION STREQUAL "origin/master")
set(DUNE_VERSION v2.3.1)
endif()
# Fallback
if(NOT DUNE_VERSION)
set(DUNE_VERSION v2.3.1)
endif()
# Dune
foreach(dune_repo dune-common dune-geometry dune-grid dune-istl)
opm_from_git(http://git.dune-project.org/repositories/${dune_repo} ${dune_repo} ${DUNE_VERSION})
endforeach()
opm_static_add_dependencies(dune-istl dune-common)
opm_static_add_dependencies(dune-geometry dune-common)
opm_static_add_dependencies(dune-grid dune-geometry)
# OPM
foreach(opm_repo opm-common opm-parser opm-core opm-output opm-grid opm-material
opm-upscaling)
opm_from_git(https://github.com/OPM/${opm_repo} ${opm_repo} ${OPM_BENCHMARK_VERSION})
endforeach()
opm_static_add_dependencies(opm-parser opm-common ert)
opm_static_add_dependencies(opm-core opm-parser dune-istl)
opm_static_add_dependencies(opm-grid opm-core dune-grid)
opm_static_add_dependencies(opm-material opm-core)
opm_static_add_dependencies(opm-upscaling opm-grid opm-material)

View File

@@ -1,20 +0,0 @@
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
# defines that must be present in config.h for our headers
set (opm-verteq_CONFIG_VAR
)
# dependencies
set (opm-verteq_DEPS
# compile with C99 support if available
"C99"
# compile with C++0x/11 support if available
"CXX11Features"
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS date_time filesystem system unit_test_framework REQUIRED"
# OPM dependency
"opm-common;
opm-core REQUIRED"
)

View File

@@ -1,6 +1,9 @@
.TH SUMMARY "1" "October 2022" "arraylist 2022.10" "User Commands"
.TH SUMMARY "1" "October 2023" "arraylist 2023.10" "User Commands"
.SH NAME
summary \- Printer for list of arrays in Eclipse summary files
arraylist \- Printer for list of arrays in Eclipse summary files
.SH SYNOPSIS
.B arraylist
[\fI\,OPTIONS\/\fR] \fI\,ECL_DECK_FILENAME\/\fR
.SH DESCRIPTION
List all arrays found in an EclFile specified on the command line.
.PP

View File

@@ -1,6 +1,10 @@
.TH CO2BRINEPVT "1" "April 2022" "co2brinepvt" "User Commands"
.TH CO2BRINEPVT "1" "October 2023" "co2brinepvt" "User Commands"
.SH NAME
co2brinepvt \- compute and print pvt properties for co2 with brine
.SH SYNOPSIS
.B co2brinepvt
[\fI\,OPTIONS\/\fR] \fI\,PROPERTY\/\fR \fI\,PHASE\/\fR
\fI\,PRESSURE\/\fR \fI\,TEMPERATURE\/\fR [\fI\,SALINITY\/\fR] [\fI\,RS\/\fR]
.SH DESCRIPTION
co2brinepvt computes PVT properties of a brine/co2 system
for a given phase (oil or brine), pressure, temperature, salinity and rs.

View File

@@ -1,6 +1,9 @@
.TH COMPAREECL "1" "October 2022" "compareECL 2022.10" "User Commands"
.TH COMPAREECL "1" "October 2023" "compareECL 2023.10" "User Commands"
.SH NAME
compareECL \- Comparator for Eclipse files
.SH SYNOPSIS
.B convertECL
[\fI\,OPTIONS\/\fR] \fI\,ECL_DECK_FILENAME_1\/\fR \fI\,ECL_DECK_FILENAME_2\/\fR
.SH DESCRIPTION
compareECL compares ECLIPSE files (restart (.RST), unified restart (.UNRST), initial (.INIT), summary (.SMRY), unified summary (.UNSMRY) or .RFT) and gridsizes (from .EGRID or .GRID file) from two simulations.
The program takes four arguments:

View File

@@ -1,6 +1,10 @@
.TH CONVERTECL "1" "October 2022" "convertECL 2022.10" "User Commands"
.TH CONVERTECL "1" "October 2023" "convertECL 2023.10" "User Commands"
.SH NAME
convertECL \- Converter for Eclipse files (binary <-> formatted format)
convertECL \- Converter for Eclipse files (binary <-> formatted
format)
.SH SYNOPSIS
.B convertECL
[\fI\,OPTIONS\/\fR] \fI\,ECL_DECK_FILENAME\/\fR
.SH DESCRIPTION
convertECL needs one argument which is the input file to be converted. If this is a binary file the output file will be formatted. If the input file is formatted the output will be binary.
.PP

View File

@@ -1,8 +1,11 @@
.TH OPMHASH "1" "October 2022" "opmhash 2022.10" "User Commands"
.TH OPMHASH "1" "October 2023" "opmhash 2023.10" "User Commands"
.SH NAME
opmhash \- Hasher for summary keywords in Eclipse files
.SH SYNOPSIS
.B opmhash
[\fI\,OPTIONS\/\fR] \fI\,ECL_DECK_FILENAME\/\fR
[\fI\,ECL_DECK_FILENAME_2\/\fR] [\fI\,ECL_DECK_FILENAME_3\/\fR] ...
.SH DESCRIPTION
opmhash: invalid option \fB\-\-\fR 'h'
The purpose of the opmhash program is to load a deck and create a summary, by
diffing two such summaries it is simple to determine if two decks are similar.
For each keyword a hash of the normalized content is calculated. The output of

View File

@@ -1,6 +1,9 @@
.TH OPMPACK "1" "October 2022" "opmpack 2022.10" "User Commands"
.TH OPMPACK "1" "October 2023" "opmpack 2023.10" "User Commands"
.SH NAME
opmpack \- Validator and printer of deck in Eclipse files without comments
.SH SYNOPSIS
.B opmpack
[\fI\,OPTIONS\/\fR] \fI\,ECL_DECK_FILENAME\/\fR
.SH DESCRIPTION
The opmpack program will load a deck, resolve all include
files and then print it out again on stdout. All comments

View File

@@ -1,6 +1,10 @@
.TH RST_DECK: "1" "October 2022" "rst_deck 2022.10" "User Commands"
.TH RST_DECK: "1" "October 2023" "rst_deck 2023.10" "User Commands"
.SH NAME
rst_deck \- Convert simulation deck to a deck ready for restart
.SH SYNOPSIS
.B rst_deck
[\fI\,OPTIONS\/\fR] \fI\,ECL_DECK_FILENAME\/\fR
\fI\,RESTART_SOURCE\/\fR [\fI\,BASENAME_RESTART_DECK\/\fR
.SH DESCRIPTION
The rst_deck program will load a simulation deck and parameters for a restart
and reformat the deck to become a restart deck. Before the updated deck is

View File

@@ -1,6 +1,10 @@
.TH SUMMARY "1" "October 2022" "summary 2022.10" "User Commands"
.TH SUMMARY "1" "October 2023" "summary 2023.10" "User Commands"
.SH NAME
summary \- Printer for summary keys in Eclipse summary files
.SH SYNOPSIS
.B summary
[\fI\,OPTIONS\/\fR] \fI\,ECL_DECK_FILENAME\/\fR
\fI\,SUMMARY_KEY1\/\fR [\fI\,SUMMARY_KEY2\/\fR] ...
.SH DESCRIPTION
summary needs a minimum of two arguments. First is smspec filename and then list of vectors
.PP

View File

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

View File

@@ -93,7 +93,7 @@ int main(int argc, char **argv)
if (argc > 6)
rs = atof(argv[6]);
const double MmNaCl = 58e-3; // molar mass of NaCl [kg/mol]
const double MmNaCl = 58.44e-3; // molar mass of NaCl [kg/mol]
// convert to mass fraction
std::vector<double> salinity = {0.0};
if (molality > 0.0)

View File

@@ -72,13 +72,13 @@ public:
void assign(const std::vector<T>& data);
void resize(size_t size);
void clear();
inline virtual size_t size() const;
inline size_t size() const override;
inline void set(size_t index, const T& val);
inline void setAll(const T& val);
inline void setConsecutive(const T& startVal);
inline const T& get(size_t index) const;
inline virtual T val(size_t index) const;
inline T val(size_t index) const override;
inline const T* ptr() const;
inline T* ptr();

View File

@@ -46,7 +46,9 @@ namespace cvf {
// User actions (interactive responses)
static const int USERACTION_CONTINUE = 0;
#ifdef WIN32
static const int USERACTION_DEBUGBREAK = 1;
#endif
static const int USERACTION_ABORT = 2;
@@ -79,7 +81,7 @@ public:
class AssertHandlerConsole : public AssertHandler
{
public:
virtual Assert::FailAction handleAssert(const char* fileName, int lineNumber, const char* expr, const char* msg);
Assert::FailAction handleAssert(const char* fileName, int lineNumber, const char* expr, const char* msg) override;
private:
static void reportToConsole(const char* fileName, int lineNumber, const char* expr, const char* msg);
@@ -270,7 +272,7 @@ void AssertHandlerConsole::winCreateConsoleAndRedirectIO(bool redirectInput)
class AssertHandlerWinDialog : public AssertHandler
{
public:
virtual Assert::FailAction handleAssert(const char* fileName, int lineNumber, const char* expr, const char* msg);
Assert::FailAction handleAssert(const char* fileName, int lineNumber, const char* expr, const char* msg) override;
private:
static int handleUsingDialog(const char* fileName, int lineNumber, const char* expr, const char* msg);

View File

@@ -112,7 +112,7 @@ public:
Color3f();
Color3f(float r, float g, float b);
Color3f(const Color3f& other);
Color3f(ColorIdent colorIdent);
explicit Color3f(ColorIdent colorIdent);
explicit Color3f(const Color3ub& other);
Color3f& operator=(const Color3f& rhs);
@@ -158,7 +158,7 @@ public:
Color3ub();
Color3ub(ubyte r, ubyte g, ubyte b);
Color3ub(const Color3ub& other);
Color3ub(ColorIdent colorIdent);
explicit Color3ub(ColorIdent colorIdent);
explicit Color3ub(const Color3f& other);
Color3ub& operator=(const Color3ub& rhs);

View File

@@ -60,7 +60,7 @@ public:
};
public:
DebugTimer(const char* prefix, OperationMode operationMode = NORMAL);
explicit DebugTimer(const char* prefix, OperationMode operationMode = NORMAL);
~DebugTimer();
void restart(const char* msg = NULL);

View File

@@ -52,7 +52,7 @@ class Flags
public:
inline Flags();
inline Flags(const Flags& other);
inline Flags(FlagEnum flag);
explicit inline Flags(FlagEnum flag);
inline Flags& operator=(const Flags& rhs);
inline Flags& operator=(FlagEnum flag);

View File

@@ -99,7 +99,7 @@ class ref
public:
ref(T* object = NULL);
ref(const ref& other);
template<typename T2> ref(const ref<T2>& other);
template<typename T2> explicit ref(const ref<T2>& other);
~ref();
ref& operator=(T* rhs);
@@ -150,7 +150,7 @@ class cref
public:
cref(const T* object = NULL);
cref(const cref& other);
template<typename T2> cref(const cref<T2>& other);
template<typename T2> explicit cref(const cref<T2>& other);
~cref();
cref& operator=(const T* rhs);

View File

@@ -374,7 +374,7 @@ bool Plane::intersect(const Plane& other, Vec3d* point, Vec3d* direction) const
CVF_ASSERT(point);
double invdet = UNDEFINED_DOUBLE;
double invdet;
Vec3d normal1 = this->normal();
Vec3d normal2 = other.normal();

View File

@@ -72,7 +72,7 @@ namespace cvf {
//--------------------------------------------------------------------------------------------------
/// Write debug text to console, DevStudio output window and file (future)
//--------------------------------------------------------------------------------------------------
void Trace::show(String message)
void Trace::show(const String& message)
{
showTraceOutput(message, true);
}
@@ -88,7 +88,7 @@ void Trace::show(const char* format, ...)
va_list argList;
va_start(argList, format);
const int maxFormatLength = 4000;
constexpr int maxFormatLength = 4000;
char temp[maxFormatLength + 1];
#ifdef WIN32
@@ -96,7 +96,7 @@ void Trace::show(const char* format, ...)
#elif defined(CVF_ANDROID)
__android_log_print(ANDROID_LOG_DEBUG, "CVF_TAG", format, argList);
#else
vsprintf(temp, format, argList);
vsnprintf(temp, maxFormatLength, format, argList);
#endif
va_end(argList);
@@ -124,7 +124,7 @@ void Trace::showFileLineNumber(const String& file, int line, const String& messa
//--------------------------------------------------------------------------------------------------
/// Show the trace output in console and DevStudio output window
//--------------------------------------------------------------------------------------------------
void Trace::showTraceOutput(String text, bool addNewLine)
void Trace::showTraceOutput(const String& text, bool addNewLine)
{
#ifdef WIN32
AllocConsole();

View File

@@ -51,12 +51,12 @@ namespace cvf {
class Trace
{
public:
static void show(String message);
static void show(const String& message);
static void show(const char* format, ...);
static void showFileLineNumber(const String& file, int line, const String& message);
private:
static void showTraceOutput(String text, bool addNewLine);
static void showTraceOutput(const String& text, bool addNewLine);
};

View File

@@ -22,7 +22,6 @@
//##################################################################################################
#include "cvfBase.h"
#include "cvfVector3.h"
namespace external {

View File

@@ -158,6 +158,11 @@ typedef Vector3<int> Vec3i; ///< A vector with int components
typedef Vector3<uint> Vec3ui; ///< A vector with uint components
typedef Vector3<size_t> Vec3st; ///< A vector with size_t components
template<> Vec3d const Vec3d::UNDEFINED;
template<> Vec3f const Vec3f::UNDEFINED;
template<> Vec3i const Vec3i::UNDEFINED;
template<> Vec3st const Vec3st::UNDEFINED;
}
} //namespace external
#include "cvfVector3.inl"

View File

@@ -491,7 +491,7 @@ inline void Vector4<S>::setZero()
template<typename S>
inline bool Vector4<S>::isZero() const
{
return (m_v[0] == 0) && (m_v[1] == 0) && (m_v[2] == 0) && (m_v[2] == 0);
return (m_v[0] == 0) && (m_v[1] == 0) && (m_v[2] == 0) && (m_v[3] == 0);
}

View File

@@ -243,7 +243,6 @@ int largestComponent(const cvf::Vec3d v)
if (v.z() > maxLength)
{
maxLength = v.z();
idx = 2;
}
@@ -787,8 +786,11 @@ void AABBTree::deleteInternalNodesBottomUp(AABBTreeNode* node)
auto internalNode = dynamic_cast<AABBTreeNodeInternal*>(node);
CVF_ASSERT(internalNode);
AABBTree::deleteInternalNodesBottomUp(internalNode->left());
AABBTree::deleteInternalNodesBottomUp(internalNode->right());
if (internalNode)
{
AABBTree::deleteInternalNodesBottomUp(internalNode->left());
AABBTree::deleteInternalNodesBottomUp(internalNode->right());
}
delete internalNode;
}

View File

@@ -283,8 +283,8 @@ bool Ray::boxIntersect(const BoundingBox& box, Vec3d* intersectionPoint) const
// Find candidate planes; this loop can be avoided if rays cast all from the eye(assume perpsective view)
bool inside = true;
char quadrant[3];
double candidatePlane[3];
char quadrant[3]{};
double candidatePlane[3] = {0.0, 0.0, 0.0};
Vec3d min = box.min();
Vec3d max = box.max();
@@ -320,17 +320,13 @@ bool Ray::boxIntersect(const BoundingBox& box, Vec3d* intersectionPoint) const
}
// Calculate T distances to candidate planes
double maxT[3];
double maxT[3]{-1.0f, -1.0f, -1.0f};
for (i = 0; i < 3; i++)
{
if (quadrant[i] != MIDDLE && m_direction[i] !=0.0f)
{
maxT[i] = (candidatePlane[i] - m_origin[i]) / m_direction[i];
}
else
{
maxT[i] = -1.0f;
}
}
// Get largest of the maxT's for final choice of intersection

View File

@@ -30,9 +30,9 @@ namespace external {
//--------------------------------------------------------------------------------------------------
RigWellPath::RigWellPath()
: cvf::Object()
, objectBeingDeleted( this )
, m_hasDatumElevation( false )
, m_datumElevation( 0.0 )
, objectBeingDeleted( this )
, m_uniqueStartIndex( 0u )
, m_uniqueEndIndex( std::numeric_limits<size_t>::max() )
{
@@ -43,13 +43,13 @@ RigWellPath::RigWellPath()
//--------------------------------------------------------------------------------------------------
RigWellPath::RigWellPath( const RigWellPath& rhs )
: cvf::Object()
, objectBeingDeleted( this )
, m_wellPathPoints( rhs.m_wellPathPoints )
, m_measuredDepths( rhs.m_measuredDepths )
, m_hasDatumElevation( rhs.m_hasDatumElevation )
, m_datumElevation( rhs.m_datumElevation )
, m_uniqueStartIndex( rhs.m_uniqueStartIndex )
, m_uniqueEndIndex( rhs.m_uniqueEndIndex )
, objectBeingDeleted( this )
{
CVF_ASSERT( m_wellPathPoints.size() == m_measuredDepths.size() );
}
@@ -59,12 +59,12 @@ RigWellPath::RigWellPath( const RigWellPath& rhs )
//--------------------------------------------------------------------------------------------------
RigWellPath::RigWellPath( const std::vector<cvf::Vec3d>& wellPathPoints, const std::vector<double>& measuredDepths )
: cvf::Object()
, objectBeingDeleted( this )
, m_wellPathPoints( wellPathPoints )
, m_measuredDepths( measuredDepths )
, m_hasDatumElevation( false )
, m_datumElevation( 0.0 )
, m_uniqueStartIndex( 0u )
, objectBeingDeleted( this )
, m_uniqueEndIndex( std::numeric_limits<size_t>::max() )
{
CVF_ASSERT( m_wellPathPoints.size() == m_measuredDepths.size() );

View File

@@ -166,7 +166,7 @@ bool HexGridIntersectionTools::planeTriangleIntersection( const cvf::Plane& plan
if ( onPosSide[2] ) topVx = 3;
// Case 3a: Two negative distances and the last is within tolerance of zero.
if ( sqrSignedDistances[topVx - 1] < sqrDistanceTolerance )
if ( topVx > 0 && sqrSignedDistances[topVx - 1] < sqrDistanceTolerance )
{
return false;
}
@@ -178,7 +178,7 @@ bool HexGridIntersectionTools::planeTriangleIntersection( const cvf::Plane& plan
if ( !onPosSide[2] ) topVx = 3;
// Case 3a: Two positive distances and the last is within tolerance of zero.
if ( sqrSignedDistances[topVx - 1] > -sqrDistanceTolerance )
if ( topVx > 0 && sqrSignedDistances[topVx - 1] > -sqrDistanceTolerance )
{
return false;
}
@@ -1084,7 +1084,7 @@ int HexGridIntersectionTools::planeHexIntersectionMC( const cvf::Plane& plane
}
cvf::Vec3d edgeIntersections[12];
double normDistAlongEdge[12];
double normDistAlongEdge[12]{};
// Compute vertex coordinates on the edges where we have intersections
if ( cubeIdxToCutEdgeBitfield[cubeIndex] & 1 )

View File

@@ -108,7 +108,7 @@ public:
using MemberCallbackAndActiveFlag = std::pair<MemberCallback, bool>;
public:
Signal( const SignalEmitter* emitter )
explicit Signal( const SignalEmitter* emitter )
: m_emitter( emitter )
{
m_emitter->addEmittedSignal( this );

View File

@@ -123,9 +123,9 @@ function build_module {
TESTTHREADS=${TESTTHREADS:-1}
if test -z "$CTEST_CONFIGURATION"
then
ctest -T Test --no-compress-output -j$TESTTHREADS
ctest -T Test --no-compress-output -j$TESTTHREADS -LE "gpu_.*"
else
ctest -j$TESTTHREADS -C $CTEST_CONFIGURATION --timeout 5000 -T Test --no-compress-output
ctest -j$TESTTHREADS -C $CTEST_CONFIGURATION --timeout 5000 -T Test --no-compress-output -LE "gpu_.*"
fi
# Convert to junit format

View File

@@ -45,7 +45,10 @@ private:
void run_step(WellTestState& wtest_state, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, EclipseIO& io);
void run_step(WellTestState& wtest_state, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double dt, EclipseIO& io);
void output(WellTestState& wtest_state, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupAndNetworkValues& group_data, EclipseIO& io);
void output(const WellTestState& wtest_state, const UDQState& udq_state,
size_t report_step, bool substep, double seconds_elapsed,
const data::Solution& sol, const data::Wells& well_data,
const data::GroupAndNetworkValues& group_data, EclipseIO& io);
void simulate(data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double seconds_elapsed, double time_step);
EclipseState state;

View File

@@ -33,7 +33,6 @@
#include <opm/input/eclipse/Schedule/Action/SimulatorUpdate.hpp>
#include <opm/input/eclipse/Schedule/UDQ/UDQState.hpp>
#include <opm/input/eclipse/Schedule/UDQ/UDQConfig.hpp>
#include <opm/input/eclipse/Schedule/Well/PAvgCalculatorCollection.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/input/eclipse/Schedule/Well/WellMatcher.hpp>
#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
@@ -122,13 +121,19 @@ void msim::run_step(WellTestState& wtest_state, UDQState& udq_state, data::Solut
report_step,
seconds_elapsed,
well_data,
/* wbp = */ {},
group_nwrk_data,
{},
{},
{},
{});
/* sing_values = */ {},
/* initial_inplace = */ {},
/* inplace = */ {});
this->schedule.getUDQConfig( report_step ).eval(report_step, schedule.wellMatcher(report_step), this->st, udq_state);
this->schedule.getUDQConfig(report_step - 1)
.eval(report_step,
this->schedule,
this->schedule.wellMatcher(report_step),
this->schedule.segmentMatcherFactory(report_step),
this->st,
udq_state);
this->output(wtest_state,
udq_state,
@@ -144,7 +149,10 @@ void msim::run_step(WellTestState& wtest_state, UDQState& udq_state, data::Solut
void msim::output(WellTestState& wtest_state, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupAndNetworkValues& group_nwrk_data, EclipseIO& io) {
void msim::output(const WellTestState& wtest_state, const UDQState& udq_state,
size_t report_step, bool substep, double seconds_elapsed,
const data::Solution& sol, const data::Wells& well_data,
const data::GroupAndNetworkValues& group_nwrk_data, EclipseIO& io) {
RestartValue value(sol, well_data, group_nwrk_data, {});
io.writeTimeStep(this->action_state,
wtest_state,

View File

@@ -66,6 +66,13 @@ public:
: NumericalProblem(message)
{}
};
class TimeSteppingBreakdown : public NumericalProblem
{
public:
explicit TimeSteppingBreakdown(const std::string &message)
: NumericalProblem(message)
{}
};
}
#endif // OPM_EXCEPTIONS_HPP

View File

@@ -19,8 +19,27 @@
#ifndef OPM_TIMINGMACROS_HPP
#define OPM_TIMINGMACROS_HPP
// macros used to time blocks for example with tracy
// time block of main part of codes which do not effect performance
// This file defines macros
// OPM_TIMEBLOCK - time block of main part of codes which do not effect performance
// OPM_TIMEFUNCTION - time block of main part of codes which do not effect performance with name from function
// OPM_TIMEBLOCK_LOCAL - detailed timing which may effect performance
// OPM_TIMEFUNCTION_LOCAL - detailed timing which may effect performance with name from function
#ifndef DETAILED_PROFILING
#define DETAILED_PROFILING 0 // set to 1 to enable invasive profiling
#endif
#if USE_TRACY
#define TRACY_ENABLE 1
#include <tracy/Tracy.hpp>
#define OPM_TIMEBLOCK(blockname) ZoneNamedN(blockname, #blockname, true)
#define OPM_TIMEFUNCTION() ZoneNamedN(myname, __func__, true)
#if DETAILED_PROFILING
#define OPM_TIMEBLOCK_LOCAL(blockname) ZoneNamedN(blockname, #blockname, true)
#define OPM_TIMEFUNCTION_LOCAL() ZoneNamedN(myname, __func__, true)
#endif
#endif
#ifndef OPM_TIMEBLOCK
#define OPM_TIMEBLOCK(x)\
do { /* nothing */ } while (false)
@@ -32,4 +51,14 @@
do { /* nothing */ } while (false)
#endif
#ifndef OPM_TIMEFUNCTION
#define OPM_TIMEFUNCTION()\
do { /* nothing */ } while (false)
#endif
#ifndef OPM_TIMEFUNCTION_LOCAL
#define OPM_TIMEFUNCTION_LOCAL()\
do { /* nothing */ } while (false)
#endif
#endif // OPM_TIMINGMACROS_HPP

View File

@@ -20,11 +20,12 @@
#ifndef COMMON_UTIL_NUMERIC_CMP
#define COMMON_UTIL_NUMERIC_CMP
#include <cstddef>
#include <vector>
#include <type_traits>
#include <cmath>
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstring>
#include <type_traits>
#include <vector>
namespace Opm {
@@ -109,7 +110,7 @@ namespace Opm {
template<typename T>
bool array_equal(const T* p1, const T* p2, size_t num_elements, T abs_eps, T rel_eps) {
if (memcmp(p1 , p2 , num_elements * sizeof * p1) == 0)
if (std::memcmp(p1 , p2 , num_elements * sizeof * p1) == 0)
return true;
else {
size_t index;

View File

@@ -52,7 +52,7 @@ namespace Opm {
/// @brief
/// @todo Doc me!
/// @return
virtual std::string getTag() const {return ID_xmltag__param;}
std::string getTag() const override { return ID_xmltag__param; }
/// @brief
/// @todo Doc me!
/// @param

View File

@@ -93,7 +93,7 @@ namespace Opm {
// From ParameterMapItem
virtual ~ParameterGroup();
virtual std::string getTag() const;
std::string getTag() const override;
/// \brief A constructor typically used to initialize a
/// ParameterGroup from command-line arguments.

View File

@@ -34,7 +34,7 @@ namespace Opm {
typedef std::vector< DeckItem >::const_iterator const_iterator;
DeckRecord() = default;
DeckRecord( std::vector< DeckItem >&& items, const bool check_for_duplicate_names = true );
explicit DeckRecord( std::vector< DeckItem >&& items, const bool check_for_duplicate_names = true );
static DeckRecord serializationTestObject();

View File

@@ -27,6 +27,7 @@
namespace Opm {
class Deck;
class ErrorGuard;
enum class Section {
RUNSPEC,
@@ -63,6 +64,7 @@ class DeckSection : public DeckView {
// the right order
static bool checkSectionTopology(const Deck& deck,
const Parser&,
ErrorGuard& errorGuard,
bool ensureKeywordSectionAffiliation = false);

View File

@@ -38,7 +38,7 @@ namespace Opm {
class DeckTree {
public:
DeckTree() = default;
DeckTree(const std::string&);
explicit DeckTree(const std::string&);
const std::string& parent(const std::string& fname) const;
bool includes(const std::string& parent_file, const std::string& include_file) const;

View File

@@ -33,7 +33,7 @@ public:
struct Iterator : public storage_type::iterator {
Iterator(storage_type::const_iterator inner_iter) :
explicit Iterator(storage_type::const_iterator inner_iter) :
inner(inner_iter)
{}

View File

@@ -124,7 +124,7 @@ namespace Opm {
AquiferCT() = default;
AquiferCT(const TableManager& tables, const Deck& deck);
AquiferCT(const std::vector<AquiferCT::AQUCT_data>& data);
explicit AquiferCT(const std::vector<AquiferCT::AQUCT_data>& data);
void loadFromRestart(const RestartIO::RstAquifer& rst,
const TableManager& tables);

View File

@@ -20,13 +20,15 @@
#ifndef OPM_NUMERICALAQUIFERS_HPP
#define OPM_NUMERICALAQUIFERS_HPP
#include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp>
#include <cstddef>
#include <map>
#include <unordered_map>
#include <vector>
#include <stddef.h>
#include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp>
namespace Opm {
class Deck;
class EclipseGrid;
@@ -46,6 +48,7 @@ namespace Opm {
bool operator==(const NumericalAquifers& other) const;
std::unordered_map<size_t, const NumericalAquiferCell*> allAquiferCells() const;
std::vector<std::size_t> allAquiferCellIds() const;
std::unordered_map<size_t, double> aquiferCellVolumes() const;

View File

@@ -28,11 +28,13 @@
#include <opm/input/eclipse/EclipseState/EclipseConfig.hpp>
#include <opm/input/eclipse/EclipseState/TracerConfig.hpp>
#include <opm/input/eclipse/EclipseState/MICPpara.hpp>
#include <opm/input/eclipse/EclipseState/WagHysteresisConfig.hpp>
#include <opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
#include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/input/eclipse/EclipseState/Grid/FaultCollection.hpp>
#include <opm/input/eclipse/EclipseState/Grid/NNC.hpp>
#include <opm/input/eclipse/EclipseState/Grid/TransMult.hpp>
#include <opm/input/eclipse/EclipseState/Grid/LgrCollection.hpp>
#include <opm/input/eclipse/EclipseState/Runspec.hpp>
#include <opm/input/eclipse/EclipseState/Tables/TableManager.hpp>
#include <opm/input/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp>
@@ -94,6 +96,9 @@ namespace Opm {
const EclipseConfig& cfg() const;
const GridDims& gridDims() const;
const LgrCollection& getLgrs() const;
bool hasInputLGR() const;
// the unit system used by the deck. note that it is rarely needed
// to convert units because internally to opm-parser everything is
// represented by SI units.
@@ -108,6 +113,7 @@ namespace Opm {
const AquiferConfig& aquifer() const;
const TracerConfig& tracer() const;
const MICPpara& getMICPpara() const;
const WagHysteresisConfig& getWagHysteresis() const;
void reset_actnum(const std::vector<int>& new_actnum);
void pruneDeactivatedAquiferConnections(const std::vector<std::size_t>& deactivated_cells);
@@ -129,6 +135,7 @@ namespace Opm {
serializer(m_deckUnitSystem);
serializer(m_inputNnc);
serializer(m_gridDims);
serializer(m_lgrs);
serializer(m_simulationConfig);
serializer(aquifer_config);
serializer(m_transMult);
@@ -136,6 +143,7 @@ namespace Opm {
serializer(m_title);
serializer(tracer_config);
serializer(m_micppara);
serializer(wag_hyst_config);
}
static bool rst_cmp(const EclipseState& full_state, const EclipseState& rst_state);
@@ -145,12 +153,13 @@ namespace Opm {
void initIOConfigPostSchedule(const Deck& deck);
void assignRunTitle(const Deck& deck);
void reportNumberOfActivePhases() const;
void initLgrs(const Deck& deck);
void conveyNumericalAquiferEffects();
void applyMULTXYZ();
void initFaults(const Deck& deck);
void initPara(const Deck& deck);
void setMULTFLT(const Opm::DeckSection& section);
void setMULTFLT(const Opm::DeckSection& section, bool edit = false);
void complainAboutAmbiguousKeyword(const Deck& deck,
const std::string& keywordName);
@@ -164,11 +173,13 @@ namespace Opm {
NNC m_inputNnc;
GridDims m_gridDims;
FieldPropsManager field_props;
LgrCollection m_lgrs;
SimulationConfig m_simulationConfig;
AquiferConfig aquifer_config;
TransMult m_transMult;
TracerConfig tracer_config;
MICPpara m_micppara;
WagHysteresisConfig wag_hyst_config;
std::string m_title{};
FaultCollection m_faults{};

View File

@@ -55,6 +55,7 @@ namespace Opm
{}
};
Carfin() = default;
explicit Carfin(const GridDims& gridDims,
IsActive isActive,
@@ -93,6 +94,15 @@ namespace Opm
int NY() const;
int NZ() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_dims);
serializer(m_offset);
serializer(m_end_offset);
serializer(name_grid);
}
private:
GridDims m_globalGridDims_{};
IsActive m_globalIsActive_{};

View File

@@ -31,6 +31,7 @@
#include <stdexcept>
#include <unordered_set>
#include <vector>
#include <map>
namespace Opm {
@@ -64,7 +65,8 @@ namespace Opm {
EclipseGrid(const EclipseGrid& src, const double* zcorn, const std::vector<int>& actnum);
EclipseGrid(size_t nx, size_t ny, size_t nz,
double dx = 1.0, double dy = 1.0, double dz = 1.0);
double dx = 1.0, double dy = 1.0, double dz = 1.0,
double top = 0.0);
explicit EclipseGrid(const GridDims& gd);
EclipseGrid(const std::array<int, 3>& dims ,
@@ -75,7 +77,7 @@ namespace Opm {
/// EclipseGrid ignores ACTNUM in Deck, and therefore needs ACTNUM
/// explicitly. If a null pointer is passed, every cell is active.
EclipseGrid(const Deck& deck, const int * actnum = nullptr);
explicit EclipseGrid(const Deck& deck, const int * actnum = nullptr);
static bool hasGDFILE(const Deck& deck);
static bool hasCylindricalKeywords(const Deck& deck);
@@ -254,12 +256,15 @@ namespace Opm {
std::vector<int> m_global_to_active;
// Numerical aquifer cells, needs to be active
std::unordered_set<size_t> m_aquifer_cells;
// Keep track of aquifer cell depths
std::map<size_t, double> m_aquifer_cell_depths;
// Radial grids need this for volume calculations.
std::optional<std::vector<double>> m_thetav;
std::optional<std::vector<double>> m_rv;
void updateNumericalAquiferCells(const Deck&);
double computeCellGeometricDepth(size_t globalIndex) const;
void initGridFromEGridFile(Opm::EclIO::EclFile& egridfile, std::string fileName);
void resetACTNUM( const int* actnum);

View File

@@ -19,22 +19,32 @@
#ifndef FIELDPROPS_HPP
#define FIELDPROPS_HPP
#include <limits>
#include <optional>
#include <string>
#include <unordered_set>
#include <vector>
#include <opm/input/eclipse/Deck/value_status.hpp>
#include <opm/input/eclipse/Deck/DeckSection.hpp>
#include <opm/input/eclipse/Units/UnitSystem.hpp>
#include <opm/input/eclipse/EclipseState/Grid/Box.hpp>
#include <opm/input/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp>
#include <opm/input/eclipse/EclipseState/Tables/TableManager.hpp>
#include <opm/input/eclipse/EclipseState/Runspec.hpp>
#include <opm/input/eclipse/EclipseState/Grid/Keywords.hpp>
#include <opm/input/eclipse/EclipseState/Grid/TranCalculator.hpp>
#include <opm/input/eclipse/EclipseState/Grid/FieldData.hpp>
#include <opm/input/eclipse/EclipseState/Grid/Keywords.hpp>
#include <opm/input/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp>
#include <opm/input/eclipse/EclipseState/Grid/TranCalculator.hpp>
#include <opm/input/eclipse/EclipseState/Runspec.hpp>
#include <opm/input/eclipse/EclipseState/Util/OrderedMap.hpp>
#include <opm/input/eclipse/EclipseState/Tables/TableManager.hpp>
#include <opm/input/eclipse/Units/UnitSystem.hpp>
#include <opm/input/eclipse/Deck/DeckSection.hpp>
#include <opm/input/eclipse/Deck/value_status.hpp>
#include <cstddef>
#include <limits>
#include <map>
#include <memory>
#include <optional>
#include <set>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
namespace Opm {
@@ -137,6 +147,12 @@ static const std::unordered_map<std::string, keyword_info<double>> double_keywor
{"THCOIL", keyword_info<double>{}.unit_string("Energy/AbsoluteTemperature*Length*Time")},
{"THCGAS", keyword_info<double>{}.unit_string("Energy/AbsoluteTemperature*Length*Time")},
{"THCWATER",keyword_info<double>{}.unit_string("Energy/AbsoluteTemperature*Length*Time")},
{"YMODULE", keyword_info<double>{}.unit_string("Giga*Pascal")},
{"PRATIO", keyword_info<double>{}.unit_string("1")},
{"BIOTCOEF", keyword_info<double>{}.unit_string("1")},
{"POELCOEF", keyword_info<double>{}.unit_string("1")},
{"THERMEXR", keyword_info<double>{}.unit_string("1/AbsoluteTemperature")},
{"THELCOEF", keyword_info<double>{}.unit_string("Pressure/AbsoluteTemperature")},
{"MULTX", keyword_info<double>{}.init(1.0).mult(true)},
{"MULTX-", keyword_info<double>{}.init(1.0).mult(true)},
{"MULTY", keyword_info<double>{}.init(1.0).mult(true)},
@@ -175,7 +191,11 @@ static const std::unordered_map<std::string, keyword_info<int>> int_keywords = {
}
namespace PROPS {
static const std::unordered_map<std::string, keyword_info<double>> double_keywords = {{"SWATINIT", keyword_info<double>{}}};
static const std::unordered_map<std::string, keyword_info<double>> double_keywords = {{"SWATINIT", keyword_info<double>{}},
{"PCG", keyword_info<double>{}.unit_string("Pressure")},
{"IPCG", keyword_info<double>{}.unit_string("Pressure")},
{"PCW", keyword_info<double>{}.unit_string("Pressure")},
{"IPCW", keyword_info<double>{}.unit_string("Pressure")}};
static const std::unordered_map<std::string, keyword_info<int>> int_keywords = {};
#define dirfunc(base) base, base "X", base "X-", base "Y", base "Y-", base "Z", base "Z-"
@@ -197,10 +217,6 @@ static const std::set<std::string> satfunc = {"SWLPC", "ISWLPC", "SGLPC", "ISGLP
dirfunc("ISOGCR"),
dirfunc("SWCR"),
dirfunc("ISWCR"),
dirfunc("PCW"),
dirfunc("IPCW"),
dirfunc("PCG"),
dirfunc("IPCG"),
dirfunc("KRW"),
dirfunc("IKRW"),
dirfunc("KRWR"),
@@ -216,21 +232,7 @@ static const std::set<std::string> satfunc = {"SWLPC", "ISWLPC", "SGLPC", "ISGLP
dirfunc("KRGR"),
dirfunc("IKRGR")};
static const std::map<std::string,std::string> sogcr_shift = {{"SOGCR", "SWL"},
{"SOGCRX", "SWLX"},
{"SOGCRX-", "SWLX-"},
{"SOGCRY", "SWLY"},
{"SOGCRY-", "SWLY-"},
{"SOGCRZ", "SWLZ"},
{"SOGCRZ-", "SWLZ-"},
{"ISOGCR", "ISWL"},
{"ISOGCRX", "ISWLX"},
{"ISOGCRX-", "ISWLX-"},
{"ISOGCRY", "ISWLY"},
{"ISOGCRY-", "ISWLY-"},
{"ISOGCRZ", "ISWLZ"},
{"ISOGCRZ-", "ISWLZ-"}};
#undef dirfunc
}
namespace REGIONS {
@@ -240,6 +242,7 @@ static const std::unordered_map<std::string, keyword_info<int>> int_keywords = {
{"FIPNUM", keyword_info<int>{}.init(1)},
{"IMBNUM", keyword_info<int>{}.init(1)},
{"OPERNUM", keyword_info<int>{}},
{"STRESSEQUILNUM", keyword_info<int>{}.init(1)},
{"MISCNUM", keyword_info<int>{}},
{"MISCNUM", keyword_info<int>{}},
{"PVTNUM", keyword_info<int>{}.init(1)},
@@ -294,6 +297,7 @@ static const std::unordered_map<std::string, keyword_info<int>> int_keywords = {
template <typename T>
keyword_info<T> global_kw_info(const std::string& name, bool allow_unsupported = false);
bool is_oper_keyword(const std::string& name);
} // end namespace keywords
} // end namespace FieldProps
@@ -323,8 +327,6 @@ public:
}
};
enum class GetStatus {
OK = 1,
INVALID_DATA = 2, // std::runtime_error
@@ -332,8 +334,6 @@ public:
NOT_SUPPPORTED_KEYWORD = 4 // std::logic_error
};
template<typename T>
struct FieldDataManager {
const std::string& keyword;
@@ -384,10 +384,9 @@ public:
};
/// Normal constructor for FieldProps.
FieldProps(const Deck& deck, const Phases& phases, const EclipseGrid& grid, const TableManager& table_arg);
/// Special case constructor used to process ACTNUM only.
FieldProps(const Deck& deck, const EclipseGrid& grid);
@@ -409,102 +408,121 @@ public:
template <typename T>
std::vector<std::string> keys() const;
template <typename T>
FieldDataManager<T> try_get(const std::string& keyword,
bool allow_unsupported=false) {
if (!allow_unsupported && !FieldProps::supported<T>(keyword))
return FieldDataManager<T>(keyword, GetStatus::NOT_SUPPPORTED_KEYWORD, nullptr);
const Fieldprops::FieldData<T> * field_data;
bool has0 = this->has<T>(keyword);
field_data = std::addressof(this->init_get<T>(keyword,
std::is_same<T,double>::value && allow_unsupported));
if (field_data->valid() || allow_unsupported)
return FieldDataManager<T>(keyword, GetStatus::OK, field_data);
if (!has0) {
this->erase<T>(keyword);
return FieldDataManager<T>(keyword, GetStatus::MISSING_KEYWORD, nullptr);
FieldDataManager<T>
try_get(const std::string& keyword, const bool allow_unsupported = false)
{
if (!allow_unsupported && !FieldProps::template supported<T>(keyword)) {
return { keyword, GetStatus::NOT_SUPPPORTED_KEYWORD, nullptr };
}
return FieldDataManager<T>(keyword, GetStatus::INVALID_DATA, nullptr);
}
const auto has0 = this->template has<T>(keyword);
const auto& field_data =
this->template init_get<T>(keyword, std::is_same<T,double>::value && allow_unsupported);
template <typename T>
const std::vector<T>& get(const std::string& keyword) {
const auto& data = this->try_get<T>(keyword);
return data.data();
if (field_data.valid() || allow_unsupported) {
// Note: FieldDataManager depends on init_get<>() producing a
// long-lived FieldData instance.
return { keyword, GetStatus::OK, &field_data };
}
if (! has0) {
this->template erase<T>(keyword);
return { keyword, GetStatus::MISSING_KEYWORD, nullptr };
}
return { keyword, GetStatus::INVALID_DATA, nullptr };
}
template <typename T>
std::vector<T> get_global(const std::string& keyword) {
const auto& managed_field_data = this->try_get<T>(keyword);
const std::vector<T>& get(const std::string& keyword)
{
return this->template try_get<T>(keyword).data();
}
template <typename T>
std::vector<T> get_global(const std::string& keyword)
{
const auto managed_field_data = this->template try_get<T>(keyword);
const auto& field_data = managed_field_data.field_data();
const auto& kw_info = Fieldprops::keywords::global_kw_info<T>(keyword);
if (kw_info.global)
return *field_data.global_data;
else
return this->global_copy(field_data.data, kw_info.scalar_init);
const auto& kw_info = Fieldprops::keywords::
template global_kw_info<T>(keyword);
return kw_info.global
? *field_data.global_data
: this->global_copy(field_data.data, kw_info.scalar_init);
}
template <typename T>
std::vector<T> get_copy(const std::string& keyword, bool global) {
bool has0 = this->has<T>(keyword);
const auto& field_data = this->try_get<T>(keyword).field_data();
std::vector<T> get_copy(const std::string& keyword, bool global)
{
const auto has0 = this->template has<T>(keyword);
// Recall: FieldDataManager::field_data() will throw various
// exception types if the 'status' is anything other than 'OK'.
//
// Get_copy() depends on this behaviour to not proceed to extracting
// values in such cases. In other words, get_copy() uses exceptions
// for control flow, and we cannot move this try_get() call into the
// 'has0' branch even though the actual 'field_data' object returned
// from try_get() is only needed/used there.
const auto& field_data = this->template try_get<T>(keyword).field_data();
if (has0) {
if (global)
return this->global_copy(field_data.data, field_data.kw_info.scalar_init);
else
return field_data.data;
} else {
if (global) {
const auto& kw_info = Fieldprops::keywords::global_kw_info<T>(keyword);
return this->global_copy(this->extract<T>(keyword), kw_info.scalar_init);
} else
return this->extract<T>(keyword);
return this->get_copy(field_data.data, field_data.kw_info.scalar_init, global);
}
const auto initial_value = Fieldprops::keywords::
template global_kw_info<T>(keyword).scalar_init;
return this->get_copy(this->template extract<T>(keyword), initial_value, global);
}
template <typename T>
std::vector<bool> defaulted(const std::string& keyword) {
const auto& field = this->init_get<T>(keyword);
std::vector<bool> defaulted(const std::string& keyword)
{
const auto& field = this->template init_get<T>(keyword);
std::vector<bool> def(field.size());
for (std::size_t i=0; i < def.size(); i++)
def[i] = value::defaulted( field.value_status[i]);
for (std::size_t i = 0; i < def.size(); ++i) {
def[i] = value::defaulted(field.value_status[i]);
}
return def;
}
template <typename T>
std::vector<T> global_copy(const std::vector<T>& data, const std::optional<T>& default_value) const {
T fill_value = default_value.has_value() ? *default_value : 0;
std::vector<T> global_copy(const std::vector<T>& data,
const std::optional<T>& default_value) const
{
const T fill_value = default_value.has_value() ? *default_value : 0;
std::vector<T> global_data(this->global_size, fill_value);
std::size_t i = 0;
for (std::size_t g = 0; g < this->global_size; g++) {
if (this->m_actnum[g]) {
global_data[g] = data[i];
i++;
++i;
}
}
return global_data;
}
std::size_t active_size;
std::size_t global_size;
std::size_t num_int() const {
std::size_t num_int() const
{
return this->int_data.size();
}
std::size_t num_double() const {
std::size_t num_double() const
{
return this->double_data.size();
}
@@ -534,6 +552,22 @@ private:
template <typename T>
std::vector<T> extract(const std::string& keyword);
template <typename T>
std::vector<T> get_copy(const std::vector<T>& x,
const std::optional<T>& initial_value,
const bool global) const
{
return (! global) ? x : this->global_copy(x, initial_value);
}
template <typename T>
std::vector<T> get_copy(std::vector<T>&& x,
const std::optional<T>& initial_value,
const bool global) const
{
return (! global) ? std::move(x) : this->global_copy(x, initial_value);
}
template <typename T>
void operate(const DeckRecord& record, Fieldprops::FieldData<T>& target_data, const Fieldprops::FieldData<T>& src_data, const std::vector<Box::cell_index>& index_list);
@@ -563,6 +597,8 @@ private:
void init_satfunc(const std::string& keyword, Fieldprops::FieldData<double>& satfunc);
void init_porv(Fieldprops::FieldData<double>& porv);
void init_tempi(Fieldprops::FieldData<double>& tempi);
std::string canonical_fipreg_name(const std::string& fipreg);
const std::string& canonical_fipreg_name(const std::string& fipreg) const;
const UnitSystem unit_system;
std::size_t nx,ny,nz;
@@ -578,6 +614,7 @@ private:
std::vector<MultregpRecord> multregp;
std::unordered_map<std::string, Fieldprops::FieldData<int>> int_data;
std::unordered_map<std::string, Fieldprops::FieldData<double>> double_data;
std::unordered_map<std::string, std::string> fipreg_shortname_translation{};
std::unordered_map<std::string,Fieldprops::TranCalculator> tran;
};

View File

@@ -69,6 +69,7 @@ public:
bool operator==(const FieldPropsManager& other) const;
static bool rst_cmp(const FieldPropsManager& full_arg, const FieldPropsManager& rst_arg);
/*
Because the FieldProps class can autocreate properties the semantics of
get() and has() is slightly non intuitve:
@@ -136,8 +137,8 @@ public:
contain said keyword, or if the keyword has not been fully initialized. If
you ask for a totally unknown keyword the method will return nullptr.
*/
template <typename T> const std::vector<T>* try_get(const
std::string& keyword) const;
template <typename T>
const std::vector<T>* try_get(const std::string& keyword) const;
/*
You can ask whether the elements in the keyword have a default value -

View File

@@ -0,0 +1,65 @@
/*
Copyright (C) 2023 Equinor
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_PARSER_LGR_COLLECTION_HPP
#define OPM_PARSER_LGR_COLLECTION_HPP
#include <string>
#include <opm/input/eclipse/EclipseState/Util/OrderedMap.hpp>
#include <opm/input/eclipse/EclipseState/Grid/CarfinManager.hpp>
#include <opm/input/eclipse/EclipseState/Grid/Carfin.hpp>
#include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp>
namespace Opm {
class DeckRecord;
class GridDims;
class GRIDSection;
class LgrCollection {
public:
LgrCollection();
LgrCollection(const GRIDSection& gridSection, const EclipseGrid& grid);
static LgrCollection serializationTestObject();
explicit LgrCollection(const Deck& deck);
size_t size() const;
bool hasLgr(const std::string& lgrName) const;
Carfin& getLgr(const std::string& lgrName);
const Carfin& getLgr(const std::string& lgrName) const;
Carfin& getLgr(size_t lgrIndex);
const Carfin& getLgr(size_t lgrIndex) const;
void addLgr(const EclipseGrid& grid, const DeckRecord& lgrRecord);
bool operator==(const LgrCollection& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_lgrs);
}
private:
OrderedMap<Carfin, 8> m_lgrs;
};
}
#endif // OPM_PARSER_LGR_COLLECTION_HPP

View File

@@ -17,23 +17,31 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_PARSER_MULTREGTSCANNER_HPP
#define OPM_PARSER_MULTREGTSCANNER_HPP
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
#include <cstddef>
#include <map>
#include <string>
#include <utility>
#include <vector>
namespace Opm {
class DeckRecord;
class DeckKeyword;
class FieldPropsManager;
class GridDims;
} // namespace Opm
namespace Opm {
namespace MULTREGT {
enum NNCBehaviourEnum {
enum class NNCBehaviourEnum
{
NNC = 1,
NONNC = 2,
ALL = 3,
@@ -42,12 +50,10 @@ namespace Opm {
std::string RegionNameFromDeckValue(const std::string& stringValue);
NNCBehaviourEnum NNCBehaviourFromString(const std::string& stringValue);
}
} // namespace MULTREGT
struct MULTREGTRecord {
struct MULTREGTRecord
{
int src_value;
int target_value;
double trans_mult;
@@ -55,13 +61,15 @@ namespace Opm {
MULTREGT::NNCBehaviourEnum nnc_behaviour;
std::string region_name;
bool operator==(const MULTREGTRecord& data) const {
return src_value == data.src_value &&
target_value == data.target_value &&
trans_mult == data.trans_mult &&
directions == data.directions &&
nnc_behaviour == data.nnc_behaviour &&
region_name == data.region_name;
bool operator==(const MULTREGTRecord& data) const
{
return (src_value == data.src_value)
&& (target_value == data.target_value)
&& (trans_mult == data.trans_mult)
&& (directions == data.directions)
&& (nnc_behaviour == data.nnc_behaviour)
&& (region_name == data.region_name)
;
}
template<class Serializer>
@@ -76,58 +84,62 @@ namespace Opm {
}
};
typedef std::map< std::pair<int , int> , const MULTREGTRecord * > MULTREGTSearchMap;
typedef std::tuple<size_t , FaceDir::DirEnum , double> MULTREGTConnection;
class MULTREGTScanner {
class MULTREGTScanner
{
public:
using ExternalSearchMap = std::map<std::string, std::map<std::pair<int,int>, int>>;
MULTREGTScanner() = default;
MULTREGTScanner(const MULTREGTScanner& data);
MULTREGTScanner(const GridDims& grid,
const FieldPropsManager* fp_arg,
const std::vector< const DeckKeyword* >& keywords);
const std::vector<const DeckKeyword*>& keywords);
static MULTREGTScanner serializationTestObject();
double getRegionMultiplier(size_t globalCellIdx1, size_t globalCellIdx2, FaceDir::DirEnum faceDir) const;
bool operator==(const MULTREGTScanner& data) const;
MULTREGTScanner& operator=(const MULTREGTScanner& data);
template<class Serializer>
void applyNumericalAquifer(const std::vector<std::size_t>& aquifer_cells);
double getRegionMultiplier(std::size_t globalCellIdx1,
std::size_t globalCellIdx2,
FaceDir::DirEnum faceDir) const;
double getRegionMultiplierNNC(std::size_t globalCellIdx1,
std::size_t globalCellIdx2) const;
template <class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(nx);
serializer(ny);
serializer(nz);
serializer(gridDims);
serializer(m_records);
ExternalSearchMap searchMap = getSearchMap();
serializer(searchMap);
if (m_searchMap.empty())
constructSearchMap(searchMap);
serializer(m_searchMap);
serializer(regions);
serializer(default_region);
serializer(aquifer_cells);
}
private:
ExternalSearchMap getSearchMap() const;
void constructSearchMap(const ExternalSearchMap& searchMap);
using MULTREGTSearchMap = std::map<
std::pair<int, int>,
std::vector<MULTREGTRecord>::size_type
>;
void addKeyword( const DeckKeyword& deckKeyword, const std::string& defaultRegion);
GridDims gridDims{};
const FieldPropsManager* fp{nullptr};
std::vector<MULTREGTRecord> m_records{};
std::map<std::string, MULTREGTSearchMap> m_searchMap{};
std::map<std::string, std::vector<int>> regions{};
std::vector<std::size_t> aquifer_cells{};
void addKeyword(const DeckKeyword& deckKeyword);
void assertKeywordSupported(const DeckKeyword& deckKeyword);
std::size_t nx = 0,ny = 0, nz = 0;
const FieldPropsManager* fp = nullptr;
std::vector< MULTREGTRecord > m_records;
std::map<std::string , MULTREGTSearchMap> m_searchMap;
std::map<std::string, std::vector<int>> regions;
std::string default_region;
bool isAquNNC(std::size_t globalCellIdx1, std::size_t globalCellIdx2) const;
bool isAquCell(std::size_t globalCellIdx) const;
};
}
} // namespace Opm
#endif // OPM_PARSER_MULTREGTSCANNER_HPP

View File

@@ -56,9 +56,11 @@ namespace Opm {
double getMultiplier(size_t globalIndex, FaceDir::DirEnum faceDir) const;
double getMultiplier(size_t i , size_t j , size_t k, FaceDir::DirEnum faceDir) const;
double getRegionMultiplier( size_t globalCellIndex1, size_t globalCellIndex2, FaceDir::DirEnum faceDir) const;
double getRegionMultiplierNNC(std::size_t globalCellIndex1, std::size_t globalCellIndex2) const;
void applyMULT(const std::vector<double>& srcMultProp, FaceDir::DirEnum faceDir);
void applyMULTFLT(const FaultCollection& faults);
void applyMULTFLT(const Fault& fault);
void applyNumericalAquifer(const std::vector<std::size_t>& aquifer_cells);
bool operator==(const TransMult& data) const;

View File

@@ -6,8 +6,21 @@
namespace Opm {
class DeckKeyword;
class DeckRecord;
class EquilRecord {
public:
EquilRecord() = default;
EquilRecord(double datum_depth_arg, double datum_depth_pc_arg,
double woc_depth, double woc_pc,
double goc_depth, double goc_pc,
bool live_oil_init,
bool wet_gas_init,
int target_accuracy,
bool humid_gas_init);
explicit EquilRecord(const DeckRecord& record);
static EquilRecord serializationTestObject();
double datumDepth() const;
double datumDepthPressure() const;
double waterOilContactDepth() const;
@@ -20,10 +33,6 @@ namespace Opm {
int initializationTargetAccuracy() const;
bool humidGasInitConstantRvw() const;
EquilRecord();
EquilRecord( double datum_depth_arg, double datum_depth_pc_arg, double woc_depth, double woc_pc, double goc_depth, double goc_pc, bool live_oil_init, bool wet_gas_init, int target_accuracy, bool humid_gas_init);
bool operator==(const EquilRecord& data) const;
template<class Serializer>
@@ -42,29 +51,75 @@ namespace Opm {
}
private:
double datum_depth;
double datum_depth_ps;
double water_oil_contact_depth;
double water_oil_contact_capillary_pressure;
double gas_oil_contact_depth;
double gas_oil_contact_capillary_pressure;
double datum_depth = 0.0;
double datum_depth_ps = 0.0;
double water_oil_contact_depth = 0.0;
double water_oil_contact_capillary_pressure = 0.0;
double gas_oil_contact_depth = 0.0;
double gas_oil_contact_capillary_pressure = 0.0;
bool live_oil_init_proc;
bool wet_gas_init_proc;
int init_target_accuracy;
bool humid_gas_init_proc;
bool live_oil_init_proc = false;
bool wet_gas_init_proc = false;
int init_target_accuracy = 0;
bool humid_gas_init_proc = false;
};
class Equil {
class StressEquilRecord {
public:
using const_iterator = std::vector< EquilRecord >::const_iterator;
StressEquilRecord() = default;
explicit StressEquilRecord(const DeckRecord& record);
Equil() = default;
explicit Equil( const DeckKeyword& );
static StressEquilRecord serializationTestObject();
static Equil serializationTestObject();
bool operator==(const StressEquilRecord& data) const;
const EquilRecord& getRecord( size_t id ) const;
double datumDepth() const;
double datumPosX() const;
double datumPosY() const;
double stressXX() const;
double stressXX_grad() const;
double stressYY() const;
double stressYY_grad() const;
double stressZZ() const;
double stressZZ_grad() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(datum_depth);
serializer(datum_posx);
serializer(datum_posy);
serializer(stress_xx);
serializer(stress_xx_grad);
serializer(stress_yy);
serializer(stress_yy_grad);
serializer(stress_zz);
serializer(stress_zz_grad);
}
private:
double datum_depth = 0.0;
double datum_posx = 0.0;
double datum_posy = 0.0;
double stress_xx = 0.0;
double stress_xx_grad = 0.0;
double stress_yy = 0.0;
double stress_yy_grad = 0.0;
double stress_zz = 0.0;
double stress_zz_grad = 0.0;
};
template<class RecordType>
class EquilContainer {
public:
using const_iterator = typename std::vector<RecordType>::const_iterator;
EquilContainer() = default;
explicit EquilContainer( const DeckKeyword& );
static EquilContainer serializationTestObject();
const RecordType& getRecord(std::size_t id) const;
size_t size() const;
bool empty() const;
@@ -72,7 +127,7 @@ namespace Opm {
const_iterator begin() const;
const_iterator end() const;
bool operator==(const Equil& data) const;
bool operator==(const EquilContainer& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
@@ -81,9 +136,11 @@ namespace Opm {
}
private:
std::vector< EquilRecord > m_records;
std::vector<RecordType> m_records;
};
using Equil = EquilContainer<EquilRecord>;
using StressEquil = EquilContainer<StressEquilRecord>;
}
#endif //OPM_EQUIL_HPP

View File

@@ -45,6 +45,9 @@ namespace Opm {
bool hasEquil() const;
const Equil& getEquil() const;
bool hasStressEquil() const;
const StressEquil& getStressEquil() const;
bool hasGravity() const;
bool hasFoamConfig() const;
@@ -64,6 +67,7 @@ namespace Opm {
void serializeOp(Serializer& serializer)
{
serializer(equil);
serializer(stress_equil);
serializer(foamconfig);
serializer(m_filleps);
serializer(m_gravity);
@@ -74,6 +78,7 @@ namespace Opm {
private:
Equil equil;
StressEquil stress_equil;
FoamConfig foamconfig;
bool m_filleps;
bool m_gravity = true;

View File

@@ -31,7 +31,6 @@
#include <string>
namespace Opm {
class Deck;
class Phases {
@@ -95,7 +94,8 @@ public:
return this->nDynWlistMax;
}
const std::optional<KeywordLocation>& location() const {
const std::optional<KeywordLocation>& location() const
{
return this->m_location;
}
@@ -113,7 +113,6 @@ public:
rst_cmp(*this, data);
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
@@ -143,7 +142,6 @@ public:
static WellSegmentDims serializationTestObject();
int maxSegmentedWells() const
{
return this->nSegWellMax;
@@ -159,6 +157,11 @@ public:
return this->nLatBranchMax;
}
const std::optional<KeywordLocation>& location() const
{
return this->location_;
}
bool operator==(const WellSegmentDims& data) const;
template<class Serializer>
@@ -167,12 +170,14 @@ public:
serializer(nSegWellMax);
serializer(nSegmentMax);
serializer(nLatBranchMax);
serializer(location_);
}
private:
int nSegWellMax;
int nSegmentMax;
int nLatBranchMax;
std::optional<KeywordLocation> location_;
};
class NetworkDims {
@@ -294,6 +299,11 @@ public:
*/
double curvatureCapPrs() const;
/*!
* \brief Wag hysteresis.
*/
bool activeWag() const;
bool operator==(const EclHysterConfig& data) const;
template<class Serializer>
@@ -304,6 +314,7 @@ public:
serializer(krHystMod);
serializer(modParamTrappedValue);
serializer(curvatureCapPrsValue);
serializer(activeWagHyst);
}
private:
@@ -317,6 +328,9 @@ private:
double modParamTrappedValue { 0.1 };
// curvature parameter for capillary pressure
double curvatureCapPrsValue { 0.1 };
// enable WAG hysteresis
bool activeWagHyst { false };
};
class SatFuncControls {
@@ -329,8 +343,9 @@ public:
enum class KeywordFamily {
Family_I, // SGOF, SWOF, SLGOF
Family_II, // SGFN, SOF{2,3}, SWFN
Family_III, // GSF, WSF
Family_II, // SGFN, SOF{2,3}, SWFN, SGWFN
Family_III, // GSF, WSF
Undefined,
};
@@ -455,7 +470,9 @@ public:
const Nupcol& nupcol() const noexcept;
const Tracers& tracers() const;
bool co2Storage() const noexcept;
bool h2Storage() const noexcept;
bool micp() const noexcept;
bool mech() const noexcept;
bool operator==(const Runspec& data) const;
static bool rst_cmp(const Runspec& full_state, const Runspec& rst_state);
@@ -478,7 +495,9 @@ public:
serializer(m_sfuncctrl);
serializer(m_nupcol);
serializer(m_co2storage);
serializer(m_h2storage);
serializer(m_micp);
serializer(m_mech);
}
private:
@@ -498,7 +517,9 @@ private:
Nupcol m_nupcol;
Tracers m_tracers;
bool m_co2storage;
bool m_h2storage;
bool m_micp;
bool m_mech;
};

View File

@@ -33,59 +33,34 @@ namespace Opm {
class Deck;
class DeckRecord;
enum class BCType {
RATE,
FREE,
DIRICHLET,
THERMAL
};
enum class BCComponent {
OIL,
GAS,
WATER,
SOLVENT,
POLYMER,
NONE
};
class BCConfig {
public:
struct BCFace {
struct BCRegion {
int index;
int i1,i2;
int j1,j2;
int k1,k2;
BCType bctype;
FaceDir::DirEnum dir;
BCComponent component;
double rate;
std::optional<double> pressure;
std::optional<double> temperature;
BCFace() = default;
explicit BCFace(const DeckRecord& record, const GridDims& grid);
BCRegion() = default;
explicit BCRegion(const DeckRecord& record, const GridDims& grid);
static BCFace serializationTestObject();
static BCRegion serializationTestObject();
bool operator==(const BCFace& other) const;
bool operator==(const BCRegion& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(index);
serializer(i1);
serializer(i2);
serializer(j1);
serializer(j2);
serializer(k1);
serializer(k2);
serializer(bctype);
serializer(dir);
serializer(component);
serializer(rate);
serializer(pressure);
serializer(temperature);
}
};
@@ -96,8 +71,8 @@ public:
static BCConfig serializationTestObject();
std::size_t size() const;
std::vector<BCFace>::const_iterator begin() const;
std::vector<BCFace>::const_iterator end() const;
std::vector<BCRegion>::const_iterator begin() const;
std::vector<BCRegion>::const_iterator end() const;
bool operator==(const BCConfig& other) const;
template<class Serializer>
@@ -107,7 +82,7 @@ public:
}
private:
std::vector<BCFace> m_faces;
std::vector<BCRegion> m_faces;
};
} //namespace Opm

View File

@@ -20,6 +20,7 @@
#ifndef OPM_ROCK_CONFIG_HPP
#define OPM_ROCK_CONFIG_HPP
#include <cstddef>
#include <string>
#include <vector>
@@ -28,36 +29,36 @@ namespace Opm {
class Deck;
class FieldPropsManager;
class RockConfig {
class RockConfig
{
public:
enum class Hysteresis {
REVERS = 1,
IRREVERS = 2,
HYSTER = 3,
BOBERG = 4,
REVLIMIT = 5,
PALM_MAN = 6,
NONE = 7
};
struct RockComp {
double pref;
double compressibility;
RockComp() = default;
RockComp(double pref_arg, double comp_arg);
bool operator==(const RockComp& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
enum class Hysteresis
{
serializer(pref);
serializer(compressibility);
}
};
REVERS = 1,
IRREVERS = 2,
HYSTER = 3,
BOBERG = 4,
REVLIMIT = 5,
PALM_MAN = 6,
NONE = 7,
};
struct RockComp
{
double pref{};
double compressibility{};
RockComp() = default;
RockComp(double pref_arg, double comp_arg);
bool operator==(const RockComp& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(pref);
serializer(compressibility);
}
};
RockConfig();
RockConfig(const Deck& deck, const FieldPropsManager& fp);
@@ -95,4 +96,4 @@ private:
} //namespace Opm
#endif
#endif // OPM_ROCK_CONFIG_HPP

View File

@@ -96,12 +96,6 @@ struct GravityTable : public FlatTableWithCopy<GRAVITYRecord>
{
return GravityTable({{1.0, 2.0, 3.0}});
}
template <class Serializer>
void serializeOp(Serializer& serializer)
{
FlatTableWithCopy::serializeOp(serializer);
}
};
struct DENSITYRecord {
@@ -137,12 +131,6 @@ struct DensityTable : public FlatTableWithCopy<DENSITYRecord>
{
return DensityTable({{1.0, 2.0, 3.0}});
}
template <class Serializer>
void serializeOp(Serializer& serializer)
{
FlatTableWithCopy::serializeOp(serializer);
}
};
struct DiffCoeffRecord {
@@ -286,12 +274,6 @@ struct PvtwTable : public FlatTableWithCopy<PVTWRecord>
{
return PvtwTable({{1.0, 2.0, 3.0, 4.0, 5.0}});
}
template <class Serializer>
void serializeOp(Serializer& serializer)
{
FlatTableWithCopy::serializeOp(serializer);
}
};
struct ROCKRecord {
@@ -313,8 +295,11 @@ struct ROCKRecord {
}
};
struct RockTable : public FlatTable< ROCKRecord > {
using FlatTable< ROCKRecord >::FlatTable;
struct RockTable : public FlatTableWithCopy<ROCKRecord>
{
RockTable() = default;
explicit RockTable(const DeckKeyword& kw);
explicit RockTable(std::initializer_list<ROCKRecord> records);
static RockTable serializationTestObject()
{

View File

@@ -24,15 +24,14 @@
namespace Opm {
class Deck;
class DeckItem;
class GasvisctTable : public SimpleTable {
public:
GasvisctTable( const Deck& deck, const DeckItem& deckItem );
GasvisctTable( const DeckItem& item, const int tableID );
const TableColumn& getTemperatureColumn() const;
const TableColumn& getGasViscosityColumn(size_t compIdx) const;
const TableColumn& getGasViscosityColumn() const;
};
}

View File

@@ -28,7 +28,7 @@ namespace Opm {
class PlymaxTable : public SimpleTable {
public:
PlymaxTable( const DeckRecord& record );
explicit PlymaxTable(const DeckRecord& record);
const TableColumn& getPolymerConcentrationColumn() const;
const TableColumn& getMaxPolymerConcentrationColumn() const;

View File

@@ -23,13 +23,13 @@
namespace Opm {
class DeckReckord;
class DeckRecord;
class PlyrockTable : public SimpleTable {
public:
// This is not really a table; every column has only one element.
PlyrockTable( const DeckRecord& record );
explicit PlyrockTable(const DeckRecord& record);
// since this keyword is not necessarily monotonic, it cannot be evaluated!
//using SimpleTable::evaluate;

View File

@@ -0,0 +1,79 @@
/*
Copyright (C) 2023 Equinor
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 PPCWMAX_HPP
#define PPCWMAX_HPP
#include <cstddef>
#include <vector>
namespace Opm {
class Deck;
struct PpcwmaxRecord {
double max_cap_pres;
bool option;
PpcwmaxRecord() = default;
PpcwmaxRecord(double pres, bool optn) :
max_cap_pres(pres),
option(optn)
{};
bool operator==(const PpcwmaxRecord& other) const {
return this->max_cap_pres == other.max_cap_pres &&
this->option == other.option;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(max_cap_pres);
serializer(option);
}
};
class Ppcwmax {
public:
Ppcwmax() = default;
explicit Ppcwmax(const Deck& deck);
explicit Ppcwmax(std::initializer_list<PpcwmaxRecord> records);
static Ppcwmax serializationTestObject();
std::size_t size() const;
bool empty() const;
std::vector< PpcwmaxRecord >::const_iterator begin() const;
std::vector< PpcwmaxRecord >::const_iterator end() const;
const PpcwmaxRecord& operator[](const std::size_t index) const;
bool operator==(const Ppcwmax& other) const {
return this->data == other.data;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(data);
}
private:
std::vector<PpcwmaxRecord> data;
};
}
#endif

View File

@@ -57,6 +57,7 @@
#include <opm/input/eclipse/EclipseState/Tables/Eqldims.hpp>
#include <opm/input/eclipse/EclipseState/Tables/Regdims.hpp>
#include <opm/input/eclipse/EclipseState/Tables/TLMixpar.hpp>
#include <opm/input/eclipse/EclipseState/Tables/Ppcwmax.hpp>
namespace Opm {
@@ -78,6 +79,7 @@ namespace Opm {
const Aqudims& getAqudims() const;
const Regdims& getRegdims() const;
const TLMixpar& getTLMixpar() const;
const Ppcwmax& getPpcwmax() const;
/*
WIll return max{ Tabdims::NTFIP , Regdims::NTFIP }.
*/
@@ -260,6 +262,7 @@ namespace Opm {
serializer(m_rtemp);
serializer(m_salinity);
serializer(m_tlmixpar);
serializer(m_ppcwmax);
if (!serializer.isSerializing()) {
m_simpleTables = simpleTables;
if (split.plyshMax > 0) {
@@ -289,7 +292,6 @@ namespace Opm {
void initRTempTables(const Deck& deck);
void initDims(const Deck& deck);
void initRocktabTables(const Deck& deck);
void initGasvisctTables(const Deck& deck);
void initPlymaxTables(const Deck& deck);
void initPlyrockTables(const Deck& deck);
@@ -392,6 +394,7 @@ namespace Opm {
Eqldims m_eqldims;
Aqudims m_aqudims;
TLMixpar m_tlmixpar;
Ppcwmax m_ppcwmax;
bool hasImptvd = false;// if deck has keyword IMPTVD
bool hasEnptvd = false;// if deck has keyword ENPTVD

View File

@@ -20,14 +20,19 @@
#ifndef OPM_ORDERED_MAP_HPP
#define OPM_ORDERED_MAP_HPP
#include <unordered_map>
#include <vector>
#include <string>
#include <stdexcept>
#include <algorithm>
#include <cctype>
#include <cstddef>
#include <functional>
#include <iterator>
#include <set>
#include <cctype>
#include <algorithm>
#include <stdexcept>
#include <string>
#include <string_view>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
namespace Opm {
@@ -68,11 +73,11 @@ findSimilarStrings(std::string str,
return concatedStr.substr(0, concatedStr.size()-2);
}
template<std::size_t MAX_CHARS>
template<std::string_view::size_type MAX_CHARS>
class TruncatedStringHash
{
public:
std::size_t operator()(const std::string_view& key) const
std::size_t operator()(std::string_view key) const
{
return hasher(key.substr(0, MAX_CHARS));
}
@@ -82,13 +87,13 @@ private:
template<>
class TruncatedStringHash<std::string::npos> : public std::hash<std::string_view>
class TruncatedStringHash<std::string_view::npos> : public std::hash<std::string_view>
{};
template<std::size_t MAX_CHARS>
template<std::string_view::size_type MAX_CHARS>
struct TruncatedStringEquals
{
bool operator()(const std::string& str1, const std::string& str2) const
bool operator()(std::string_view str1, std::string_view str2) const
{
return str1.substr(0, MAX_CHARS) == str2.substr(0, MAX_CHARS);
}
@@ -102,21 +107,23 @@ struct TruncatedStringEquals<std::string::npos> : public std::equal_to<std::stri
/// \brief A map with iteration in the order of insertion.
///
/// Each entry has an associated index indicating when a value with that key was
/// first inserted. When itering over it's entries values with lower insertion index
/// are traversed before ones with an higher insertion index.
/// Each entry has an associated index indicating when a value with that key
/// was first inserted. When iterating over the entries, elements with a
/// lower insertion index are traversed before elements with a higher
/// insertion index.
///
/// \tparam MAX_CHARS The maximum number of characters that are use a keys. Default is
/// std::string::npos, which honors all characters. Any keys with the
/// \tparam T Element type. The map's value type is \code pair<string, T> \endcode.
///
/// \tparam MAX_CHARS Maximum number of characters used in key comparisons.
/// Default value honors all characters. Keys with the
/// same first MAX_CHARS characters are considered equal.
///
template <typename T, std::size_t MAX_CHARS = std::string::npos>
template <typename T, std::string_view::size_type MAX_CHARS = std::string_view::npos>
class OrderedMap {
public:
using storage_type = typename std::vector<std::pair<std::string,T>>;
using index_type = typename std::unordered_map<std::string,std::size_t,
Opm::OrderedMapDetail::TruncatedStringHash<MAX_CHARS>,
Opm::OrderedMapDetail::TruncatedStringEquals<MAX_CHARS>>;
using storage_type = std::vector<std::pair<std::string, T>>;
using index_type = std::unordered_map<std::string, typename storage_type::size_type,
OrderedMapDetail::TruncatedStringHash<MAX_CHARS>,
OrderedMapDetail::TruncatedStringEquals<MAX_CHARS>>;
using iter_type = typename storage_type::iterator;
using const_iter_type = typename storage_type::const_iterator;

View File

@@ -0,0 +1,143 @@
/*
Copyright 2023 Equinor.
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_PARSER_WAGHYSTERSISCONFIG_HPP
#define OPM_PARSER_WAGHYSTERSISCONFIG_HPP
namespace Opm {
class Deck;
class DeckRecord;
class WagHysteresisConfig {
public:
struct WagHysteresisConfigRecord {
private:
// WAG hysteresis Lands parameter
double wagLandsParamValue { 1.0 };
// WAG hysteresis reduction factor
double wagSecondaryDrainageReductionValue { 0.0 };
// WAG gas model flag
bool wagGasFlagValue { true };
// WAG residual oil model flag
bool wagResidualOilFlagValue { false };
// WAG water model flag
bool wagWaterFlagValue { false };
// WAG hysteresis linear fraction
double wagImbCurveLinearFractionValue { 0.1 };
// WAG hysteresis 3-phase threshold
double wagWaterThresholdSaturationValue { 0.001 };
public:
WagHysteresisConfigRecord() = default;
explicit WagHysteresisConfigRecord(const DeckRecord& record);
double wagLandsParam() const {
return wagLandsParamValue;
}
double wagSecondaryDrainageReduction() const {
return wagSecondaryDrainageReductionValue;
}
bool wagGasFlag() const {
return wagGasFlagValue;
}
bool wagResidualOilFlag() const {
return wagResidualOilFlagValue;
}
bool wagWaterFlag() const {
return wagWaterFlagValue;
}
double wagImbCurveLinearFraction() const {
return wagImbCurveLinearFractionValue;
}
double wagWaterThresholdSaturation() const {
return wagWaterThresholdSaturationValue;
}
bool operator==(const WagHysteresisConfigRecord& data) const
{
return this->wagLandsParam() == data.wagLandsParam() &&
this->wagSecondaryDrainageReduction() == data.wagSecondaryDrainageReduction() &&
this->wagGasFlag() == data.wagGasFlag() &&
this->wagResidualOilFlag() == data.wagResidualOilFlag() &&
this->wagWaterFlag() == data.wagWaterFlag() &&
this->wagImbCurveLinearFraction() == data.wagImbCurveLinearFraction() &&
this->wagWaterThresholdSaturation() == data.wagWaterThresholdSaturation();
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(wagLandsParamValue);
serializer(wagSecondaryDrainageReductionValue);
serializer(wagGasFlagValue);
serializer(wagResidualOilFlagValue);
serializer(wagWaterFlagValue);
serializer(wagImbCurveLinearFractionValue);
serializer(wagWaterThresholdSaturationValue);
}
static WagHysteresisConfigRecord serializationTestObject()
{
WagHysteresisConfigRecord result;
result.wagLandsParamValue = 0;
result.wagSecondaryDrainageReductionValue = 1;
result.wagGasFlagValue = true;
result.wagResidualOilFlagValue = false;
result.wagWaterFlagValue = false;
result.wagImbCurveLinearFractionValue = 2;
result.wagWaterThresholdSaturationValue = 3;
return result;
}
};
WagHysteresisConfig();
explicit WagHysteresisConfig(const Deck& deck);
size_t size() const;
bool empty() const;
const std::vector<WagHysteresisConfigRecord>::const_iterator begin() const;
const std::vector<WagHysteresisConfigRecord>::const_iterator end() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(wagrecords);
}
bool operator==(const WagHysteresisConfig& other) const;
const WagHysteresisConfigRecord& operator[](std::size_t index) const;
private:
std::vector<WagHysteresisConfigRecord> wagrecords;
};
}
#endif // OPM_PARSER_WAGHYSTERSISCONFIG_HPP

View File

@@ -30,7 +30,7 @@ namespace Opm {
class KeywordGenerator {
public:
KeywordGenerator(bool verbose);
explicit KeywordGenerator(bool verbose);
static void ensurePath( const std::string& file_name);
static std::string endTest();

View File

@@ -218,6 +218,18 @@ class KeywordLocation;
/// RUNSPEC keyword WELLDIMS (item 4).
const static std::string RUNSPEC_GROUPSIZE_TOO_LARGE;
/// Dynamic number of multi-segmented wells exceeds maximum declared
/// in RUNSPEC keyword WSEGDIMS (item 1).
const static std::string RUNSPEC_NUMMSW_TOO_LARGE;
/// Dynamic number of segments per MS well exceeds maximum declared
/// in RUNSPEC keyword WSEGDIMS (item 2).
const static std::string RUNSPEC_NUMSEG_PER_WELL_TOO_LARGE;
/// Dynamic number of branches exceeds maximum number declared in
/// RUNSPEC keyword WSEGDIMS (item 3).
const static std::string RUNSPEC_NUMBRANCH_TOO_LARGE;
/*
Should we allow keywords of length more than eight characters? If the
keyword is too long it will be internalized using only the eight first
@@ -302,6 +314,14 @@ class KeywordLocation;
*/
const static std::string ACTIONX_ILLEGAL_KEYWORD;
/*
Error flag marking parser errors ic ACTIONX conditions
*/
const static std::string ACTIONX_CONDITION_ERROR;
/*
Error flag marking that an ACTIONX has no condition
*/
const static std::string ACTIONX_NO_CONDITION;
/*
The RPTSCH, RPTSOL and RPTSCHED keywords have two alternative forms,
@@ -339,6 +359,7 @@ class KeywordLocation;
const static std::string SCHEDULE_GROUP_ERROR;
const static std::string SCHEDULE_IGNORED_GUIDE_RATE;
const static std::string SCHEDULE_WELL_IN_FIELD_GROUP;
const static std::string SCHEDULE_COMPSEGS_INVALID;
const static std::string SCHEDULE_COMPSEGS_NOT_SUPPORTED;

View File

@@ -97,7 +97,30 @@ namespace Opm {
bool hasKeyword( const std::string& ) const;
const ParserKeyword& getKeyword(const std::string& name) const;
bool isRecognizedKeyword( const std::string_view& deckKeywordName) const;
/// Whether or not string is a valid keyword.
///
/// The full keyword recognition process first verifies that the
/// input string looks like a valid keyword and, if so matches that
/// string against the builtin set of known keywords. The function
/// additionally includes those keywords that match against keyword
/// collections, typically the SUMMARY section "meta" keywords in
/// the *_PROBE files.
///
/// \return Whether or not \p deckKeywordName is a builtin deck
/// keyword or a known summary keyword.
bool isRecognizedKeyword(std::string_view deckKeywordName) const;
/// Whether or not string is a valid keyword.
///
/// First checks that the input string looks like a valid keyword
/// and, if so, matches the string against the builtin set of known
/// keywords.
///
/// \param[in] deckKeywordName Potential deck keyword.
///
/// \return Whether or not \p deckKeywordName is a builtin deck keyword.
bool isBaseRecognizedKeyword(std::string_view deckKeywordName) const;
const ParserKeyword& getParserKeywordFromDeckName(const std::string_view& deckKeywordName) const;
std::vector<std::string> getAllDeckNames () const;

View File

@@ -30,19 +30,19 @@ namespace Opm {
OTHER_KEYWORD_IN_DECK = 2,
UNKNOWN = 3,
FIXED_CODE = 4,
DOUBLE_SLASH_TERMINATED = 5
DOUBLE_SLASH_TERMINATED = 5,
SPECIAL_CASE_ROCK = 6,
};
enum ParserKeywordActionEnum {
INTERNALIZE = 0,
IGNORE = 1,
IGNORE_WARNING = 2,
THROW_EXCEPTION = 3
THROW_EXCEPTION = 3,
};
const std::string ParserKeywordActionEnum2String(ParserKeywordActionEnum enumValue);
const std::string ParserKeywordSizeEnum2String(ParserKeywordSizeEnum enumValue);
std::string ParserKeywordActionEnum2String(ParserKeywordActionEnum enumValue);
std::string ParserKeywordSizeEnum2String(ParserKeywordSizeEnum enumValue);
ParserKeywordSizeEnum ParserKeywordSizeEnumFromString(const std::string& stringValue);
ParserKeywordActionEnum ParserKeywordActionEnumFromString(const std::string& stringValue);

View File

@@ -94,7 +94,9 @@ namespace Opm {
static bool validInternalName(const std::string& name);
static bool validDeckName(const std::string_view& name);
bool hasMatchRegex() const;
bool hasMatchRegexSuffix() const;
void setMatchRegex(const std::string& deckNameRegexp);
void setMatchRegexSuffix(const std::string& deckNameRegexp);
bool matches(const std::string_view& ) const;
bool hasDimension() const;
void addRecord( ParserRecord );
@@ -154,6 +156,7 @@ namespace Opm {
std::unordered_set<std::string> m_validSectionNames;
std::string m_matchRegexString;
std::regex m_matchRegex;
std::string m_matchRegexSuffix{};
std::vector< ParserRecord > m_records;
std::string m_Description;
bool raw_string_keyword = false;
@@ -175,6 +178,7 @@ namespace Opm {
void initSizeKeyword(bool table_collection, const Json::JsonObject& sizeObject);
void addItems( const Json::JsonObject& jsonConfig);
void parseRecords( const Json::JsonObject& recordsConfig);
bool matchesDeckNames(std::string_view name) const;
};
std::ostream& operator<<( std::ostream&, const ParserKeyword& );

View File

@@ -75,7 +75,10 @@ class ActionX {
public:
ActionX();
ActionX(const std::string& name, size_t max_run, double max_wait, std::time_t start_time);
ActionX(const DeckKeyword& kw, const Actdims& actimds, std::time_t start_time);
ActionX(const std::string& name, size_t max_run, double max_wait,
std::time_t start_time,
const std::vector<Condition>&& conditions,
const std::vector<std::string>&& tokens);
ActionX(const DeckRecord& record, std::time_t start_time);
explicit ActionX(const RestartIO::RstAction& rst_action);
@@ -131,6 +134,15 @@ private:
std::vector<Condition> m_conditions;
};
/// \brief Parse ActionX keyword.
/// \param kw The keyword representation of ActionX
/// \param actdims Dimensions for ActionX as specified in the deck.
/// \param start_time The first time that the ActionX should be evaluated
/// \return A tuple of the ActionX created and a vector that contains for each error experienced
/// during parsing the string indicating the type of error and the error string itself.
std::tuple<ActionX, std::vector<std::pair<std::string, std::string>>>
parseActionX(const DeckKeyword& kw, const Actdims& actimds, std::time_t start_time);
}
}
#endif /* WELL_HPP_ */

View File

@@ -25,23 +25,27 @@
namespace Opm {
/*
This struct is used to communicate back from the Schdule::applyAction() what
needs to be updated in the simulator when execution is returned to the
simulator code.
*/
/// This struct is used to communicate back from the Schedule::applyAction()
/// what needs to be updated in the simulator when execution is returned to
/// the simulator code.
struct SimulatorUpdate {
// These wells have been affected by the ACTIONX and the simulator needs to
struct SimulatorUpdate
{
// Wells affected by ACTIONX and for which the simulator needs to
// reapply rates and state from the newly updated Schedule object.
std::unordered_set<std::string> affected_wells;
// If one of the transmissibility multiplier keywords has been invoked as an
// ACTIONX keyword the simulator needs to recalculate the transmissibility.
// If one of the transmissibility multiplier keywords has been invoked
// as an ACTIONX keyword the simulator needs to recalculate the
// transmissibility.
bool tran_update{false};
/// Whether or not well structure changed in processing an ACTIONX
/// block. Typically because of a keyword like WELSPECS, COMPDAT,
/// and/or WELOPEN.
bool well_structure_changed{false};
};
}
} // namespace Opm
#endif
#endif // SIMULATOR_UPDATE_HPP

View File

@@ -42,7 +42,7 @@ class State {
struct RunState {
RunState() = default;
RunState(std::time_t sim_time)
explicit RunState(std::time_t sim_time)
: run_count(1)
, last_run(sim_time)
{}

View File

@@ -0,0 +1,148 @@
/*
Copyright 2023 Equinor ASA.
Copyright 2023 Norce.
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_BC_PROP_HPP
#define OPM_BC_PROP_HPP
#include <vector>
#include <cstddef>
#include <optional>
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
namespace Opm {
class Deck;
class DeckRecord;
enum class BCType {
RATE,
FREE,
DIRICHLET,
THERMAL,
CLOSED,
NONE
};
enum class BCMECHType {
FREE,
FIXED,
NONE
};
enum class BCComponent {
OIL,
GAS,
WATER,
SOLVENT,
POLYMER,
NONE
};
struct MechBCValue {
std::array<double,3> disp{};
std::array<double,6> stress{};
std::array<bool,3> fixeddir{};
static MechBCValue serializationTestObject()
{
return MechBCValue{{1.0, 2.0, 3.0},
{3.0, 4.0, 5.0, 6.0, 7.0, 8.0},
{true, false, true}};
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(disp);
serializer(stress);
serializer(fixeddir);
}
bool operator==(const MechBCValue& other) const
{
return disp == other.disp &&
stress == other.stress &&
fixeddir == other.fixeddir;
}
};
class BCProp {
public:
struct BCFace {
int index;
BCType bctype;
BCMECHType bcmechtype;
BCComponent component;
double rate;
std::optional<double> pressure;
std::optional<double> temperature;
std::optional<MechBCValue> mechbcvalue;
BCFace() = default;
explicit BCFace(const DeckRecord& record);
static BCFace serializationTestObject();
bool operator==(const BCFace& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(index);
serializer(bctype);
serializer(bcmechtype);
serializer(component);
serializer(rate);
serializer(pressure);
serializer(temperature);
serializer(mechbcvalue);
}
};
BCProp() = default;
static BCProp serializationTestObject();
std::size_t size() const;
std::vector<BCFace>::const_iterator begin() const;
std::vector<BCFace>::const_iterator end() const;
bool operator==(const BCProp& other) const;
const BCFace& operator[](int index) const;
void updateBCProp(const DeckRecord& record);
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_faces);
}
private:
std::vector<BCFace> m_faces;
};
} //namespace Opm
#endif

View File

@@ -121,7 +121,7 @@ public:
};
CompletedCells() = default;
CompletedCells(const GridDims& dims);
explicit CompletedCells(const GridDims& dims);
CompletedCells(std::size_t nx, std::size_t ny, std::size_t nz);
const Cell& get(std::size_t i, std::size_t j, std::size_t k) const;
std::pair<bool, Cell&> try_get(std::size_t i, std::size_t j, std::size_t k);

View File

@@ -31,7 +31,7 @@ class GasLiftGroup {
public:
GasLiftGroup() = default;
GasLiftGroup(const std::string& name) :
explicit GasLiftGroup(const std::string& name) :
m_name(name)
{}

View File

@@ -69,7 +69,9 @@ namespace Opm {
bool has(const std::string& name) const;
const GCONSUMPGroup& get(const std::string& name) const;
const GCONSUMPGroupProp get(const std::string& name, const SummaryState& st) const;
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);
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;
bool operator==(const GConSump& data) const;

View File

@@ -174,6 +174,31 @@ struct GroupInjectionProperties {
}
};
struct GroupLimitAction
{
ExceedAction allRates{ExceedAction::NONE};
ExceedAction water{ExceedAction::NONE};
ExceedAction gas{ExceedAction::NONE};
ExceedAction liquid{ExceedAction::NONE};
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(allRates);
serializer(water);
serializer(gas);
serializer(liquid);
}
bool operator==(const GroupLimitAction& other) const
{
return (this->allRates == other.allRates)
&& (this->water == other.water)
&& (this->gas == other.gas)
&& (this->liquid == other.liquid);
}
};
struct InjectionControls {
Phase phase;
InjectionCMode cmode;
@@ -194,7 +219,7 @@ struct GroupProductionProperties {
std::string name;
ProductionCMode cmode = ProductionCMode::NONE;
ExceedAction exceed_action = ExceedAction::NONE;
GroupLimitAction group_limit_action;
UDAValue oil_target;
UDAValue water_target;
UDAValue gas_target;
@@ -216,7 +241,7 @@ struct GroupProductionProperties {
{
serializer(name);
serializer(cmode);
serializer(exceed_action);
serializer(group_limit_action);
serializer(oil_target);
serializer(water_target);
serializer(gas_target);
@@ -232,7 +257,7 @@ struct GroupProductionProperties {
struct ProductionControls {
ProductionCMode cmode;
ExceedAction exceed_action;
GroupLimitAction group_limit_action;
double oil_target;
double water_target;
double gas_target;
@@ -253,9 +278,7 @@ struct ProductionControls {
std::size_t insert_index() const;
const std::string& name() const;
bool is_field() const;
int getGroupNetVFPTable() const;
bool updateNetVFPTable(int vfp_arg);
bool update_gefac(double gefac, bool transfer_gefac);
// [[deprecated("use Group::control_group() or Group::flow_group()")]]
@@ -317,7 +340,6 @@ struct ProductionControls {
serializer(group_type);
serializer(gefac);
serializer(transfer_gefac);
serializer(vfp_table);
serializer(parent_group);
serializer(m_wells);
serializer(m_groups);
@@ -338,7 +360,6 @@ private:
GroupType group_type;
double gefac;
bool transfer_gefac;
int vfp_table;
std::string parent_group;
IOrderSet<std::string> m_wells;

View File

@@ -0,0 +1,146 @@
/*
Copyright 2023 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 GROUP_ECON_PRODUCTION_LIMITS_H
#define GROUP_ECON_PRODUCTION_LIMITS_H
#include <map>
#include <string>
#include <optional>
#include <opm/input/eclipse/Deck/UDAValue.hpp>
#include <opm/input/eclipse/Units/UnitSystem.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Schedule/SummaryState.hpp>
#include <opm/common/utility/Serializer.hpp>
#include <opm/common/utility/MemPacker.hpp>
namespace Opm {
class DeckRecord;
class GroupEconProductionLimits {
public:
enum class EconWorkover {
NONE = 0,
CON = 1, // CON
CONP = 2, // +CON
WELL = 3,
PLUG = 4,
ALL = 5
};
class GEconGroup {
public:
GEconGroup() = default;
GEconGroup(const DeckRecord &record, const int report_step);
bool endRun() const;
UDAValue minOilRate() const;
UDAValue minGasRate() const;
UDAValue maxWaterCut() const;
UDAValue maxGasOilRatio() const;
UDAValue maxWaterGasRatio() const;
int maxOpenWells() const;
bool operator==(const GEconGroup& other) const;
int reportStep() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_min_oil_rate);
serializer(m_min_gas_rate);
serializer(m_max_water_cut);
serializer(m_max_gas_oil_ratio);
serializer(m_max_water_gas_ratio);
serializer(m_workover);
serializer(m_end_run);
serializer(m_max_open_wells);
}
static GEconGroup serializationTestObject();
EconWorkover workover() const;
private:
UDAValue m_min_oil_rate;
UDAValue m_min_gas_rate;
UDAValue m_max_water_cut;
UDAValue m_max_gas_oil_ratio;
UDAValue m_max_water_gas_ratio;
EconWorkover m_workover;
bool m_end_run;
int m_max_open_wells;
int m_report_step; // Used to get UDQ undefined value
};
class GEconGroupProp {
/* Same as GEconGroup but with UDA values realized at given report step*/
public:
GEconGroupProp(const double min_oil_rate,
const double min_gas_rate,
const double max_water_cut,
const double max_gas_oil_ratio,
const double max_water_gas_ratio,
EconWorkover workover,
bool end_run,
int max_open_wells);
bool endRun() const;
std::optional<double> minOilRate() const;
std::optional<double> minGasRate() const;
std::optional<double> maxWaterCut() const;
std::optional<double> maxGasOilRatio() const;
std::optional<double> maxWaterGasRatio() const;
int maxOpenWells() const;
EconWorkover workover() const;
private:
std::optional<double> m_min_oil_rate;
std::optional<double> m_min_gas_rate;
std::optional<double> m_max_water_cut;
std::optional<double> m_max_gas_oil_ratio;
std::optional<double> m_max_water_gas_ratio;
EconWorkover m_workover;
bool m_end_run;
int m_max_open_wells;
};
GroupEconProductionLimits() = default;
//explicit GroupEconProductionLimits(const RestartIO::RstWell& rstWell);
void add_group(const int report_step, const std::string &group_name, const DeckRecord &record);
static EconWorkover econWorkoverFromString(const std::string& string_value);
const GEconGroup& get_group(const std::string& gname) const;
GEconGroupProp get_group_prop(
const Schedule &schedule, const SummaryState &st, const std::string& gname) const;
bool has_group(const std::string& gname) const;
bool operator==(const GroupEconProductionLimits& other) const;
bool operator!=(const GroupEconProductionLimits& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer) const
{
serializer(m_groups);
}
static GroupEconProductionLimits serializationTestObject();
size_t size() const;
private:
std::map<std::string, GEconGroup> m_groups;
};
} // namespace Opm
#endif

View File

@@ -111,7 +111,7 @@ public:
GuideRateModel::Target target { GuideRateModel::Target::NONE };
};
GuideRate(const Schedule& schedule);
explicit GuideRate(const Schedule& schedule);
void setSerializationTestData();

View File

@@ -35,7 +35,7 @@ namespace Opm {
class AutoICD : public SICD {
public:
AutoICD() = default;
AutoICD(const DeckRecord& record);
explicit AutoICD(const DeckRecord& record);
static AutoICD serializationTestObject();

View File

@@ -90,7 +90,7 @@ namespace Opm {
const double x_in,
const double y_in);
Segment(const RestartIO::RstSegment& rst_segment);
explicit Segment(const RestartIO::RstSegment& rst_segment);
static Segment serializationTestObject();

View File

@@ -69,6 +69,7 @@ namespace Opm {
// Status: OPEN or SHUT
ICDStatus status() const;
int ecl_status() const;
void setConMaxCrossArea(const double area);

View File

@@ -77,6 +77,8 @@ namespace Opm {
std::size_t size() const;
bool empty() const;
int maxSegmentID() const;
int maxBranchID() const;
double depthTopSegment() const;
double lengthTopSegment() const;
double volumeTopSegment() const;

View File

@@ -37,10 +37,10 @@ class ExtNetwork {
public:
ExtNetwork() = default;
bool active() const;
bool has_node(const std::string& name) const;
void add_node(Node node);
void add_branch(Branch branch);
void drop_branch(const std::string& uptree_node, const std::string& downtree_node);
bool has_node(const std::string& name) const;
void update_node(Node node);
const Node& node(const std::string& name) const;
const Node& root() const;
std::vector<Branch> downtree_branches(const std::string& node) const;
@@ -64,7 +64,7 @@ private:
std::vector<Branch> m_branches;
std::vector<std::string> insert_indexed_node_names;
std::map<std::string, Node> m_nodes;
bool has_indexed_node_name(const std::string name) const;
bool has_indexed_node_name(const std::string& name) const;
void add_indexed_node_name(std::string name);
};

View File

@@ -30,7 +30,7 @@ namespace Network {
class Node {
public:
Node() = default;
Node(const std::string& name);
explicit Node(const std::string& name);
const std::string& name() const;
const std::optional<double>& terminal_pressure() const;

View File

@@ -185,6 +185,7 @@
#include <unordered_map>
#include <map>
#include <optional>
#include <string>
namespace Opm {

View File

@@ -21,10 +21,11 @@
#include <cstddef>
#include <ctime>
#include <functional>
#include <iosfwd>
#include <map>
#include <memory>
#include <optional>
#include <iosfwd>
#include <set>
#include <string>
#include <unordered_map>
@@ -32,14 +33,14 @@
#include <vector>
#include <opm/input/eclipse/EclipseState/Runspec.hpp>
#include <opm/input/eclipse/Schedule/Action/WGNames.hpp>
#include <opm/input/eclipse/Schedule/CompletedCells.hpp>
#include <opm/input/eclipse/Schedule/Group/Group.hpp>
#include <opm/input/eclipse/Schedule/MessageLimits.hpp>
#include <opm/input/eclipse/Schedule/ScheduleDeck.hpp>
#include <opm/input/eclipse/Schedule/ScheduleState.hpp>
#include <opm/input/eclipse/Schedule/Well/PAvg.hpp>
#include <opm/input/eclipse/Schedule/WriteRestartFileEvents.hpp>
#include <opm/input/eclipse/Schedule/CompletedCells.hpp>
#include <opm/input/eclipse/Schedule/Action/WGNames.hpp>
#include <opm/input/eclipse/Units/UnitSystem.hpp>
namespace Opm
@@ -65,6 +66,7 @@ namespace Opm
class Python;
class RPTConfig;
class SCHEDULESection;
class SegmentMatcher;
struct SimulatorUpdate;
class SummaryState;
class TracerConfig;
@@ -91,6 +93,7 @@ namespace Opm
double sumthin{-1.0};
bool rptonly{false};
bool gaslift_opt_active{false};
std::optional<OilVaporizationProperties> oilVap;
ScheduleStatic() = default;
@@ -236,6 +239,7 @@ namespace Opm
bool hasWell(const std::string& wellName, std::size_t timeStep) const;
WellMatcher wellMatcher(std::size_t report_step) const;
std::function<std::unique_ptr<SegmentMatcher>()> segmentMatcherFactory(std::size_t report_step) const;
std::vector<std::string> wellNames(const std::string& pattern, std::size_t timeStep, const std::vector<std::string>& matching_wells = {}) const;
std::vector<std::string> wellNames(const std::string& pattern) const;
std::vector<std::string> wellNames(std::size_t timeStep) const;
@@ -349,6 +353,7 @@ namespace Opm
this->template pack_unpack<WellTestConfig>(serializer);
this->template pack_unpack<GConSale>(serializer);
this->template pack_unpack<GConSump>(serializer);
this->template pack_unpack<GroupEconProductionLimits>(serializer);
this->template pack_unpack<WListManager>(serializer);
this->template pack_unpack<Network::ExtNetwork>(serializer);
this->template pack_unpack<Network::Balance>(serializer);
@@ -513,11 +518,11 @@ namespace Opm
const bool actionx_mode;
const ParseContext& parseContext;
ErrorGuard& errors;
SimulatorUpdate * sim_update;
const std::unordered_map<std::string, double> * target_wellpi;
std::unordered_map<std::string, double>* wpimult_global_factor;
WelSegsSet *welsegs_wells;
std::set<std::string>*compsegs_wells;
SimulatorUpdate* sim_update{nullptr};
const std::unordered_map<std::string, double>* target_wellpi{nullptr};
std::unordered_map<std::string, double>* wpimult_global_factor{nullptr};
WelSegsSet* welsegs_wells{nullptr};
std::set<std::string>* compsegs_wells{nullptr};
const ScheduleGrid& grid;
/// \param welsegs_wells All wells with a WELSEGS entry for checks.
@@ -530,8 +535,8 @@ namespace Opm
bool actionx_mode_,
const ParseContext& parseContext_,
ErrorGuard& errors_,
SimulatorUpdate * sim_update_,
const std::unordered_map<std::string, double> * target_wellpi_,
SimulatorUpdate* sim_update_,
const std::unordered_map<std::string, double>* target_wellpi_,
std::unordered_map<std::string, double>* wpimult_global_factor_,
WelSegsSet* welsegs_wells_,
std::set<std::string>* compsegs_wells_)
@@ -551,6 +556,7 @@ namespace Opm
{}
void affected_well(const std::string& well_name);
void record_well_structure_change();
/// \brief Mark that the well occured in a WELSEGS keyword
void welsegs_handled(const std::string& well_name)
@@ -678,12 +684,14 @@ namespace Opm
void handleAQUCT (HandlerContext&);
void handleAQUFETP (HandlerContext&);
void handleAQUFLUX (HandlerContext&);
void handleBCProp (HandlerContext&);
void handleBRANPROP (HandlerContext&);
void handleCOMPDAT (HandlerContext&);
void handleCOMPLUMP (HandlerContext&);
void handleCOMPORD (HandlerContext&);
void handleCOMPSEGS (HandlerContext&);
void handleCOMPTRAJ (HandlerContext&);
void handleCSKIN (HandlerContext&);
void handleDRSDT (HandlerContext&);
void handleDRSDTCON (HandlerContext&);
void handleDRSDTR (HandlerContext&);
@@ -694,6 +702,7 @@ namespace Opm
void handleGCONPROD (HandlerContext&);
void handleGCONSALE (HandlerContext&);
void handleGCONSUMP (HandlerContext&);
void handleGECON (HandlerContext&);
void handleGEFAC (HandlerContext&);
void handleGEOKeyword(HandlerContext&);
void handleGLIFTOPT (HandlerContext&);
@@ -741,9 +750,14 @@ namespace Opm
void handleWMICP (HandlerContext&);
void handleWPAVE (HandlerContext&);
void handleWPAVEDEP (HandlerContext&);
void handleWVFPDP (HandlerContext&);
void handleWVFPEXP (HandlerContext&);
void handleWWPAVE (HandlerContext&);
void handleWPIMULT (HandlerContext&);
void handleWINJCLN (HandlerContext&);
void handleWINJDAM (HandlerContext&);
void handleWINJFCNC (HandlerContext&);
void handleWINJMULT (HandlerContext&);
void handleWPMITAB (HandlerContext&);
void handleWPOLYMER (HandlerContext&);
void handleWRFT (HandlerContext&);

View File

@@ -35,6 +35,7 @@
#include <opm/input/eclipse/Schedule/Tuning.hpp>
#include <opm/input/eclipse/Schedule/OilVaporizationProperties.hpp>
#include <opm/input/eclipse/Schedule/Events.hpp>
#include <opm/input/eclipse/Schedule/BCProp.hpp>
#include <opm/input/eclipse/Schedule/Group/Group.hpp>
#include <opm/input/eclipse/Schedule/Well/WellEnums.hpp>
#include <opm/input/eclipse/Schedule/MessageLimits.hpp>
@@ -63,6 +64,7 @@ namespace Opm {
class GasLiftOpt;
class GConSale;
class GConSump;
class GroupEconProductionLimits;
class GroupOrder;
class GuideRateConfig;
class NameOrder;
@@ -358,6 +360,7 @@ namespace Opm {
ptr_member<GConSale> gconsale;
ptr_member<GConSump> gconsump;
ptr_member<GroupEconProductionLimits> gecon;
ptr_member<GuideRateConfig> guide_rate;
ptr_member<WListManager> wlist_manager;
@@ -390,6 +393,8 @@ namespace Opm {
return this->gconsale;
else if constexpr ( std::is_same_v<T, GConSump> )
return this->gconsump;
else if constexpr ( std::is_same_v<T, GroupEconProductionLimits> )
return this->gecon;
else if constexpr ( std::is_same_v<T, WListManager> )
return this->wlist_manager;
else if constexpr ( std::is_same_v<T, Network::ExtNetwork> )
@@ -430,6 +435,8 @@ namespace Opm {
return this->gconsale;
else if constexpr ( std::is_same_v<T, GConSump> )
return this->gconsump;
else if constexpr ( std::is_same_v<T, GroupEconProductionLimits> )
return this->gecon;
else if constexpr ( std::is_same_v<T, WListManager> )
return this->wlist_manager;
else if constexpr ( std::is_same_v<T, Network::ExtNetwork> )
@@ -482,6 +489,7 @@ namespace Opm {
map_member<std::string, Well> wells;
// constant flux aquifers
std::unordered_map<int, SingleAquiferFlux> aqufluxs;
BCProp bcprop;
std::unordered_map<std::string, double> target_wellpi;
std::optional<NextStep> next_tstep;
@@ -510,6 +518,7 @@ namespace Opm {
serializer(m_whistctl_mode);
serializer(target_wellpi);
serializer(aqufluxs);
serializer(bcprop);
}

View File

@@ -20,6 +20,8 @@
#ifndef OPM_TUNING_HPP
#define OPM_TUNING_HPP
#include <optional>
namespace Opm {
class NextStep {
@@ -49,7 +51,7 @@ namespace Opm {
static Tuning serializationTestObject();
// Record1
double TSINIT;
std::optional<double> TSINIT;
double TSMAXZ;
double TSMINZ;
double TSMCHP;

View File

@@ -91,6 +91,9 @@ private:
UDQSet eval_group_expression(const std::string& string_value,
const UDQContext& context) const;
UDQSet eval_segment_expression(const std::string& string_value,
const UDQContext& context) const;
UDQSet eval_scalar_function(const UDQVarType target_type,
const UDQContext& context) const;

View File

@@ -45,13 +45,15 @@ public:
struct RstRecord {
RstRecord(UDAControl control_arg, UDAValue value_arg, std::string wgname_arg)
RstRecord(UDAControl control_arg, UDAValue value_arg,
const std::string& wgname_arg)
: control(control_arg)
, value(value_arg)
, wgname(wgname_arg)
{};
RstRecord(UDAControl control_arg, UDAValue value_arg, std::string wgname_arg, Phase phase)
RstRecord(UDAControl control_arg, UDAValue value_arg,
const std::string& wgname_arg, Phase phase)
: RstRecord(control_arg, value_arg, wgname_arg)
{
this->ig_phase = phase;

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