From 401b193854860f1d86a5cc120596a3648407cab8 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Mon, 27 Oct 2014 07:20:03 +0100 Subject: [PATCH 1/2] BUGFIX. Do not increase well index for shut wells. Shut wells are not added to the well list and the well index should therefore not be increased when well control is set. This is similar to whats is done for shut wells in createWellsFromSpecs. --- opm/core/wells/WellsManager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/opm/core/wells/WellsManager.cpp b/opm/core/wells/WellsManager.cpp index 7a59f094..dbb1dae6 100644 --- a/opm/core/wells/WellsManager.cpp +++ b/opm/core/wells/WellsManager.cpp @@ -412,8 +412,7 @@ namespace Opm } if (well->getStatus(timeStep) == WellCommon::SHUT) { - //well_controls_shut_well( w_->ctrls[well_index] ); - well_index++; + //SHUT wells are not added to the well list continue; } From 0dd70b1416e2a6e4ff20d5aa1ed32dd6d8e10153 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Mon, 27 Oct 2014 07:23:58 +0100 Subject: [PATCH 2/2] The wellmanager test is modified to account for not adding shut wells Shut wells are not added to the well list and the well manager test is modified accordinly. --- tests/test_wellsmanager.cpp | 17 ++++++----------- tests/wells_manager_data.data | 18 ------------------ 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/tests/test_wellsmanager.cpp b/tests/test_wellsmanager.cpp index 70cc0c23..9a380fe0 100644 --- a/tests/test_wellsmanager.cpp +++ b/tests/test_wellsmanager.cpp @@ -176,14 +176,7 @@ void check_controls_epoch1( struct WellControls ** ctrls) { void check_controls_epoch3( struct WellControls ** ctrls) { // The new producer const struct WellControls * ctrls1 = ctrls[1]; - const struct WellControls * ctrls2 = ctrls[2]; - - - BOOST_CHECK_EQUAL( 0 , well_controls_get_num(ctrls1)); - BOOST_CHECK( well_controls_well_is_shut( ctrls1)); - - BOOST_CHECK_EQUAL( 0 , well_controls_get_num(ctrls2)); - BOOST_CHECK( well_controls_well_is_shut(ctrls2)); + BOOST_CHECK_EQUAL( 5 , well_controls_get_num(ctrls1)); } @@ -215,10 +208,12 @@ BOOST_AUTO_TEST_CASE(New_Constructor_Works) { Opm::WellsManager wellsManager(eclipseState, 3, *gridManager.c_grid(), NULL); const Wells* wells = wellsManager.c_wells(); - BOOST_CHECK_EQUAL(3 , wells->number_of_wells); + // There is 3 wells in total in the deck at the 3rd schedule step. + // PROD1 is shut and should therefore not be counted. + // The new well is therefore the secound well. + BOOST_CHECK_EQUAL(2 , wells->number_of_wells); BOOST_CHECK_EQUAL( wells->name[0] , "INJ1"); - BOOST_CHECK_EQUAL( wells->name[1] , "PROD1"); - BOOST_CHECK_EQUAL( wells->name[2] , "NEW"); + BOOST_CHECK_EQUAL( wells->name[1] , "NEW"); check_controls_epoch3( wellsManager.c_wells()->ctrls ); } diff --git a/tests/wells_manager_data.data b/tests/wells_manager_data.data index 320d6e99..1c10c4ef 100755 --- a/tests/wells_manager_data.data +++ b/tests/wells_manager_data.data @@ -83,23 +83,5 @@ WCONHIST 'NEW' 'OPEN' 'ORAT' 0.000 0.000 0.000 5* / / - - -WCONPROD - 'NEW' 'SHUT' / -/ - - - - - -WCONPROD - 'PROD1' 'SHUT' / -/ - - - - - END