Changed open / close behaviour of well_controls: 1) well_controls has an explicit open_close flag. 2) Will NOT flip current value to change open|close status

This commit is contained in:
Joakim Hove
2014-03-04 14:28:42 +01:00
parent b40d2e63d0
commit 8be1f0e8d3
8 changed files with 58 additions and 32 deletions

View File

@@ -51,8 +51,7 @@ namespace Opm
// above or below (depending on if the well is an
// injector or producer) pressure in first perforation
// cell.
if ((well_controls_get_current(ctrl) < 0) || // SHUT
(well_controls_get_current_type(ctrl) != BHP)) {
if (well_controls_well_is_shut(ctrl) || (well_controls_get_current_type(ctrl) != BHP)) {
const int first_cell = wells->well_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];
@@ -61,8 +60,7 @@ namespace Opm
}
// Initialize well rates to match controls if type is SURFACE_RATE
if ((well_controls_get_current(ctrl) >= 0) && // open well
(well_controls_get_current_type(ctrl) == SURFACE_RATE)) {
if (well_controls_well_is_open( ctrl ) || (well_controls_get_current_type(ctrl) == SURFACE_RATE)) {
const double rate_target = well_controls_get_current_target(ctrl);
const double * distr = well_controls_get_current_distr( ctrl );
for (int p = 0; p < np; ++p) {