From 4b47fa52ca9f813d750d91ef834ef55d42a52e7c Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Mon, 9 Jan 2017 10:36:17 +0100 Subject: [PATCH] adding well collection to StandardWellsDense to make StandardWellsDense have access to the group information. --- .../SimulatorFullyImplicitBlackoilEbos.hpp | 2 +- opm/autodiff/StandardWellsDense.hpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp index c0673ccf8..bee75fae6 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp @@ -252,7 +252,7 @@ public: // Run a multiple steps of the solver depending on the time step control. solver_timer.start(); - const WellModel well_model(wells, model_param_, terminal_output_); + const WellModel well_model(wells, &(wells_manager.wellCollection()), model_param_, terminal_output_); auto solver = createSolver(well_model); diff --git a/opm/autodiff/StandardWellsDense.hpp b/opm/autodiff/StandardWellsDense.hpp index 248845d41..1457b9a49 100644 --- a/opm/autodiff/StandardWellsDense.hpp +++ b/opm/autodiff/StandardWellsDense.hpp @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -81,10 +82,12 @@ enum WellVariablePositions { // --------- Public methods --------- StandardWellsDense(const Wells* wells_arg, + WellCollection* well_collection, const ModelParameters& param, const bool terminal_output) : wells_active_(wells_arg!=nullptr) , wells_(wells_arg) + , well_collection_(well_collection) , param_(param) , terminal_output_(terminal_output) , well_perforation_densities_( wells_ ? wells_arg->well_connpos[wells_arg->number_of_wells] : 0) @@ -1575,9 +1578,22 @@ enum WellVariablePositions { } + + + + WellCollection* wellCollection() const + { + return well_collection_; + } + + protected: bool wells_active_; const Wells* wells_; + + // Well collection is used to enforce the group control + WellCollection* well_collection_; + ModelParameters param_; bool terminal_output_;