From 8eb9b557598118254dd4f366dca06b74c2cb4a5f Mon Sep 17 00:00:00 2001 From: Kjetil Olsen Lye Date: Wed, 2 May 2012 16:30:48 +0200 Subject: [PATCH] Fixed small reading bug in well structure --- opm/core/WellsManager.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/opm/core/WellsManager.cpp b/opm/core/WellsManager.cpp index 806180e7a..84073082d 100644 --- a/opm/core/WellsManager.cpp +++ b/opm/core/WellsManager.cpp @@ -333,6 +333,33 @@ namespace Opm THROW("Failed creating Wells struct."); } + // Classify wells + if (deck.hasField("WCONINJE")) { + const std::vector& lines = deck.getWCONINJE().wconinje; + for (size_t i = 0 ; i < lines.size(); ++i) { + const std::map::const_iterator it = well_names_to_index.find(lines[i].well_); + if (it != well_names_to_index.end()) { + const int well_index = it->second; + well_data[well_index].type = INJECTOR; + } + else { + THROW("Unseen well name: " << lines[i].well_ << " first seen in WCONINJE"); + } + } + } + if (deck.hasField("WCONPROD")) { + const std::vector& lines = deck.getWCONPROD().wconprod; + for (size_t i = 0; i < lines.size(); ++i) { + const std::map::const_iterator it = well_names_to_index.find(lines[i].well_); + if (it != well_names_to_index.end()) { + const int well_index = it->second; + } else { + THROW("Unseen well name: " << lines[i].well_ << " first seen in WCONPROD"); + } + + } + } + // Add wells. for (int w = 0; w < num_wells; ++w) { const int w_num_perf = wellperf_data[w].size();