Output Well Flow Sheets for All Wells

There is no need to restrict PRT file flow reports to those wells
which are active on the current rank since the SummaryState object
holds information for all wells active at the current report step.
This commit is contained in:
Bård Skaflestad 2024-01-04 16:58:43 +01:00
parent b58b0f8879
commit 60c7c79f58
4 changed files with 12 additions and 41 deletions

View File

@ -235,27 +235,21 @@ template<class FluidSystem, class Scalar>
void EclGenericOutputBlackoilModule<FluidSystem,Scalar>:: void EclGenericOutputBlackoilModule<FluidSystem,Scalar>::
outputCumLog(std::size_t reportStepNum) outputCumLog(std::size_t reportStepNum)
{ {
logOutput_.cumulative(reportStepNum, this->logOutput_.cumulative(reportStepNum);
[this](const std::string& name)
{ return this->isDefunctParallelWell(name); });
} }
template<class FluidSystem,class Scalar> template<class FluidSystem,class Scalar>
void EclGenericOutputBlackoilModule<FluidSystem,Scalar>:: void EclGenericOutputBlackoilModule<FluidSystem,Scalar>::
outputProdLog(std::size_t reportStepNum) outputProdLog(std::size_t reportStepNum)
{ {
logOutput_.production(reportStepNum, this->logOutput_.production(reportStepNum);
[this](const std::string& name)
{ return this->isDefunctParallelWell(name); });
} }
template<class FluidSystem,class Scalar> template<class FluidSystem,class Scalar>
void EclGenericOutputBlackoilModule<FluidSystem,Scalar>:: void EclGenericOutputBlackoilModule<FluidSystem,Scalar>::
outputInjLog(std::size_t reportStepNum) outputInjLog(std::size_t reportStepNum)
{ {
logOutput_.injection(reportStepNum, this->logOutput_.injection(reportStepNum);
[this](const std::string& name)
{ return this->isDefunctParallelWell(name); });
} }

View File

@ -95,8 +95,7 @@ LogOutputHelper<Scalar>::LogOutputHelper(const EclipseState& eclState,
template<class Scalar> template<class Scalar>
void LogOutputHelper<Scalar>:: void LogOutputHelper<Scalar>::
cumulative(const std::size_t reportStepNum, cumulative(const std::size_t reportStepNum) const
std::function<bool(const std::string&)> isDefunct) const
{ {
this->beginCumulativeReport_(); this->beginCumulativeReport_();
@ -138,11 +137,6 @@ cumulative(const std::size_t reportStepNum,
} }
for (const auto& wname : schedule_.wellNames(reportStepNum)) { for (const auto& wname : schedule_.wellNames(reportStepNum)) {
// don't bother with wells not on this process
if (isDefunct(wname)) {
continue;
}
const auto& well = schedule_.getWell(wname, reportStepNum); const auto& well = schedule_.getWell(wname, reportStepNum);
tmp_names[0] = wname; // WellCumDataType::WellName tmp_names[0] = wname; // WellCumDataType::WellName
auto wName = static_cast<std::string>(wname); auto wName = static_cast<std::string>(wname);
@ -381,8 +375,7 @@ timeStamp(const std::string& lbl, double elapsed, int rstep, boost::posix_time::
template<class Scalar> template<class Scalar>
void LogOutputHelper<Scalar>:: void LogOutputHelper<Scalar>::
injection(const std::size_t reportStepNum, injection(const std::size_t reportStepNum) const
std::function<bool(const std::string&)> isDefunct) const
{ {
this->beginInjectionReport_(); this->beginInjectionReport_();
@ -415,11 +408,6 @@ injection(const std::size_t reportStepNum,
} }
for (const auto& wname : schedule_.wellNames(reportStepNum)) { for (const auto& wname : schedule_.wellNames(reportStepNum)) {
// don't bother with wells not on this process
if (isDefunct(wname)) {
continue;
}
const auto& well = schedule_.getWell(wname, reportStepNum); const auto& well = schedule_.getWell(wname, reportStepNum);
// Ignore Producer wells // Ignore Producer wells
@ -507,8 +495,7 @@ injection(const std::size_t reportStepNum,
template<class Scalar> template<class Scalar>
void LogOutputHelper<Scalar>:: void LogOutputHelper<Scalar>::
production(const std::size_t reportStepNum, production(const std::size_t reportStepNum) const
std::function<bool(const std::string&)> isDefunct) const
{ {
this->beginProductionReport_(); this->beginProductionReport_();
@ -550,12 +537,6 @@ production(const std::size_t reportStepNum,
} }
for (const auto& wname : schedule_.wellNames(reportStepNum)) { for (const auto& wname : schedule_.wellNames(reportStepNum)) {
// don't bother with wells not on this process
if (isDefunct(wname)) {
continue;
}
const auto& well = schedule_.getWell(wname, reportStepNum); const auto& well = schedule_.getWell(wname, reportStepNum);
// Ignore injector wells // Ignore injector wells

View File

@ -25,7 +25,6 @@
#include <opm/output/eclipse/Inplace.hpp> #include <opm/output/eclipse/Inplace.hpp>
#include <cstddef> #include <cstddef>
#include <functional>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
@ -47,8 +46,7 @@ public:
const SummaryState& st); const SummaryState& st);
//! \brief Write cumulative production and injection reports to output. //! \brief Write cumulative production and injection reports to output.
void cumulative(const std::size_t reportStepNum, void cumulative(const std::size_t reportStepNum) const;
std::function<bool(const std::string&)> isDefunct) const;
//! \brief Write error report to output. //! \brief Write error report to output.
void error(const std::vector<int>& failedCellsPbub, void error(const std::vector<int>& failedCellsPbub,
@ -63,12 +61,10 @@ public:
void fipResv(const Inplace& inplace, const std::string& name) const; void fipResv(const Inplace& inplace, const std::string& name) const;
//! \brief Write injection report to output. //! \brief Write injection report to output.
void injection(const std::size_t reportStepNum, void injection(const std::size_t reportStepNum) const;
std::function<bool(const std::string&)> isDefunct) const;
//! \brief Write production report to output. //! \brief Write production report to output.
void production(const std::size_t reportStepNum, void production(const std::size_t reportStepNum) const;
std::function<bool(const std::string&)> isDefunct) const;
void timeStamp(const std::string& lbl, double elapsed, int rstep, boost::posix_time::ptime currentDate) const; void timeStamp(const std::string& lbl, double elapsed, int rstep, boost::posix_time::ptime currentDate) const;

View File

@ -167,7 +167,7 @@ BOOST_AUTO_TEST_CASE(Cumulative)
} }
Opm::LogOutputHelper<double> helper(eclState, schedule, st); Opm::LogOutputHelper<double> helper(eclState, schedule, st);
helper.cumulative(0, [](const std::string&) { return false; }); helper.cumulative(0);
std::string data = trimStream(str); std::string data = trimStream(str);
BOOST_CHECK_EQUAL(data, reference); BOOST_CHECK_EQUAL(data, reference);
} }
@ -390,7 +390,7 @@ BOOST_AUTO_TEST_CASE(Injection)
} }
Opm::LogOutputHelper<double> helper(eclState, schedule, st); Opm::LogOutputHelper<double> helper(eclState, schedule, st);
helper.injection(0, [](const std::string&) { return false; }); helper.injection(0);
std::string data = trimStream(str); std::string data = trimStream(str);
BOOST_CHECK_EQUAL(data, reference); BOOST_CHECK_EQUAL(data, reference);
} }
@ -451,7 +451,7 @@ BOOST_AUTO_TEST_CASE(Production)
} }
Opm::LogOutputHelper<double> helper(eclState, schedule, st); Opm::LogOutputHelper<double> helper(eclState, schedule, st);
helper.production(0, [](const std::string&) { return false; }); helper.production(0);
std::string data = trimStream(str); std::string data = trimStream(str);
BOOST_CHECK_EQUAL(data, reference); BOOST_CHECK_EQUAL(data, reference);
} }