fixing different well number between Wells and Well_containers

when the solveWellEq did not get converged.
This commit is contained in:
Kai Bao 2018-11-13 16:11:39 +01:00
parent 2ed2c20f12
commit 8f56634b69

View File

@ -712,7 +712,6 @@ namespace Opm {
BlackoilWellModel<TypeTag>::
solveWellEq(const double dt)
{
const int nw = numWells();
WellState well_state0 = well_state_;
const int numComp = numComponents();
@ -767,9 +766,10 @@ namespace Opm {
well_state_ = well_state0;
updatePrimaryVariables();
// also recover the old well controls
for (int w = 0; w < nw; ++w) {
WellControls* wc = well_container_[w]->wellControls();
well_controls_set_current(wc, well_state_.currentControls()[w]);
for (const auto& well : well_container_) {
const int index_of_well = well->indexOfWell();
WellControls* wc = well->wellControls();
well_controls_set_current(wc, well_state_.currentControls()[index_of_well]);
}
}