My Project
|
A class to write reservoir and well states of a blackoil simulation to disk. More...
#include <EclipseIO.hpp>
Classes | |
class | Impl |
Public Member Functions | |
EclipseIO (const EclipseState &es, EclipseGrid grid, const Schedule &schedule, const SummaryConfig &summary_config, const std::string &basename="", const bool writeEsmry=false) | |
Sets common attributes required to write compatible result files. | |
EclipseIO (const EclipseIO &)=delete | |
void | writeInitial (data::Solution simProps=data::Solution(), std::map< std::string, std::vector< int > > int_data={}, const std::vector< NNCdata > &nnc={}) |
Output static properties in EGRID and INIT file. | |
void | overwriteInitialOIP (const data::Solution &simProps) |
Overwrite the initial OIP values. | |
void | writeTimeStep (const Action::State &action_state, const WellTestState &wtest_state, const SummaryState &st, const UDQState &udq_state, int report_step, bool isSubstep, double seconds_elapsed, RestartValue value, const bool write_double=false) |
Write a reservoir state and summary information to disk. | |
RestartValue | loadRestart (Action::State &action_state, SummaryState &summary_state, const std::vector< RestartKey > &solution_keys, const std::vector< RestartKey > &extra_keys={}) const |
Will load solution data and wellstate from the restart file. | |
const out::Summary & | summary () const |
const SummaryConfig & | finalSummaryConfig () const |
A class to write reservoir and well states of a blackoil simulation to disk.
Opm::RestartValue Opm::EclipseIO::loadRestart | ( | Action::State & | action_state, |
SummaryState & | summary_state, | ||
const std::vector< RestartKey > & | solution_keys, | ||
const std::vector< RestartKey > & | extra_keys = {} |
||
) | const |
Will load solution data and wellstate from the restart file.
This method will consult the IOConfig object to get filename and report step to restart from.
The map keys should be a map of keyword names and their corresponding dimension object. In other words, loading the state from a simple two phase simulation you would pass:
keys = { {"PRESSURE" , UnitSystem::measure::pressure }, {"SWAT" , UnitSystem::measure::identity }, }
For a three phase black oil simulation you would add pairs for SGAS, RS and RV. If you request keys which are not found in the restart file an exception will be raised. This also happens if the size of a vector does not match the expected size.
The function will consult the InitConfig object in the EclipseState object to determine which file and report step to load.
The extra_keys argument can be used to request additional kewyords from the restart value. The extra vectors will be stored in the 'extra' field of the return value. These values must have been added to the restart file previosuly with the extra argument to the writeTimeStep() method. If the bool value in the map is true the value is required, and the output layer will throw an exception if it is missing. Otherwise, if the bool is false missing, keywords will be ignored and there will not be an empty vector in the return value.
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.
[in] | simProps | The properties containing at least OIP. |
void Opm::EclipseIO::writeInitial | ( | data::Solution | simProps = data::Solution() , |
std::map< std::string, std::vector< int > > | int_data = {} , |
||
const std::vector< NNCdata > & | 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. For the current code the algorithm for selecting which vectors are written to the INIT file is as follows:
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:
void Opm::EclipseIO::writeTimeStep | ( | const Action::State & | action_state, |
const WellTestState & | wtest_state, | ||
const SummaryState & | st, | ||
const UDQState & | udq_state, | ||
int | report_step, | ||
bool | isSubstep, | ||
double | seconds_elapsed, | ||
RestartValue | value, | ||
const bool | write_double = false |
||
) |
Write a reservoir state and summary information to disk.
Calling this method is only meaningful after the first time step has been completed.
The RestartValue 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.
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.