Merge pull request #745 from atgeirr/add-default-bhp-control

Add default producer BHP control when not given in deck.
This commit is contained in:
Atgeirr Flø Rasmussen 2015-02-05 13:31:20 +01:00
commit e7ead1aceb
2 changed files with 8 additions and 3 deletions

View File

@ -601,10 +601,14 @@ namespace Opm
w_); w_);
} }
if (ok && productionProperties.hasProductionControl(WellProducer::BHP)) { if (ok) {
// Always append a BHP control.
// If no explicit BHP control given, use a 1 atm control.
const bool has_explicit_limit = productionProperties.hasProductionControl(WellProducer::BHP);
const double bhp_limit = has_explicit_limit ? productionProperties.BHPLimit : unit::convert::from(1.0, unit::atm);
control_pos[WellsManagerDetail::ProductionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]); control_pos[WellsManagerDetail::ProductionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]);
ok = append_well_controls(BHP, ok = append_well_controls(BHP,
productionProperties.BHPLimit , bhp_limit,
NULL, NULL,
well_index, well_index,
w_); w_);

View File

@ -176,7 +176,8 @@ void check_controls_epoch1( struct WellControls ** ctrls) {
void check_controls_epoch3( struct WellControls ** ctrls) { void check_controls_epoch3( struct WellControls ** ctrls) {
// The new producer // The new producer
const struct WellControls * ctrls1 = ctrls[1]; const struct WellControls * ctrls1 = ctrls[1];
BOOST_CHECK_EQUAL( 5 , well_controls_get_num(ctrls1)); // Note: controls include default (1 atm) BHP control.
BOOST_CHECK_EQUAL( 6 , well_controls_get_num(ctrls1));
} }