diff --git a/ebos/eclgenericoutputblackoilmodule.hh b/ebos/eclgenericoutputblackoilmodule.hh index 915a24885..5ff3021fe 100644 --- a/ebos/eclgenericoutputblackoilmodule.hh +++ b/ebos/eclgenericoutputblackoilmodule.hh @@ -186,6 +186,11 @@ public: return 0; } + bool needInterfaceFluxes([[maybe_unused]] const bool isSubStep) const + { + return this->interRegionFlows_.wantInterRegflowSummary(); + } + const std::map& getWBPData() const { return this->wbpData_; diff --git a/ebos/eclinterregflows.hh b/ebos/eclinterregflows.hh index 28e1ff730..c65e2a392 100644 --- a/ebos/eclinterregflows.hh +++ b/ebos/eclinterregflows.hh @@ -274,6 +274,11 @@ namespace Opm { /// Whether or not previous read() operation succeeded. bool readIsConsistent() const; + bool wantInterRegflowSummary() const + { + return !this->regionMaps_.empty(); + } + /// Serialise internal representation to MPI message buffer /// /// \tparam MessageBufferType Linear MPI message buffer. API should diff --git a/ebos/eclwriter.hh b/ebos/eclwriter.hh index 3569762e9..24cfc0773 100644 --- a/ebos/eclwriter.hh +++ b/ebos/eclwriter.hh @@ -187,7 +187,9 @@ public: const auto localWellTestState = simulator_.problem().wellModel().wellTestState(); this->prepareLocalCellData(isSubStep, reportStepNum); - this->captureLocalFluxData(); + if (this->eclOutputModule_->needInterfaceFluxes(isSubStep)) { + this->captureLocalFluxData(); + } if (this->collectToIORank_.isParallel()) { OPM_BEGIN_PARALLEL_TRY_CATCH()