adding a pointer to the well_collection of WellsManger

might change to reference later. Using pointer now is trying to keep the
WellModel constant.
This commit is contained in:
Kai Bao 2016-09-30 12:57:24 +02:00
parent 6df917e9e0
commit f62d40fc05
3 changed files with 16 additions and 3 deletions

View File

@ -200,7 +200,7 @@ namespace Opm
// Run a multiple steps of the solver depending on the time step control.
solver_timer.start();
const WellModel well_model(wells);
const WellModel well_model(wells, &(wells_manager.wellCollection()));
std::unique_ptr<Solver> solver = asImpl().createSolver(well_model);

View File

@ -38,6 +38,7 @@
#include <opm/core/wells.h>
#include <opm/core/wells/DynamicListEconLimited.hpp>
#include <opm/core/wells/WellCollection.hpp>
#include <opm/autodiff/AutoDiffBlock.hpp>
#include <opm/autodiff/AutoDiffHelpers.hpp>
#include <opm/autodiff/BlackoilPropsAdInterface.hpp>
@ -70,7 +71,7 @@ namespace Opm {
Eigen::Dynamic,
Eigen::RowMajor>;
// --------- Public methods ---------
explicit StandardWells(const Wells* wells_arg);
StandardWells(const Wells* wells_arg, const WellCollection* well_collection);
void init(const BlackoilPropsAdInterface* fluid_arg,
const std::vector<bool>* active_arg,
@ -194,6 +195,8 @@ namespace Opm {
bool wells_active_;
const Wells* wells_;
const WellOps wops_;
// TODO: It will probably need to be updated during running time.
const WellCollection* well_collection_;
const BlackoilPropsAdInterface* fluid_;
const std::vector<bool>* active_;

View File

@ -71,10 +71,11 @@ namespace Opm
StandardWells::StandardWells(const Wells* wells_arg)
StandardWells::StandardWells(const Wells* wells_arg, const WellCollection* well_collection)
: wells_active_(wells_arg!=nullptr)
, wells_(wells_arg)
, wops_(wells_arg)
, well_collection_(well_collection)
, fluid_(nullptr)
, active_(nullptr)
, phase_condition_(nullptr)
@ -740,6 +741,15 @@ StandardWells::StandardWells(const Wells* wells_arg)
break;
}
}
// TODO: when constraints got broken. For a well under group control, we need to change it to individual control
// We need to check the controls in the same group. If there is still some wells under group control,
// we need to update their group share targets. If no well is under group control, it means the group target
// will not be able to meet. We need to give a message there.
// It is better to wait until after the limit check loop. We need to record whose control status changed
// from group control to individual control here.
// Not sure exactly how the well go back from the individual control to group control.
// A guess is that the target is not updated. It works as a limit. When it got broken again, it switch back to
// group control. Then we also need to do something there.
if (ctrl_index != nwc) {
// Constraint number ctrl_index was broken, switch to it.
// We disregard terminal_ouput here as with it only messages