From a60a969257d8d6984e13858125bab8e8de157c06 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Mon, 21 Aug 2017 17:05:26 +0200 Subject: [PATCH] fixing one memory-leaking for flow_ebos running 2p case. --- opm/autodiff/StandardWell_impl.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opm/autodiff/StandardWell_impl.hpp b/opm/autodiff/StandardWell_impl.hpp index 9aa7956f8..c86e60b94 100644 --- a/opm/autodiff/StandardWell_impl.hpp +++ b/opm/autodiff/StandardWell_impl.hpp @@ -1476,8 +1476,10 @@ namespace Opm const double tol_wells = param.tolerance_wells_; const double maxResidualAllowed = param.max_residual_allowed_; + // TODO: it should be the number of numWellEq + // using numComp here for flow_ebos running 2p case. std::vector res(numComp); - for (int comp = 0; comp < numWellEq; ++comp) { + for (int comp = 0; comp < numComp; ++comp) { // magnitude of the residual matters res[comp] = std::abs(resWell_[0][comp]); }