|
opm-common
|
Computational engine for calculating summary vectors (2D curves as a function of time) and writing these values to the summary file. More...
#include <Summary.hpp>
Classes | |
| struct | DynamicSimulatorState |
| Layer of indirection for transferring dynamic state objects into vector calculation engine. More... | |
| class | SummaryImplementation |
Public Types | |
| using | DynamicConns = std::vector< std::pair< std::string, std::vector< std::size_t > >> |
| Set of well connections that have been created during the simulation run. More... | |
Public Member Functions | |
| Summary (SummaryConfig &sumcfg, const EclipseState &es, const EclipseGrid &grid, const Schedule &sched, const std::string &basename="", const bool writeEsmry=false) | |
| Constructor. More... | |
| ~Summary () | |
| Destructor. More... | |
| void | add_timestep (const SummaryState &st, const int report_step, const int ministep_id, const bool isSubstep) |
| Linearise summary values into internal buffer for output purposes. More... | |
| void | recordNewDynamicWellConns (const DynamicConns &newConns) |
| Activate pre-allocated summary vector slots for newly established well connections arising from dynamic fracturing. More... | |
| void | eval (const int report_step, const double secs_elapsed, const DynamicSimulatorState &values, SummaryState &summary_state) const |
| Calculate summary vector values. More... | |
| void | write (const bool is_final_summary=false) const |
| Write all current summary vector buffers to output files. More... | |
Computational engine for calculating summary vectors (2D curves as a function of time) and writing these values to the summary file.
Supports formatted and unformatted, unified and separate summary files.
| using Opm::out::Summary::DynamicConns = std::vector<std::pair<std::string, std::vector<std::size_t> >> |
Set of well connections that have been created during the simulation run.
This is only relevant for geomechanics runs with dynamic fracturing. A set of connections is identified by a well name and a vector of connection IDs. The output layer needs to know about these connections because it needs to activate the corresponding summary vector slots for newly established connections.
| Opm::out::Summary::Summary | ( | SummaryConfig & | sumcfg, |
| const EclipseState & | es, | ||
| const EclipseGrid & | grid, | ||
| const Schedule & | sched, | ||
| const std::string & | basename = "", |
||
| const bool | writeEsmry = false |
||
| ) |
Constructor.
| [in,out] | sumcfg | On input, the full collection of summary vectors requested in the run's SUMMARY section. On exit, also contains those additional summary vectors needed to evaluate any UDQ defining expressions. |
| [in] | es | Run's static parameters such as region definitions. The Summary object retains a reference to this object, so its lifetime should not exceed that of the EclipseState object. |
| [in] | grid | Run's active cells. The Summary object retains a reference to this object, so its lifetime should not exceed that of the EclipseGrid object. |
| [in] | sched | Run's dynamic objects. The Summary object retains a reference to this object, so its lifetime should not exceed that of the Schedule object. |
| [in] | basename | Run's base name. Needed to create names of summary output files. |
| [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. |
| Opm::out::Summary::~Summary | ( | ) |
Destructor.
Needed for PIMPL idiom.
| void Opm::out::Summary::add_timestep | ( | const SummaryState & | st, |
| const int | report_step, | ||
| const int | ministep_id, | ||
| const bool | isSubstep | ||
| ) |
Linearise summary values into internal buffer for output purposes.
| [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] | ministep_id | Zero based count of time steps performed. |
| [in] | isSubstep | Whether or not we're being called in the middle of a report step. |
| void Opm::out::Summary::eval | ( | const int | report_step, |
| const double | secs_elapsed, | ||
| const DynamicSimulatorState & | values, | ||
| SummaryState & | summary_state | ||
| ) | const |
Calculate summary vector values.
| [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] | secs_elapsed | Elapsed physical time in seconds since start of simulation. |
| [in] | values | Dynamic state values from simulator. |
| [in,out] | summary_state | Summary vector values. On exit, holds updated values for all vectors that are not user-defined quantities. UDQs are calculated in UDQConfig::eval() which should be called shortly after calling Summary::eval(). |
| void Opm::out::Summary::recordNewDynamicWellConns | ( | const DynamicConns & | newConns | ) |
Activate pre-allocated summary vector slots for newly established well connections arising from dynamic fracturing.
During initialisation, a geomechanics run pre-allocates a fixed number of placeholder output parameter slots for each well that is configured to produce fracturing-related connection vectors. When the simulator informs the output layer that new connections have actually been created during the run, this function claims those slots and assigns them to the concrete connection cell indices supplied by the caller.
For each (well name, connection IDs) pair in newConns the function looks up the set of connection summary vectors that were pre-allocated for that well. For every such vector and every new connection index it requests a new parameter slot from internal storage so that the vector is evaluated and written from the next time step onwards.
| [in] | newConns | Each element is a pair of
|
| void Opm::out::Summary::write | ( | const bool | is_final_summary = false | ) | const |
Write all current summary vector buffers to output files.
| [in] | is_final_summary | Whether or not this is the final summary output request. When set to true, this guarantees that runs which request the creation of a "transposed" .ESMRY output file will create ESMRY file output containing all summary vector values. |