Opm::EclipseIO Class Reference

A class to write the reservoir state and the well state of a blackoil simulation to disk using the Eclipse binary format. More...

#include <EclipseIO.hpp>

Public Member Functions

 EclipseIO (const EclipseState &es, EclipseGrid grid, const Schedule &schedule, const SummaryConfig &summary_config)
 Sets the common attributes required to write eclipse binary files using ERT. More...
 
void writeInitial (data::Solution simProps=data::Solution(), std::map< std::string, std::vector< int > > int_data={}, const NNC &nnc=NNC())
 Output static properties in EGRID and INIT file. More...
 
void overwriteInitialOIP (const data::Solution &simProps)
 Overwrite the initial OIP values. More...
 
void writeTimeStep (const SummaryState &st, int report_step, bool isSubstep, double seconds_elapsed, RestartValue value, const bool write_double=false)
 Write a reservoir state and summary information to disk. More...
 
RestartValue loadRestart (SummaryState &summary_state, const std::vector< RestartKey > &solution_keys, const std::vector< RestartKey > &extra_keys={}) const
 
const out::Summarysummary ()
 
 EclipseIO (const EclipseIO &)=delete
 
 ~EclipseIO ()
 

Detailed Description

A class to write the reservoir state and the well state of a blackoil simulation to disk using the Eclipse binary format.

Constructor & Destructor Documentation

◆ EclipseIO() [1/2]

Opm::EclipseIO::EclipseIO ( const EclipseState es,
EclipseGrid  grid,
const Schedule schedule,
const SummaryConfig summary_config 
)

Sets the common attributes required to write eclipse binary files using ERT.

◆ EclipseIO() [2/2]

Opm::EclipseIO::EclipseIO ( const EclipseIO )
delete

◆ ~EclipseIO()

Opm::EclipseIO::~EclipseIO ( )

Member Function Documentation

◆ loadRestart()

RestartValue Opm::EclipseIO::loadRestart ( SummaryState summary_state,
const std::vector< RestartKey > &  solution_keys,
const std::vector< RestartKey > &  extra_keys = {} 
) const

◆ overwriteInitialOIP()

void Opm::EclipseIO::overwriteInitialOIP ( const data::Solution simProps)

Overwrite the initial OIP values.

These are also written when we call writeInitial if the simProps contains them. If not these are assumed to zero and the simulator can update them with this methods.

Parameters
simPropsThe properties containing at least OIP.

◆ summary()

const out::Summary & Opm::EclipseIO::summary ( )

◆ writeInitial()

void Opm::EclipseIO::writeInitial ( data::Solution  simProps = data::Solution(),
std::map< std::string, std::vector< int > >  int_data = {},
const NNC nnc = NNC() 
)

Output static properties in EGRID and INIT file.

Write the static eclipse data (grid, PVT curves, etc) to disk, and set up additional initial properties. There are no specific keywords to configure the output to the INIT files, it seems like the algorithm is: "All available keywords are written to INIT file". For the current code the algorithm is as such:

  1. 3D properties which can be simply calculated in the output layer are unconditionally written to disk, that currently includes the DX, DY, DZ and DEPTH keyword.
  2. All integer propeerties from the deck are written unconditionally, that typically includes the MULTNUM, PVTNUM, SATNUM and so on. Observe that the keywords PVTNUM, SATNUM, EQLNUM and FIPNUM are autocreated in the output layer, so they will be on disk even if they are not explicitly included in the deck.
  3. The PORV keyword will always be present in the INIT file, and that keyword will have nx*ny*nz elements; all other 3D properties will only have nactive elements.
  4. For floating point 3D keywords from the deck - like PORO and PERMX there is a hardcoded list in the writeINIFile( ) implementation of which keywords to output - if they are available.
  5. The container simProps contains additional 3D floating point properties which have been calculated by the simulator, this typically includes the transmissibilities TRANX, TRANY and TRANZ but could in principle be anye floating point property.

    If you want the FOE keyword in the summary output the simProps container must contain the initial OIP field.

In addition:

  • The NNC argument is distributed between the EGRID and INIT files.
  • PVT curves are written unconditionally, saturation functions are not yet written to disk.

◆ writeTimeStep()

void Opm::EclipseIO::writeTimeStep ( const SummaryState st,
int  report_step,
bool  isSubstep,
double  seconds_elapsed,
RestartValue  value,
const bool  write_double = false 
)

Write a reservoir state and summary information to disk.

The reservoir state can be inspected with visualization tools like ResInsight.

The summary information can then be visualized using tools from ERT or ECLIPSE. Note that calling this method is only meaningful after the first time step has been completed.

The optional simProps vector contains fields which have been calculated by the simulator and are written to the restart file. Examples of such fields would be the relative permeabilities KRO, KRW and KRG and fluxes. The keywords which can be added here are represented with mnenonics in the RPTRST keyword.

The extra_restart argument is an optional aergument which can be used to store arbitrary double vectors in the restart file. The following rules apply for the extra data:

  1. There is no size constraints.
  2. The keys must be unqiue across the SOlution container, and also built in default keys like 'INTEHEAD'.
  3. There is no unit conversion applied - the vectors are written to disk verbatim.

If the optional argument write_double is sent in as true the fields in the solution container will be written in double precision. OPM can load and restart from files with double precision keywords, but this is non-standard, and other third party applications might choke on those.

The misc_summary_values argument is used to pass pass various summary values which are of type 'ECL_SMSPEC_MISC_VAR' to the summary writer. The ability to pass miscellanous values to the summary writer is not very flexible:

  1. The keyword must be an already well defined ECLIPSE keyword like e.g. one of the performance related keywords.
  2. The keyword must have been requested in the SUMMARY section of the input deck.
  3. The dimension of the keyword must have specified in the hardcoded static map misc_units in Summary.cpp.

The documentation for this class was generated from the following file: