opm-common
Loading...
Searching...
No Matches
Opm::EclipseIO::Impl Class Reference

Internal implementation class for EclipseIO public interface. More...

Public Member Functions

 Impl (const EclipseState &eclipseState, EclipseGrid grid, const Schedule &schedule, const SummaryConfig &summryConfig, const std::string &baseName, const bool writeEsmry)
 Constructor.
bool outputEnabled () const
 Whether or not run requests file output.
std::pair< bool, bool > wantRFTOutput (const int report_step, const bool isSubstep) const
 Whether or not run requests RFT file output at this time.
bool wantSummaryOutput (const int report_step, const bool isSubstep, const double secs_elapsed, std::optional< int > time_step) const
 Whether or not to output summary file information at this time.
bool wantRestartOutput (const int report_step, const bool isSubstep, std::optional< int > time_step) const
 Whether or not to output restart file information at this time.
bool isFinalStep (const int report_step) const
 Whether or not this is the run's final report step.
const std::string & outputDir () const
 Name of run's output directory.
const out::Summarysummary () const
 Run's summary vector calculation engine.
const SummaryConfigsummaryConfig () const
 Run's complete summary configuration object, including those vectors that are needed to evaluate the defining expressions of any user-defined quantities.
RestartValue loadRestart (const std::vector< RestartKey > &solution_keys, const std::vector< RestartKey > &extra_keys, Action::State &action_state, SummaryState &summary_state) const
 Load per-cell solution data and wellstate from restart file.
data::Solution loadRestartSolution (const std::vector< RestartKey > &solution_keys, const int report_step) const
 Load per-cell solution data from restart file at specific time.
void writeInitial (data::Solution simProps, std::map< std::string, std::vector< int > > int_data, const std::vector< NNCdata > &nnc) const
 Output static properties to EGRID and INIT files.
void writeSummaryFile (const SummaryState &st, const int report_step, const std::optional< int > time_step, const double secs_elapsed, const bool isSubstep)
 Create summary file output.
void writeRestartFile (const Action::State &action_state, const WellTestState &wtest_state, const SummaryState &st, const UDQState &udq_state, const int report_step, std::optional< int > time_step, const double secs_elapsed, const bool write_double, RestartValue &&value)
 Create restart file output.
void writeRunSummary () const
 Create RSM file.
void writeRftFile (const double secs_elapsed, const int report_step, const bool haveExistingRFT, const data::Wells &wellSol) const
 Create RFT file output.
void countTimeStep ()
 Record full processing of a complete time step.

Detailed Description

Internal implementation class for EclipseIO public interface.

Constructor & Destructor Documentation

◆ Impl()

Opm::EclipseIO::Impl::Impl ( const EclipseState & eclipseState,
EclipseGrid grid,
const Schedule & schedule,
const SummaryConfig & summryConfig,
const std::string & baseName,
const bool writeEsmry )

Constructor.

Invoked only by containing class EclipseIO.

Parameters
[in]eclipseStateRun's static parameters such as region definitions. The EclipseIO object retains a reference to this object, whence the lifetime of eclipseState should exceed that of the EclipseIO object.
[in]gridRun's active cells. The EclipseIO object takes ownership of this grid object.
[in]scheduleRun's dynamic objects. The EclipseIO object retains a reference to this object, whence the lifetime of schedule should exceed that of the EclipseIO object.
[in]summryConfigRun's collection of summary vectors requested in the SUMMARY section of the model description. Used to initialise an internal SummaryConfig object that will additionally contain all vectors needed to evaluate the defining expressions of any user-defined quantities in the run.
[in]baseNameName of main input data file, stripped of extensions and directory names.
[in]writeEsmryWhether or not to additionally create a "transposed" .ESMRY output file during the simulation run. ESMRY files typically load faster into post-processing tools such as qsummary and ResInsight than traditional SMSPEC/UNSMRY files, especially if the user only needs to view a small number of vectors. On the other hand, ESMRY files typically require more memory while writing.

Member Function Documentation

◆ isFinalStep()

bool Opm::EclipseIO::Impl::isFinalStep ( const int report_step) const

Whether or not this is the run's final report step.

Simplifies checking for whether or not to to create an RSM file.

Parameters
[in]report_stepOne-based report step index for which to create output. Report_step=0 represents time zero.
Returns
Whether or not report_step is the run's final report step.

◆ loadRestart()

Opm::RestartValue Opm::EclipseIO::Impl::loadRestart ( const std::vector< RestartKey > & solution_keys,
const std::vector< RestartKey > & extra_keys,
Action::State & action_state,
SummaryState & summary_state ) const

Load per-cell solution data and wellstate from restart file.

Name of restart file and report step from which to restart inferred from internal IOConfig object.

Parameters
[in]solution_keysDescriptors of requisite and optional per-cell dynamic values to load from restart file.
[in]extra_keysDescriptors of additional dynamic values to load from restart file. Optional.
[in,out]action_stateRun's action system state. On input, a valid object. On exit, populated from restart file information.
[in,out]summary_stateRun's container of summary vector values. On input, a valid object. On exit, populated from restart file information. Mostly relevant to cumulative quantities such as FOPT.
Returns
Collection of per-cell, per-well, per-connection, per-segment, per-group, and per-aquifer dynamic results at simulation restart time.

◆ loadRestartSolution()

Opm::data::Solution Opm::EclipseIO::Impl::loadRestartSolution ( const std::vector< RestartKey > & solution_keys,
const int report_step ) const

Load per-cell solution data from restart file at specific time.

Common use case is to load the initial volumes-in-place from time zero.

Name of restart file inferred from internal IOConfig object.

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.

Parameters
[in]solution_keysDescriptors of requisite and optional per-cell dynamic values to load from restart file.
[in]report_stepOne-based report step index for which load restart file information.
Returns
Collection of per-cell results at report_step.

◆ wantRestartOutput()

bool Opm::EclipseIO::Impl::wantRestartOutput ( const int report_step,
const bool isSubstep,
std::optional< int > time_step ) const

Whether or not to output restart file information at this time.

Parameters
[in]report_stepOne-based report step index for which to create output. Report_step=0 represents time zero.
[in]isSubstepWhether or not we're being called in the middle of a report step.
[in]time_stepCurrent time step index. Passing something different than nullopt will typically generate summary file output for all times.
Returns
Whether or not to output restart file information at this time.

◆ wantRFTOutput()

std::pair< bool, bool > Opm::EclipseIO::Impl::wantRFTOutput ( const int report_step,
const bool isSubstep ) const

Whether or not run requests RFT file output at this time.

Parameters
[in]report_stepOne-based report step index.
[in]isSubstepWhether or not we're being called in the middle of a report step. We typically do not output RFT files for sub-steps.
Returns
RFT file output status. First member is whether or not to output RFT information at this time. Second is whether or not an RFT file already exists.

◆ wantSummaryOutput()

bool Opm::EclipseIO::Impl::wantSummaryOutput ( const int report_step,
const bool isSubstep,
const double secs_elapsed,
std::optional< int > time_step ) const

Whether or not to output summary file information at this time.

Parameters
[in]report_stepOne-based report step index for which to create output. Report_step=0 represents time zero.
[in]isSubstepWhether or not we're being called in the middle of a report step.
[in]secs_elapsedElapsed physical (i.e., simulated) time in seconds since start of simulation.
[in]time_stepCurrent time step index. Passing something different than nullopt will typically generate summary file output for all times.
Returns
Whether or not to output summary file information at this time.

◆ writeInitial()

void Opm::EclipseIO::Impl::writeInitial ( data::Solution simProps,
std::map< std::string, std::vector< int > > int_data,
const std::vector< NNCdata > & nnc ) const

Output static properties to EGRID and INIT files.

Parameters
[in]simPropsInitial per-cell properties such as transmissibilities. Will be output to the INIT file.
[in]int_dataAdditional integer arrays defined by simulator. May contain things like the MPI partition arrays. Will be output to the INIT file.
[in]nncRun's non-neighbouring connections. Includes those connections that are derived from corner-point grid processing and those connections that are explicitly entered using keywords like NNC, EDITNNC, or EDITNNCR. The cell pairs will be output to the EGRID file while the associate transmissibility will be output to the INIT file.

◆ writeRestartFile()

void Opm::EclipseIO::Impl::writeRestartFile ( const Action::State & action_state,
const WellTestState & wtest_state,
const SummaryState & st,
const UDQState & udq_state,
const int report_step,
std::optional< int > time_step,
const double secs_elapsed,
const bool write_double,
RestartValue && value )

Create restart file output.

Calls RestartIO::save().

Parameters
[in]action_stateRun's current action system state. Expected to hold current values for the number of times each action has run and the time of each action's last run.
[in]wtest_stateRun's current WTEST information. Expected to hold information about those wells that have been closed due to various runtime conditions.
[in]stSummary values from most recent call to Summary::eval(). Source object from which to retrieve the values that go into the output buffer.
[in]udq_stateRun's current UDQ values.
[in]report_stepOne-based report step index for which to create output. Report_step=0 represents time zero.
[in]time_stepCurrent time step index. Nullopt if the sequence number should be the same as the report step index.
[in]secs_elapsedElapsed physical (i.e., simulated) time in seconds since start of simulation.
[in]write_doubleWhether or not to output simulation results as double precision floating-point numbers.
[in]valueCollection of per-cell, per-well, per-connection, per-segment, per-group, and per-aquifer dynamic results pertaining to this time point.

◆ writeRftFile()

void Opm::EclipseIO::Impl::writeRftFile ( const double secs_elapsed,
const int report_step,
const bool haveExistingRFT,
const data::Wells & wellSol ) const

Create RFT file output.

Parameters
[in]secs_elapsedElapsed physical (i.e., simulated) time in seconds since start of simulation.
[in]report_stepOne-based report step index for which to create output. Report_step=0 represents time zero, although this is typically not applicable to this function.
[in]haveExistingRFTWhether or not the run's RFT file already exists.
[in]wellSolPer-well, per-connection, and per-segment dynamic result values.

◆ writeRunSummary()

void Opm::EclipseIO::Impl::writeRunSummary ( ) const

Create RSM file.

Loads the run's summary output files and writes the "transposed" file output. Should typically be called only at the end of the simulation run, and only if specifically requested through the RUNSUM keyword.

◆ writeSummaryFile()

void Opm::EclipseIO::Impl::writeSummaryFile ( const SummaryState & st,
const int report_step,
const std::optional< int > time_step,
const double secs_elapsed,
const bool isSubstep )

Create summary file output.

Calls Summary::add_timestep() and Summary::write().

Parameters
[in]stSummary values from most recent call to eval(). Source object from which to retrieve the values that go into the output buffer.
[in]report_stepOne-based report step index for which to create output. This is the number that gets incorporated into the file extension of "separate" summary output files (i.e., .S000n). Report_step=0 represents time zero.
[in]time_stepZero-based time step ID. Nullopt if the sequence number should be the same as the report step.
[in]secs_elapsedElapsed physical (i.e., simulated) time in seconds since start of simulation.
[in]isSubstepWhether or not we're being called in the middle of a report step.

The documentation for this class was generated from the following file:
  • opm/output/eclipse/EclipseIO.cpp