diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index 724be5820..ab4892b14 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -156,6 +156,15 @@ namespace Opm { { OPM_THROW(std::logic_error,"solver down cast to ISTLSolver failed"); } + + if ( param_.matrix_add_well_contributions_ ) + { + // This might be dangerous?! + ebosSimulator_.model().clearAuxiliaryModules(); + auto auxMod = std::make_shared >( wellModel().wells() ); + ebosSimulator_.model().addAuxiliaryModule(auxMod); + } + } bool isParallel() const @@ -354,15 +363,6 @@ namespace Opm { SimulatorReport assemble(const SimulatorTimerInterface& timer, const int iterationIdx) { - if ( param_.matrix_add_well_contributions_ ) - { - // This might be dangerous?! - ebosSimulator_.model().clearAuxiliaryModules(); - auto auxMod = std::make_shared >( wellModel().wells() ); - ebosSimulator_.model().addAuxiliaryModule(auxMod); - } - - // -------- Mass balance equations -------- ebosSimulator_.model().newtonMethod().setIterationIndex(iterationIdx); ebosSimulator_.problem().beginIteration();