From 2f32afd36dd2af20ca8769ec5e8cd2a7c88824bb Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Thu, 5 Feb 2015 09:41:37 +0100 Subject: [PATCH] Hardcode bhp limit for WCONHIST/RESV to 1 atm. TODO: Allow WELTARG to change the bhp limit --- opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp index 0b1301edd..21747f357 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp @@ -610,11 +610,18 @@ namespace Opm well_controls_clear(ctrl); well_controls_assert_number_of_phases(ctrl, int(np)); - const int ok = + const int ok_resv = well_controls_add_new(RESERVOIR_RATE, target, & distr[0], ctrl); - if (ok != 0) { + // For WCONHIST/RESV the BHP limit is set to 1 atm. + // TODO: Make it possible to modify the BHP limit using + // the WELTARG keyword + const int ok_bhp = + well_controls_add_new(BHP, unit::convert::from(1.0, unit::atm), + NULL, ctrl); + + if (ok_resv != 0 && ok_bhp != 0) { xw.currentControls()[*rp] = 0; well_controls_set_current(ctrl, 0); }