From 02df6dd9637508ff3f29fa6aa9f1043398ba70ce Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 27 Oct 2015 14:02:26 +0100 Subject: [PATCH 1/3] Fixes well manager for wells crossing into cells that overlap. In the parallel run there are cases where wells perforate cells that are neighbors of overlap/halo cells. On other process only parts of the well are seen as perforations. These wells should be ignored there. While the well was indeed ignored, the perforations found where mistakenly added to the well found due not clearing the wellperf_data[well_index]. This commit now does this clearing and results in the right handling of wells for e.g. SPE9. --- opm/core/wells/WellsManager_impl.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/opm/core/wells/WellsManager_impl.hpp b/opm/core/wells/WellsManager_impl.hpp index ec886ab6a..9297000de 100644 --- a/opm/core/wells/WellsManager_impl.hpp +++ b/opm/core/wells/WellsManager_impl.hpp @@ -231,6 +231,7 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t << "process deactivating here." << std::endl; // Mark well as not existent on this process wells_on_proc[wellIter-wells.begin()] = 0; + wellperf_data[well_index].clear(); continue; } } From 4bfc9219578cd1f31b6fd0acb4984e5ac8ce1f2f Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 27 Oct 2015 14:26:01 +0100 Subject: [PATCH 2/3] Fix grammar and spelling in warning. --- opm/core/wells/WellsManager_impl.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/core/wells/WellsManager_impl.hpp b/opm/core/wells/WellsManager_impl.hpp index 9297000de..8d5e205be 100644 --- a/opm/core/wells/WellsManager_impl.hpp +++ b/opm/core/wells/WellsManager_impl.hpp @@ -226,9 +226,9 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t // Check that the complete well is on this process if ( sum_completions_on_proc < completionSet->size() ) { - std::cout<< "Well "<< well->name() << " semms not be in " + std::cout<< "Well "<< well->name() << " does not seem to be" << "completely in the disjoint partition of " - << "process deactivating here." << std::endl; + << "process. Therefore we deactivate it here." << std::endl; // Mark well as not existent on this process wells_on_proc[wellIter-wells.begin()] = 0; wellperf_data[well_index].clear(); From 3e8381be203f74a678d34e6299a5f2e9f7e76712 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 28 Oct 2015 13:09:12 +0100 Subject: [PATCH 3/3] Renamed well_index to well_index_on_proc and added comment. This should prevent misunderstandings about what the well_index_on_proc is. It is not the well_index according to the eclipse state (on open wells count) but the index of the wells that are stored on this process' domain. --- opm/core/wells/WellsManager_impl.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/opm/core/wells/WellsManager_impl.hpp b/opm/core/wells/WellsManager_impl.hpp index 8d5e205be..a9e9b907f 100644 --- a/opm/core/wells/WellsManager_impl.hpp +++ b/opm/core/wells/WellsManager_impl.hpp @@ -128,7 +128,11 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t wellperf_data.resize(wells.size()); wells_on_proc.resize(wells.size(), 1); - int well_index = 0; + // The well index on the current process. + // Note that some wells are deactivated as they live on the interior + // domain of another proccess. Therefore this might different from + // the index of the well according to the eclipse state + int well_index_on_proc = 0; for (auto wellIter= wells.begin(); wellIter != wells.end(); ++wellIter) { WellConstPtr well = (*wellIter); @@ -198,7 +202,7 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t } pd.well_index *= wellPi; } - wellperf_data[well_index].push_back(pd); + wellperf_data[well_index_on_proc].push_back(pd); } } else { ++shut_completions_number; @@ -231,14 +235,14 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t << "process. Therefore we deactivate it here." << std::endl; // Mark well as not existent on this process wells_on_proc[wellIter-wells.begin()] = 0; - wellperf_data[well_index].clear(); + wellperf_data[well_index_on_proc].clear(); continue; } } } } { // WELSPECS handling - well_names_to_index[well->name()] = well_index; + well_names_to_index[well->name()] = well_index_on_proc; well_names.push_back(well->name()); { WellData wd; @@ -254,7 +258,7 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t } } - well_index++; + well_index_on_proc++; } // Set up reference depths that were defaulted. Count perfs.