From 75749c3dab8ec171755f457f98dc52148784ae4c Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Fri, 7 Nov 2014 12:12:53 +0100 Subject: [PATCH] Do not include shut wells in the well name to index map The name to index map is used to make sure the correct wellstate values are associated with the corresponding well. Shut wells should be excluded from this mapping as no date is for shut wells are found in the wellstates, instead 0 is outputed for the shut wells. --- opm/core/io/eclipse/EclipseWriter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opm/core/io/eclipse/EclipseWriter.cpp b/opm/core/io/eclipse/EclipseWriter.cpp index 874c2548..d7e3b034 100644 --- a/opm/core/io/eclipse/EclipseWriter.cpp +++ b/opm/core/io/eclipse/EclipseWriter.cpp @@ -787,8 +787,12 @@ void Summary::writeTimeStep(int reportStepIdx, const Opm::ScheduleConstPtr schedule = eclipseState_->getSchedule(); const auto& timeStepWells = schedule->getWells(reportStepIdx); std::map wellNameToIdxMap; + int openWellIdx = 0; for (size_t tsWellIdx = 0; tsWellIdx < timeStepWells.size(); ++tsWellIdx) { - wellNameToIdxMap[timeStepWells[tsWellIdx]->name()] = tsWellIdx; + if (timeStepWells[tsWellIdx]->getStatus(timer.currentStepNum()) != WellCommon::SHUT ) { + wellNameToIdxMap[timeStepWells[tsWellIdx]->name()] = openWellIdx; + openWellIdx++; + } } // internal view; do not move this code out of Summary!