diff --git a/opm/autodiff/MultisegmentWell_impl.hpp b/opm/autodiff/MultisegmentWell_impl.hpp index 4875412b4..6b3e013cf 100644 --- a/opm/autodiff/MultisegmentWell_impl.hpp +++ b/opm/autodiff/MultisegmentWell_impl.hpp @@ -218,8 +218,11 @@ namespace Opm bool only_wells) { // clear all entries - duneB_ = 0.0; - duneC_ = 0.0; + if (!only_wells) { + duneB_ = 0.0; + duneC_ = 0.0; + } + duneD_ = 0.0; resWell_ = 0.0; diff --git a/opm/autodiff/StandardWell_impl.hpp b/opm/autodiff/StandardWell_impl.hpp index 6ab71868b..e420ea967 100644 --- a/opm/autodiff/StandardWell_impl.hpp +++ b/opm/autodiff/StandardWell_impl.hpp @@ -522,8 +522,10 @@ namespace Opm const int np = number_of_phases_; // clear all entries - duneB_ = 0.0; - duneC_ = 0.0; + if (!only_wells) { + duneB_ = 0.0; + duneC_ = 0.0; + } invDuneD_ = 0.0; resWell_ = 0.0;