|
opm-common
|
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 | isFinalWrite (const int report_step, const bool is_substep, const bool force_final_report_step) const |
| Whether or not this is the run's final write operation. | |
| const std::string & | outputDir () const |
| Name of run's output directory. | |
| const out::Summary & | summary () const |
| Run's summary vector calculation engine. | |
| const SummaryConfig & | summaryConfig () 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 | writeInitial (std::vector< data::Solution > simProps, std::map< std::string, std::vector< int > > int_data, const std::vector< NNCdata > &nnc) const |
| void | writeInitial (std::vector< data::Solution > simProps, std::map< std::string, std::vector< int > > int_data, const NNCCollection &nnc_col) const |
| void | writeSummaryFile (const SummaryState &st, const int report_step, const std::optional< int > time_step, const double secs_elapsed, const bool isSubstep, const bool isFinalSummmary) |
| 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 | 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, std::vector< RestartValue > &&value) |
| Create restart file output for simulation runs with local grids. | |
| 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. | |
Internal implementation class for EclipseIO public interface.
| 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.
| [in] | eclipseState | Run'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] | grid | Run's active cells. The EclipseIO object takes ownership of this grid object. |
| [in] | schedule | Run'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] | summryConfig | Run'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] | baseName | Name of main input data file, stripped of extensions and directory names. |
| [in] | writeEsmry | Whether 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. |
| bool Opm::EclipseIO::Impl::isFinalWrite | ( | const int | report_step, |
| const bool | is_substep, | ||
| const bool | force_final_report_step ) const |
Whether or not this is the run's final write operation.
Simplifies checking for whether or not to to create an RSM file.
| [in] | report_step | One-based report step index for which to create output. Report_step=0 represents time zero. |
| [in] | is_substep | Whether this is just a sub step and not the end of a full report step, |
| [in] | force_final_report_step | If true then this is final write no matter what report_step actually is. Used if there was an EXIT in an ACTIONX |
report_step is the run's final report step. | 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.
| [in] | solution_keys | Descriptors of requisite and optional per-cell dynamic values to load from restart file. |
| [in] | extra_keys | Descriptors of additional dynamic values to load from restart file. Optional. |
| [in,out] | action_state | Run's action system state. On input, a valid object. On exit, populated from restart file information. |
| [in,out] | summary_state | Run'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. |
| 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.
| [in] | solution_keys | Descriptors of requisite and optional per-cell dynamic values to load from restart file. |
| [in] | report_step | One-based report step index for which load restart file information. |
report_step. | 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.
| [in] | report_step | One-based report step index for which to create output. Report_step=0 represents time zero. |
| [in] | isSubstep | Whether or not we're being called in the middle of a report step. |
| [in] | time_step | Current time step index. Passing something different than nullopt will typically generate summary file output for all times. |
| 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.
| [in] | report_step | One-based report step index. |
| [in] | isSubstep | Whether or not we're being called in the middle of a report step. We typically do not output RFT files for sub-steps. |
| 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.
| [in] | report_step | One-based report step index for which to create output. Report_step=0 represents time zero. |
| [in] | isSubstep | Whether or not we're being called in the middle of a report step. |
| [in] | secs_elapsed | Elapsed physical (i.e., simulated) time in seconds since start of simulation. |
| [in] | time_step | Current time step index. Passing something different than nullopt will typically generate summary file output for all times. |
| 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.
| [in] | simProps | Initial per-cell properties such as transmissibilities. Will be output to the INIT file. |
| [in] | int_data | Additional integer arrays defined by simulator. May contain things like the MPI partition arrays. Will be output to the INIT file. |
| [in] | nnc | Run'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. |
| 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().
| [in] | action_state | Run'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_state | Run's current WTEST information. Expected to hold information about those wells that have been closed due to various runtime conditions. |
| [in] | st | Summary values from most recent call to Summary::eval(). Source object from which to retrieve the values that go into the output buffer. |
| [in] | udq_state | Run's current UDQ values. |
| [in] | report_step | One-based report step index for which to create output. Report_step=0 represents time zero. |
| [in] | time_step | Current time step index. Nullopt if the sequence number should be the same as the report step index. |
| [in] | secs_elapsed | Elapsed physical (i.e., simulated) time in seconds since start of simulation. |
| [in] | write_double | Whether or not to output simulation results as double precision floating-point numbers. |
| [in] | value | Collection of per-cell, per-well, per-connection, per-segment, per-group, and per-aquifer dynamic results pertaining to this time point. |
| 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, | ||
| std::vector< RestartValue > && | value ) |
Create restart file output for simulation runs with local grids.
Calls RestartIO::save().
| [in] | action_state | Run'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_state | Run's current WTEST information. Expected to hold information about those wells that have been closed due to various runtime conditions. |
| [in] | st | Summary values from most recent call to Summary::eval(). Source object from which to retrieve the values that go into the output buffer. |
| [in] | udq_state | Run's current UDQ values. |
| [in] | report_step | One-based report step index for which to create output. Report_step=0 represents time zero. |
| [in] | time_step | Current time step index. Nullopt if the sequence number should be the same as the report step index. |
| [in] | secs_elapsed | Elapsed physical (i.e., simulated) time in seconds since start of simulation. |
| [in] | write_double | Whether or not to output simulation results as double precision floating-point numbers. |
| [in] | value | Collection of per-cell, per-well, per-connection, per-segment, per-group, and per-aquifer dynamic results pertaining to this time point. One collection per grid, with representing the main/global grid. |
| 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.
| [in] | secs_elapsed | Elapsed physical (i.e., simulated) time in seconds since start of simulation. |
| [in] | report_step | One-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] | haveExistingRFT | Whether or not the run's RFT file already exists. |
| [in] | wellSol | Per-well, per-connection, and per-segment dynamic result values. |
| 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.
| 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, | ||
| const bool | isFinalSummmary ) |
Create summary file output.
Calls Summary::add_timestep() and Summary::write().
| [in] | st | Summary values from most recent call to eval(). Source object from which to retrieve the values that go into the output buffer. |
| [in] | report_step | One-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_step | Zero-based time step ID. Nullopt if the sequence number should be the same as the report step. |
| [in] | secs_elapsed | Elapsed physical (i.e., simulated) time in seconds since start of simulation. |
| [in] | isSubstep | Whether or not we're being called in the middle of a report step. |
| [in] | isFinalSummmary | True if this is the final summary output. |