From 54a8f7335c894baf204f9152540cdc9568278fce 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 +++++++++++++++++++++++ opm/core/eclipse/SpecialEclipseFields.hpp | 6 ++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/opm/core/WellsManager.cpp b/opm/core/WellsManager.cpp index 806180e7..84073082 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(); diff --git a/opm/core/eclipse/SpecialEclipseFields.hpp b/opm/core/eclipse/SpecialEclipseFields.hpp index c9758a6c..f2df351c 100644 --- a/opm/core/eclipse/SpecialEclipseFields.hpp +++ b/opm/core/eclipse/SpecialEclipseFields.hpp @@ -1313,7 +1313,7 @@ struct GCONPROD : public SpecialBase } }; -/// Class holding a data line of keyword WCONPROD +/// Class holding a data line of keyword WGRUPCON struct WgrupconLine { std::string well_; // Well name @@ -1467,12 +1467,12 @@ struct WCONPROD : public SpecialBase wconprod_line.well_ = wellname; wconprod_line.open_shut_flag_ = readString(is); wconprod_line.control_mode_ = readString(is); - std::vector double_data(9, -1.0E20); + std::vector double_data(14, -1.0E20); double_data[5] = wconprod_line.BHP_limit_; double_data[6] = wconprod_line.THP_limit_; double_data[7] = wconprod_line.VFP_table_number_; double_data[8] = wconprod_line.artif_lift_quantity_; - const int num_to_read = 9; + const int num_to_read = 14; int num_read = readDefaultedVectorData(is, double_data, num_to_read); wconprod_line.oil_max_rate_ = double_data[0]; wconprod_line.water_max_rate_ = double_data[1];