Drop BHP control when producer <-> injector.

This commit is contained in:
Joakim Hove 2015-10-29 12:49:30 +01:00
parent ce9727b337
commit 90c55b0257
2 changed files with 8 additions and 0 deletions

View File

@ -68,14 +68,18 @@ namespace Opm {
void Well::switchToProducer( size_t timeStep) {
WellInjectionProperties p = getInjectionPropertiesCopy(timeStep);
p.BHPLimit = 0;
p.dropInjectionControl( Opm::WellInjector::BHP );
setInjectionProperties( timeStep , p );
}
void Well::switchToInjector( size_t timeStep) {
WellProductionProperties p = getProductionPropertiesCopy(timeStep);
p.BHPLimit = 0;
p.dropProductionControl( Opm::WellProducer::BHP );
setProductionProperties( timeStep , p );
}

View File

@ -1416,6 +1416,10 @@ BOOST_AUTO_TEST_CASE(changeBhpLimitInHistoryModeWithWeltarg) {
// Check that the BHP limit is reset when changing between injector and producer.
BOOST_CHECK_EQUAL(well_i->getInjectionProperties(3).BHPLimit, 0); // 3
BOOST_CHECK_EQUAL(well_i->getInjectionProperties(4).BHPLimit, 0); // 4
BOOST_CHECK_EQUAL( true , well_i->getInjectionProperties(2).hasInjectionControl(Opm::WellInjector::BHP) );
BOOST_CHECK_EQUAL( false , well_i->getInjectionProperties(3).hasInjectionControl(Opm::WellInjector::BHP) );
BOOST_CHECK_EQUAL( false , well_i->getInjectionProperties(4).hasInjectionControl(Opm::WellInjector::BHP) );
}