since we still support g++-7, where filesystem is marked experimental,
we introduce a wrapper header and expose the namespace to use
as Opm::filesystem.
for gcc we unconditionally link with libstdc++fs in the python bindings.
the setup.py stuff links as c code, not c++ code, so it is not
automatically added on any gcc version. this might prove unportable
later.
This commit introduces a new protocol for communicating a well's
active constraint (i.e., its current target control mode) between
the running simulator and the restart file. In particular, we add a
new type
Opm::data::CurrentControl
whose data members indicate if the well is a producer or injector
and, depending on that state, carries information about the
pertinent active control mode. The 'prod' member should be defined
for producing wells and the 'inj' member should be defined for
injectors. Default-constructed objects of this type are 'invalid'
and not output to the restart file. Add a CurrentControl member to
the Opm::data::Well type to enable communicating this information
using existing restart interfaces.
Expand existing unit tests to exercise the new data member.
This commit implements a new file writing function
void Opm::RftIO::write()
that is intended to replace the current RFT output functionality
defined in terms of private class 'RFT' in EclipseIO.cpp. We
support the basic RFT output consisting of
- Timestamp (elapsed and date)
- WELLETC metadata including all unit conventions
- Connection cell (I,J,K), connection cell hostgrid (blank for
main grid only), connection cell centre depth, connection cell
pressure, and connection cell water and gas saturations
Connections in inactive cells are omitted. Note that unit of
measure strings aren't implemented in terms of UnitSystem::name()
due to the strings being padded on the left for centering effect.
Add unit tests to exercise the new writer.
This commit switches the `test_RFT` unit test to using the `ERft`
class introduced in commit 24a8efb2 (PR #699). This is the first
step towards reimplementing the RFT file output in terms of class
EclOutput. The downside to doing this is that we can no longer use
the node-based queries of libecl and have to implement a wrapper on
top of the raw vectors to be able to ask for the pressure in a given
connection's cell.
This commit, a preparation for restoring cumulative quantities from
a restart file, reinitialises Summary::prev_time_elapsed in the case
of simulation restart and adds a check to
Summary::write_timestep()
which throws if the input argument 'secs_elapsed' is prior to the
previously recorded elapsed time. The latter is a change in the
behaviour of write_timestep(), but ensures that we don't integrate
rate quantities across a very large timestep in the case of
simulation restart and also prevents double accumulation.
Update impacted unit tests accordingly, and move FIRST_SIM's START
date into the RUNSPEC section where it belongs.
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.
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.