restoring the original wellstate when solveWelleq fails.

This commit is contained in:
Kai Bao 2015-11-19 14:15:41 +01:00
parent 233a275191
commit fcd31d74ac

View File

@ -1584,6 +1584,7 @@ namespace detail {
std::vector<ADB> cq_s(np, ADB::null());
std::vector<int> indices = variableWellStateIndices();
SolutionState state0 = state;
WellState well_state0 = well_state;
asImpl().makeConstantState(state0);
std::vector<ADB> mob_perfcells_const(np, ADB::null());
@ -1661,6 +1662,10 @@ namespace detail {
asImpl().computeWellConnectionPressures(state, well_state);
}
if (!converged) {
well_state = well_state0;
}
return converged;
}