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>::
outputCumLog(std::size_t reportStepNum)
{
logOutput_.cumulative(reportStepNum,
[this](const std::string& name)
{ return this->isDefunctParallelWell(name); });
this->logOutput_.cumulative(reportStepNum);
}
template<class FluidSystem,class Scalar>
void EclGenericOutputBlackoilModule<FluidSystem,Scalar>::
outputProdLog(std::size_t reportStepNum)
{
logOutput_.production(reportStepNum,
[this](const std::string& name)
{ return this->isDefunctParallelWell(name); });
this->logOutput_.production(reportStepNum);
}
template<class FluidSystem,class Scalar>
void EclGenericOutputBlackoilModule<FluidSystem,Scalar>::
outputInjLog(std::size_t reportStepNum)
{
logOutput_.injection(reportStepNum,
[this](const std::string& name)
{ return this->isDefunctParallelWell(name); });
this->logOutput_.injection(reportStepNum);
}

View File

@ -95,8 +95,7 @@ LogOutputHelper<Scalar>::LogOutputHelper(const EclipseState& eclState,
template<class Scalar>
void LogOutputHelper<Scalar>::
cumulative(const std::size_t reportStepNum,
std::function<bool(const std::string&)> isDefunct) const
cumulative(const std::size_t reportStepNum) const
{
this->beginCumulativeReport_();
@ -138,11 +137,6 @@ cumulative(const std::size_t 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);
tmp_names[0] = wname; // WellCumDataType::WellName
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>
void LogOutputHelper<Scalar>::
injection(const std::size_t reportStepNum,
std::function<bool(const std::string&)> isDefunct) const
injection(const std::size_t reportStepNum) const
{
this->beginInjectionReport_();
@ -415,11 +408,6 @@ injection(const std::size_t 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);
// Ignore Producer wells
@ -507,8 +495,7 @@ injection(const std::size_t reportStepNum,
template<class Scalar>
void LogOutputHelper<Scalar>::
production(const std::size_t reportStepNum,
std::function<bool(const std::string&)> isDefunct) const
production(const std::size_t reportStepNum) const
{
this->beginProductionReport_();
@ -550,12 +537,6 @@ production(const std::size_t 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);
// Ignore injector wells

View File

@ -25,7 +25,6 @@
#include <opm/output/eclipse/Inplace.hpp>
#include <cstddef>
#include <functional>
#include <string>
#include <unordered_map>
#include <vector>
@ -47,8 +46,7 @@ public:
const SummaryState& st);
//! \brief Write cumulative production and injection reports to output.
void cumulative(const std::size_t reportStepNum,
std::function<bool(const std::string&)> isDefunct) const;
void cumulative(const std::size_t reportStepNum) const;
//! \brief Write error report to output.
void error(const std::vector<int>& failedCellsPbub,
@ -63,12 +61,10 @@ public:
void fipResv(const Inplace& inplace, const std::string& name) const;
//! \brief Write injection report to output.
void injection(const std::size_t reportStepNum,
std::function<bool(const std::string&)> isDefunct) const;
void injection(const std::size_t reportStepNum) const;
//! \brief Write production report to output.
void production(const std::size_t reportStepNum,
std::function<bool(const std::string&)> isDefunct) const;
void production(const std::size_t reportStepNum) 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);
helper.cumulative(0, [](const std::string&) { return false; });
helper.cumulative(0);
std::string data = trimStream(str);
BOOST_CHECK_EQUAL(data, reference);
}
@ -390,7 +390,7 @@ BOOST_AUTO_TEST_CASE(Injection)
}
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
helper.injection(0, [](const std::string&) { return false; });
helper.injection(0);
std::string data = trimStream(str);
BOOST_CHECK_EQUAL(data, reference);
}
@ -451,7 +451,7 @@ BOOST_AUTO_TEST_CASE(Production)
}
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
helper.production(0, [](const std::string&) { return false; });
helper.production(0);
std::string data = trimStream(str);
BOOST_CHECK_EQUAL(data, reference);
}