OPM/opm-core — pull request #507 by joakim-hove (2014-03-04 13:41:27+00:00)
Title: Changed open / close behaviour of well_controls

The structure well_controls has an array of available controls and a current index which points into the array of available controls. The current index is also used to indicate whether a well is open or not:

current >= 0 Well is open
current < 0 Well is closed

This approach fails in the situation where there are no available controls. Unfortunately that is a quite typical situation:

WCONHIST
'W1' 'OPEN' 0 .... /
/

WCONPROD
'W1' 'SHUT' /
/

Here the numerical oil rate is first set to zero with the WCONHIST keyword; while the well is still open. Then with the WCONPROD keyword the well is shut. In the final WCONPROD keyword all control values are defaulted, i.e. there are no available controls.

In this PR a boolean flag ```well_is_open``` is introduced in well_controls structure, and the current index is not modified when the well is opened/shut.