From ed4e87ac24863393aa936d70c3cefff3e402fc05 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Thu, 23 Mar 2017 16:08:39 +0100 Subject: [PATCH] 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. --- opm/autodiff/WellStateFullyImplicitBlackoil.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/opm/autodiff/WellStateFullyImplicitBlackoil.hpp b/opm/autodiff/WellStateFullyImplicitBlackoil.hpp index 84a54ebff..b34587f01 100644 --- a/opm/autodiff/WellStateFullyImplicitBlackoil.hpp +++ b/opm/autodiff/WellStateFullyImplicitBlackoil.hpp @@ -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; - } + } */ }