From c4aae4440ea9cd168f03dd0da4ff7dd9db59d472 Mon Sep 17 00:00:00 2001 From: babrodtk Date: Thu, 6 Aug 2015 15:11:11 +0200 Subject: [PATCH] Update support for VFP tables: Now produces almost identical results to BHP for 'identity' table' --- opm/core/simulator/WellState.hpp | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/opm/core/simulator/WellState.hpp b/opm/core/simulator/WellState.hpp index 95f037be..3d9ede4d 100644 --- a/opm/core/simulator/WellState.hpp +++ b/opm/core/simulator/WellState.hpp @@ -67,6 +67,7 @@ namespace Opm bhp_[w] = well_controls_get_current_target( ctrl ); break; case THP: + assert(false && "Not properly implemented"); thp_[w] = well_controls_get_current_target( ctrl ); break; default: @@ -97,20 +98,34 @@ namespace Opm wellrates_[np*w + p] = small_rate * sign; } } - // 2. Initialize bhp to be target pressure if - // bhp-controlled well, otherwise set to a + + // 2. if we have a thp/bhp control, + // set target (may be overridden later) + // Assumes only one THP / BHP control. + thp_[w] = -1e100; + bhp_[w] = -1e100; + int num_controls = well_controls_get_num( ctrl ); + for (int i=0; iwell_cells[wells->well_connpos[w]]; const double safety_factor = (wells->type[w] == INJECTOR) ? 1.01 : 0.99; bhp_[w] = safety_factor*state.pressure()[first_cell]; - thp_[w] = -1e100; + // thp_[w] = -1e100; } } }