From 093310c437dabd063be1de823a3afb587307f566 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Fri, 17 Mar 2017 11:39:41 +0100 Subject: [PATCH] BlackoilModelEbos: apply the well residual in assemble() This used to be done in solveJacobianSystem(), but this method is only supposed to solve the linearized system of equations, not to modify it IMO. I tested this patch with Norne: It did not change anything. --- opm/autodiff/BlackoilModelEbos.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index 36b852014..e15f03171 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -377,6 +377,10 @@ namespace Opm { try { report = wellModel().assemble(ebosSimulator_, iterationIdx, dt, well_state); + + // apply well residual to the residual. + auto& ebosResid = ebosSimulator_.model().linearizer().residual(); + wellModel().apply(ebosResid); } catch ( const Dune::FMatrixError& e ) { @@ -460,12 +464,6 @@ namespace Opm { const auto& ebosJac = ebosSimulator_.model().linearizer().matrix(); auto& ebosResid = ebosSimulator_.model().linearizer().residual(); - if( xw.size() > 0 ) - { - // apply well residual to the residual. - wellModel().apply(ebosResid); - } - // set initial guess x = 0.0;