From ddb21e1f2c2c9afea04d42ae450b683a69584236 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Wed, 19 Jul 2017 15:07:44 +0200 Subject: [PATCH] correcting the indexing of xvar_well_old in updateWellState in StandardWell_impl. --- opm/autodiff/StandardWell_impl.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/autodiff/StandardWell_impl.hpp b/opm/autodiff/StandardWell_impl.hpp index b47bb9641..78a880a4b 100644 --- a/opm/autodiff/StandardWell_impl.hpp +++ b/opm/autodiff/StandardWell_impl.hpp @@ -1023,8 +1023,8 @@ namespace Opm case RESERVOIR_RATE: { const int sign1 = dwells[0][XvarWell] > 0 ? 1: -1; - const double dx1_limited = sign1 * std::min(std::abs(dwells[0][XvarWell]),std::abs(xvar_well_old[nw*XvarWell + indexOfWell()])*dBHPLimit); - well_state.wellSolutions()[nw*XvarWell + indexOfWell()] = std::max(xvar_well_old[nw*XvarWell + indexOfWell()] - dx1_limited,1e5); + const double dx1_limited = sign1 * std::min(std::abs(dwells[0][XvarWell]),std::abs(xvar_well_old[XvarWell])*dBHPLimit); + well_state.wellSolutions()[nw*XvarWell + indexOfWell()] = std::max(xvar_well_old[XvarWell] - dx1_limited,1e5); well_state.bhp()[indexOfWell()] = well_state.wellSolutions()[nw*XvarWell + indexOfWell()]; if (well_controls_iget_type(wc, current) == SURFACE_RATE) {