mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fix SHUT wells
Shut wells are not added to the well list and thus not considered in the simulator. The shut well test in test_wellsmanager is modified to assert this behaviour. BUG: This change provokes an assert in the EclipeWriter as number of wells in wellstate is different from number of wells in the schedule.
This commit is contained in:
@@ -412,7 +412,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (well->getStatus(timeStep) == WellCommon::SHUT) {
|
if (well->getStatus(timeStep) == WellCommon::SHUT) {
|
||||||
well_controls_shut_well( w_->ctrls[well_index] );
|
//well_controls_shut_well( w_->ctrls[well_index] );
|
||||||
well_index++;
|
well_index++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,6 +127,11 @@ void WellsManager::createWellsFromSpecs(std::vector<WellConstPtr>& wells, size_t
|
|||||||
int well_index = 0;
|
int well_index = 0;
|
||||||
for (auto wellIter= wells.begin(); wellIter != wells.end(); ++wellIter) {
|
for (auto wellIter= wells.begin(); wellIter != wells.end(); ++wellIter) {
|
||||||
WellConstPtr well = (*wellIter);
|
WellConstPtr well = (*wellIter);
|
||||||
|
|
||||||
|
if (well->getStatus(timeStep) == WellCommon::SHUT) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
{ // WELSPECS handling
|
{ // WELSPECS handling
|
||||||
well_names_to_index[well->name()] = well_index;
|
well_names_to_index[well->name()] = well_index;
|
||||||
well_names.push_back(well->name());
|
well_names.push_back(well->name());
|
||||||
|
|||||||
@@ -275,7 +275,12 @@ BOOST_AUTO_TEST_CASE(WellShutOK) {
|
|||||||
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck));
|
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck));
|
||||||
Opm::GridManager gridManager(deck);
|
Opm::GridManager gridManager(deck);
|
||||||
|
|
||||||
BOOST_CHECK_NO_THROW( Opm::WellsManager wellsManager2(eclipseState , 2 , *gridManager.c_grid(), NULL));
|
Opm::WellsManager wellsManager2(eclipseState , 2 , *gridManager.c_grid(), NULL);
|
||||||
|
|
||||||
|
// Shut wells are removed from the deck. i.e number of wells should be 2-1
|
||||||
|
BOOST_CHECK( wellsManager2.c_wells()->number_of_wells == 1);
|
||||||
|
|
||||||
|
//BOOST_CHECK_NO_THROW( Opm::WellsManager wellsManager2(eclipseState , 2 , *gridManager.c_grid(), NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user