Merge pull request #1958 from joakim-hove/well-potential-output

Calculate well potentials: check if restart file output is requestd
This commit is contained in:
Joakim Hove 2019-08-05 14:51:44 +02:00 committed by GitHub
commit 047a271cb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);