From 27a396b4394d3595202dfd6b276c1de95771970f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Fri, 28 Mar 2014 13:01:10 +0100 Subject: [PATCH] This re-adds the bhp reports to the summary output. It was lost in the shuffling bewteen branches when working on the new parser. --- opm/core/io/eclipse/EclipseWriter.cpp | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/opm/core/io/eclipse/EclipseWriter.cpp b/opm/core/io/eclipse/EclipseWriter.cpp index 916b9aa3..42173021 100644 --- a/opm/core/io/eclipse/EclipseWriter.cpp +++ b/opm/core/io/eclipse/EclipseWriter.cpp @@ -1168,9 +1168,26 @@ struct EclipseWellBhp : public EclipseWellReport { "Pascal") { } + EclipseWellBhp (const EclipseSummary& summary, + Opm::DeckConstPtr newParserDeck, + int whichWell, + PhaseUsage uses, + BlackoilPhases::PhaseIndex phase, + WellType type) + : EclipseWellReport (summary, + newParserDeck, + whichWell, + uses, + phase, + type, + 'B', + "Pascal") + { } + virtual double update (const SimulatorTimer& /*timer*/, const WellState& wellState) { + std::cout << "bhp(wellState) = " << bhp(wellState) << std::endl; return bhp(wellState); } }; @@ -1296,6 +1313,27 @@ EclipseSummary::addWells (Opm::DeckConstPtr newParserDeck, } } } + + // Add BHP monitors + for (int whichWell = 0; whichWell != numWells; ++whichWell) { + // In the call below: uses, phase and the well type arguments + // are not used, except to set up an index that stores the + // well indirectly. For details see the implementation of the + // EclipseWellReport constructor, and the method + // EclipseWellReport::bhp(). + BlackoilPhases::PhaseIndex phase = BlackoilPhases::Liquid; + if (!uses.phase_used[BlackoilPhases::Liquid]) { + phase = BlackoilPhases::Vapour; + } + add (std::unique_ptr ( + new EclipseWellBhp (*this, + newParserDeck, + whichWell, + uses, + phase, + WELL_TYPES[0]))); + } + } namespace Opm {