Calculate well potentials: check if restart file output is requestd

This commit is contained in:
Joakim Hove 2019-08-05 12:58:14 +02:00
parent a95db3e181
commit 9f655d13bd

View File

@ -1084,6 +1084,7 @@ namespace Opm {
const Opm::SummaryConfig& summaryConfig = ebosSimulator_.vanguard().summaryConfig();
const auto& summaryState = ebosSimulator_.vanguard().summaryState();
const bool write_restart_file = ebosSimulator_.vanguard().eclState().getRestartConfig().getWriteRestartFile(reportStepIdx);
int exception_thrown = 0;
try {
for (const auto& well : well_container_copy) {
@ -1132,13 +1133,14 @@ namespace Opm {
const bool needed_for_output = ((summaryConfig.hasSummaryKey( "WWPI:" + well->name()) ||
summaryConfig.hasSummaryKey( "WOPI:" + well->name()) ||
summaryConfig.hasSummaryKey( "WGPI:" + well->name())) && well->wellType() == INJECTOR) ||
((summaryConfig.hasSummaryKey( "WWPP:" + well->name()) ||
summaryConfig.hasSummaryKey( "WOPP:" + well->name()) ||
summaryConfig.hasSummaryKey( "WGPP:" + well->name())) && well->wellType() == PRODUCER);
if (needed_for_output || wellCollection().requireWellPotentials())
const bool needed_for_summary = ((summaryConfig.hasSummaryKey( "WWPI:" + well->name()) ||
summaryConfig.hasSummaryKey( "WOPI:" + well->name()) ||
summaryConfig.hasSummaryKey( "WGPI:" + well->name())) && well->wellType() == INJECTOR) ||
((summaryConfig.hasSummaryKey( "WWPP:" + well->name()) ||
summaryConfig.hasSummaryKey( "WOPP:" + well->name()) ||
summaryConfig.hasSummaryKey( "WGPP:" + well->name())) && well->wellType() == PRODUCER);
if (write_restart_file || needed_for_summary || wellCollection().requireWellPotentials())
{
std::vector<double> potentials;
well->computeWellPotentials(ebosSimulator_, B_avg, well_state_copy, potentials, deferred_logger);