Commit Graph

52 Commits

Author SHA1 Message Date
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
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
Arne Morten Kvarving
abce488f3b Summary.hpp: forward PAvgCalculatorCollection 2023-01-19 13:19:27 +01:00
Torbjørn Skille
d34910c27d Minimum time interval between update of ESMRY file
The ESMRY file need a complete rewrite every time this is being updated.
This will makes the file more available for reading by other processes.
2022-06-02 14:10:14 +02:00
Bård Skaflestad
819571a8db Make Summary Evaluation API Aware of Inter-Region Flows
This commit adds a new parameter, interreg_flows, to the eval()
member function of class Opm::Summary.  This is in preparation of
adding summary file output of inter-region flow rates and
cumulatives-e.g., the ROFT summary vectors.
2022-02-16 23:28:46 +01:00
Joakim Hove
0a59bd8f61 Filesystem rename EclipseState/Schedule/ Schedule/ 2022-01-02 14:32:14 +01:00
Joakim Hove
aede532b9a Filesystem rename parser/eclipse/ input/eclipse 2022-01-02 14:32:14 +01:00
Torbjørn Skille
46693aec47 Adding support for writing esmry
- command line option --enable-esmry, default = false
 - complete re-write of esmry file for every time step

Updating of class ESmry
 - remove automatic loading from ESMRY
2021-08-12 19:17:07 +02:00
Joakim Hove
9fe4be5ebf Rename data::WellRates -> data::Wells 2021-06-12 09:33:05 +02:00
Joakim Hove
53cd73c2d7 PAvgCalculator to calculate WBP? pressures 2020-11-30 10:42:15 +01:00
Joakim Hove
ef5c51cee7 RHPV 2020-11-24 12:10:05 +01:00
Joakim Hove
7a0b020c43 Add Inplace argument to Summary::eval() 2020-11-20 12:42:30 +01:00
Joakim Hove
bd766a0277 Store references to EclipseState and Schedule in Summary class 2020-11-19 07:19:57 +01:00
Kai Bao
e86e8796ec adding a small test for aquifer keywords 2020-10-02 22:32:23 +02:00
Kai Bao
fd773423b0 adding the following aquifer summary keywords
AAQR, AAQT, AAQP
2020-10-02 13:18:51 +02:00
Bård Skaflestad
6ea0e73512 Prepare for Creating Network-Level Summary Output
This commit adds a level of indirection to the existing group-level
data (active controls and guiderates), and adds a new 'NodeData'
level to the 'data::' protocol for transporting values from the
simulator to the output layer.

Update all call sites and users accordingly.
2020-09-20 17:46:01 +02:00
Joakim Hove
aeb55ec72e Pass global process parameters as mutable value 2020-09-08 08:23:45 +02:00
Bård Skaflestad
68b4f38464 Make Structure for Per-Group Summary Data from Simulator
This commit adds a level of indirection to the current per-group
summary quantities that is directly assigned by the simulator.  In
particular, introduce a new structure named

    GroupData

that contains a 'GroupConstraints' object and make the per-group
values into 'map<string, GroupData>' rather than the current
'map<string, GroupConstraints>'.  This is in preparation of adding
support for reporting group-level production/injection guiderates
(Gx[IP]GR) to the summary file.

Update tests and APIs accordingly.
2020-07-02 10:57:46 +02:00
Jostein Alvestad
68ac742f17 further changes for opm-data Groups 2020-03-16 13:51:05 +01:00
Bård Skaflestad
2eb3a06024 Replace Writer for Summary/SMSPEC Files
This commit replaces the existing system for writing summary and
specification (SMSPEC) files with a new implementation based on
class EclOutput.  We package the evaluators of individual parameters
in a set of classes determined by the parameter's category which
each implement a virtual 'update()' function.  This update function
ultimately writes new values into a SummaryState object.

Add a factory-like system for instantiating the appropriate class
depending on a SummaryNode's 'category()'.  Also, add a helper class
for managing the parameters that a configured in a simulation
model's SUMMARY section in order to distinguish these from those
parameters that are merely needed for restart purposes.  The summary
class's 'eval()' function then becomes a loop over the evaluators
for parameters in SUMMARY followed by a loop over the evaluators for
restart vectors.

We reimplement the 'internal_store()' function in terms of an
std::vector of a helper structure 'MiniStep' which holds a ministep
ID (contiguous counter started at zero), a report step ID, and all
the evaluated parameters of this ministep.  The final write function
then consists of outputting those ministep structures that have
accumulated since the previous call to write().  If a simulation
does not call write at all, then this will accumulate all parameters
for all ministeps throughout the simulation history.

We create the SMSPEC file at most once, and write to it at most each
report step.  We create the summary file once (if unified) or at
each report step (if separate).
2019-10-12 20:21:17 -05:00
Torbjørn Skille
34410cbe41 ERT/libecl routines used in the EclipseGrid class has been replace by new member functions. Grid properties are
calculated and stored as private data members in EclipseGrid.

The API for the class is unchanged except for some minor changes for exportACTNUM, exportZCORN and exportCOORD.

These changes have triggered some very few modifications in the opm-grid and opm-simulators repo.
2019-09-20 14:21:23 +02:00
Joakim Hove
08305b6e30 Extract Summary::eval() out from Summary::add_timestep() 2019-06-07 14:45:18 +02:00
Joakim Hove
07b02ed151 Factor out eval() method from Summary::add_timestep() 2019-05-15 06:58:10 +02:00
Bård Skaflestad
bed76c330b Summary: Add Means of Resetting Cumulative Quantities
This commit introduces a new mutating operation on Summary objects,

    Summary::reset_cumulative_quantities(const SummaryState&)

which overwrites the values of cumulative ("total") summary
quantities with those of the input argument.  The only *intended*
use case is reinitialising cumulative quantities in the case of
simulation restart, but other uses may exist.

Add a test case to exercise the new interface.
2019-02-10 19:14:29 -06:00
Joakim Hove
1ba51534ae Move SummaryState implementation to EclipseState/Schedule/ 2018-11-09 20:44:37 +01:00
Bård Skaflestad
8fbb93497a Summary: Include <map> in Public Interface
Needed to honour requirements of class Summary in isolation.  While
here, also move <unordered_map> to implementation file.
2018-10-25 09:09:32 +02:00
Joakim Hove
eded8bacfc Remove unused include 2018-09-13 17:11:49 +02:00
Bård Skaflestad
c3a11a2fb5 Summary: Calculate Independent Set of Vectors for Restart
This commit ensures that the following set of vectors are stored/updated in

    Summary::add_timestep()

for all active wells and well groups (including FIELD):

    - Production rates for Oil, Water, Gas, and Reservoir Volume
      (i.e., (O|W|G|V)PR).

    - Cumulative production totals for Oil, Water, Gas, and
      Reservoir Volume (i.e., (O|W|G|V)PT).

    - Injection rates for Water and Gas (i.e., (W|G)IR).

    - Cumulative injection totals for Water and Gas ((W|G)IT).

    - Producing Water Cut (WCT).

    - Producing Gas/Oil ratio (GOR).

We additionally capture the well bottom-hole pressure (WBHP) for all
wells that are active at the pertinent simulation step (sim_step).

Add an accessor function

    const SummaryState& Summary::get_restart_vectors() const

that returns the 'prev_state' which contains these summary vectors
and add a set of unit tests to exercise the new interface.
2018-06-25 14:04:11 +02:00
Joakim Hove
6168a35512 Add SummaryState class to hold on to summary state. 2018-05-23 06:49:23 +02:00
Tor Harald Sandve
06b7afc9be Remove data::Solution cells from Summary 2018-02-05 14:23:19 +01:00
Tor Harald Sandve
890b2226b2 Get Block values from simulator
Avoids communication of the whole state
2018-02-05 14:23:19 +01:00
Tor Harald Sandve
ba29cfa81e Remove unused stuff 2018-02-05 14:23:19 +01:00
Tor Harald Sandve
45267477b4 Get Region and Field values from simulator
Avoid cell based computations in opm-output as it could slow down the
MPI run.
2018-02-05 14:19:50 +01:00
Joakim Hove
21a2944885 Extract Schedule and SummaryConfig. 2017-10-03 09:29:25 +02:00
Joakim Hove
9120c67cf8 Ability to pass misc values to summary writer. 2017-06-06 15:40:34 +02:00
Tor Harald Sandve
01c56deb3f PV weight FPR 2017-05-10 10:03:31 +02:00
Joakim Hove
4d1693d027 Changes in the loading of restart files.
The main content of this commit is that the loading of restart files is
based on map of keys passed in from calling scope. This way the
selection of keywords to save and load is fully under control of calling
scope, but in addition there are many small refactorings:

 - The EclipseWriter class and implementation has been renamed
   EclipseIO.

 - The loading and saving of restart files has been moved to file and
   namespace RestartIO, which contains two loose functions load( ) and
   save( ).

 - The Summary() and RFT( ) data get their own copies of the data::Cells
   vector.

 - Removed some abstractions and wrrappers around C / ert
   datastructures. Using ecl_file_view when loading restart files,
   instead of bare ecl_file. Simplified opening of unified restart
   files.

 - Removed the ability to save restart keywords in double precision.
2017-01-17 16:58:56 +01:00
Jørgen Kvalsvik
fc789d489a FOE support
Field efficiency: (OIP(initial) - OIP(now)) / OIP(initial). The initial
OIP is cached, and FOIP is reused for OIP(now). Adds the
operator-(double,quantity) to make the formula obvious from the FOE
function.
2016-11-18 11:40:45 +01:00
Joakim Hove
ac4640effe Check that completion corresponds to active cell. 2016-11-04 15:24:59 +01:00
Joakim Hove
a8d82221a8 Added small class RegionCache. 2016-10-26 19:50:17 +02:00
Joakim Hove
79e7ce643d Using data::Solution for simulator <-> output.
Will use one common container for both the solution data required for the
restart, e.g. PRESSURE and SWAT and also the auxillary data like KRG and
FIP which is intended as extra information in the restart file, or
alternatively the summary file.
2016-10-17 07:04:06 +02:00
Joakim Hove
eb929077a2 Moved Cells.hpp and Wells.hpp opm/output/data/ 2016-10-06 16:29:20 +02:00
Joakim Hove
204ca5932b Outputwriter: use EclipseGrid
- The outputwriter will now take a a separate EclipseGrid instance as
  input argument, it is assumed that calling scope has already made sure
  ACTNUM and ZCORN are correct.

- All active/inactive cell mappings are based on the grid argument, the
  naked int* with global / active cell mappings has been completely
  removed.
2016-09-08 08:38:39 +02:00
Joakim Hove
33ae96f2af Summary will output region pressure: RPR 2016-08-26 12:50:40 +02:00
Jørgen Kvalsvik
0c0a548219 New private Summary implementation
A rewritten Summary.cpp with some minor header modifications. Synposis
of the new implementation:

* Uses unordered_map< string, std::function > for dispatch, instead of
  multiple functions and a switch
* Some poor man's function composition support has been added
  (privately) to avoid a lot of reptition in the post processing.
* Functions assume they work over lists of wells instead of single wells
  being special cased - this means groups of well etc. can share
  implementation with single wells and field keywords.
* Unsupported keywords are not written in the Summary file.

Furthermore, some comments on special cases and overall approach and
a generally more declarative implementation. This change is invisible to
downstream developers. Users will obviously see no more garbage
keywords.
2016-06-30 09:54:40 +02:00
Jørgen Kvalsvik
c5397488a8 Correctly calculate totals 2016-06-07 08:42:30 +02:00
Jørgen Kvalsvik
99e2a55204 Replace raw conversion_table with UnitSystem
The to_si/from_si functions were moved into UnitSystem which now manages
table lookup for clients, rather than having to store the raw
conversion tables.
2016-06-07 08:40:41 +02:00
Jørgen Kvalsvik
887491e851 Summary takes secs_elapsed, not per-step duration
To stay consistent with the interface exposed by the other
eclipse-writer components, the summary facilities takes its time elapsed
since simulation start, not on a per-step basis.
2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
210629aba0 Use UnitSystem::to/from_si over conversion_table
Keep up with a change in opm-parser which moves this functionality into
UnitSystem.
2016-05-24 14:26:36 +02:00
Jørgen Kvalsvik
885ed13fa0 Precompute string-to-enum mapping of keywords
By precomputing and storing the keyword-to-enum mapping, accessing and
writing to a node overhead changes from log(N) to constant, and should
behave better w.r.t. cache and memory access.
2016-04-27 10:50:33 +02:00