From 31ce880ba7c6e75c68580b6ae75e37d5d681975d Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Tue, 8 Aug 2017 12:30:24 +0200 Subject: [PATCH] fixing the prallel running. It needs WellSwitchingLogger for all the processes even there are not wells in some of the processes. --- opm/autodiff/StandardWell.hpp | 3 ++- opm/autodiff/StandardWell_impl.hpp | 4 ++-- opm/autodiff/StandardWellsDense_impl.hpp | 4 +++- opm/autodiff/WellInterface.hpp | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/opm/autodiff/StandardWell.hpp b/opm/autodiff/StandardWell.hpp index 17062fd54..47cbe1805 100644 --- a/opm/autodiff/StandardWell.hpp +++ b/opm/autodiff/StandardWell.hpp @@ -131,7 +131,8 @@ namespace Opm // TODO: this should go to the WellInterface, while updateWellStateWithTarget // will need touch different types of well_state, we will see. - virtual void updateWellControl(WellState& xw) const; + virtual void updateWellControl(WellState& xw, + wellhelpers::WellSwitchingLogger& logger) const; /// check whether the well equations get converged for this well virtual bool getWellConvergence(Simulator& ebosSimulator, diff --git a/opm/autodiff/StandardWell_impl.hpp b/opm/autodiff/StandardWell_impl.hpp index 2d9098dae..8c48ecfeb 100644 --- a/opm/autodiff/StandardWell_impl.hpp +++ b/opm/autodiff/StandardWell_impl.hpp @@ -1269,7 +1269,8 @@ namespace Opm template void StandardWell:: - updateWellControl(WellState& xw) const + updateWellControl(WellState& xw, + wellhelpers::WellSwitchingLogger& logger) const { const int np = number_of_phases_; const int nw = xw.bhp().size(); @@ -1329,7 +1330,6 @@ namespace Opm const int updated_control_index = xw.currentControls()[w]; // checking whether control changed - wellhelpers::WellSwitchingLogger logger; if (updated_control_index != old_control_index) { logger.wellSwitched(name_, well_controls_iget_type(wc, old_control_index), diff --git a/opm/autodiff/StandardWellsDense_impl.hpp b/opm/autodiff/StandardWellsDense_impl.hpp index ee5124477..7bc1cb11c 100644 --- a/opm/autodiff/StandardWellsDense_impl.hpp +++ b/opm/autodiff/StandardWellsDense_impl.hpp @@ -657,8 +657,10 @@ namespace Opm { // we simply return. if( !wellsActive() ) return ; + wellhelpers::WellSwitchingLogger logger; + for (const auto& well : well_container_) { - well->updateWellControl(xw); + well->updateWellControl(xw, logger); } } diff --git a/opm/autodiff/WellInterface.hpp b/opm/autodiff/WellInterface.hpp index eb076cc37..68b2918ea 100644 --- a/opm/autodiff/WellInterface.hpp +++ b/opm/autodiff/WellInterface.hpp @@ -151,7 +151,8 @@ namespace Opm virtual void updateWellStateWithTarget(const int current, WellState& xw) const = 0; - virtual void updateWellControl(WellState& xw) const = 0; + virtual void updateWellControl(WellState& xw, + wellhelpers::WellSwitchingLogger& logger) const = 0; virtual void setWellSolutions(const WellState& well_state) const = 0;