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.
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.
The data exchanged in data::Well::Completions is now a vector, more
closely matching the disk format and the order exposed by the simulator.
Zero'd wells and complations are still written for shut wells, or wells
the simulator does not provide any information for; however, all
non-closed wells (according to the schedule) will be restored. The
completions are written and restored in the same order as CompletionSet
from parser.
Change the structure used to populate OPM_XWEL to use a plain map of
data::Wells objects rather than dumping a series of vectors to
data::Wells. Tests are added for serialising and restoring wells.
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.
- 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.
In line with Eclipse water cuts, gas-oil ratio etc. only applies to
production values, rather than all rates. This sparked some other
refactoring that moves the negative-else-zero logic into the rate
calculation.
A small set of the completion family of keywords, water/oil/gas
production and injection. The tests and example data file are updated
accordingly, with edge cases.
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.
Basing the dest durations on days over seconds make them less noisy,
more readable and closer to actual idiomatic use. Removes some subtle
complexities from the tests.
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.
The tests requires some boilerplate setup and quickly became slow to
maintain and run. Rewrite so that the tests are grouped on topic instead
of immediate keyword family.