not copying the contrl_index from the previous WellState

when there is new control keywords enter, the combination of control /
constraints change. Under this kind of situation, copying the control
index does not mean you copy the same types of control.

Using the control index from the previous WellState for many situation
is a good practice, while it also risks copying a random and rather bad
choice. It is a major problem when we have VFP, VFP can have very
damaging values for certain situation to show it is not desirable to
be in this kind of situation.
This commit is contained in:
Kai Bao 2017-03-23 16:08:39 +01:00
parent 653baae039
commit ed4e87ac24

View File

@ -161,7 +161,12 @@ namespace Opm
}
// currentControls
const int old_control_index = prevState.currentControls()[ oldIndex ];
// TODO: copying the control index from the previous state can provide better guess of the inital control
// while it can cause problem when the combination of the controls/constraints change. In that situation, coying
// the control index means specifying a rather random control. The VFP table provides some damaging values for
// situatioin not desirable, entering with a random control will possibly crash the whole simulation. Restarting with smaller
// time step might not help.
/* const int old_control_index = prevState.currentControls()[ oldIndex ];
if (old_control_index < well_controls_get_num(wells->ctrls[w])) {
// If the set of controls have changed, this may not be identical
// to the last control, but it must be a valid control.
@ -169,7 +174,7 @@ namespace Opm
} else {
assert(well_controls_get_num(wells->ctrls[w]) > 0);
currentControls()[ newIndex ] = 0;
}
} */
}