Reflect Well Object's Status Flag in Well State

This commit is contained in:
Joakim Hove 2020-12-09 11:16:15 +01:00 committed by Bård Skaflestad
parent e2d75b608b
commit f0c738ea34
2 changed files with 23 additions and 0 deletions

View File

@ -398,9 +398,15 @@ namespace Opm
: (prod_controls.cmode == Well::ProducerCMode::GRUP);
const double inj_surf_rate = well.isInjector() ? inj_controls.surface_rate : 0.0; // To avoid a "maybe-uninitialized" warning.
const double local_pressure = well_perf_data_[w].empty() ?
0 : cellPressures[well_perf_data_[w][0].cell_index];
const double global_pressure = well_info.broadcastFirstPerforationValue(local_pressure);
if (well.getStatus() == Well::Status::OPEN) {
this->openWell(w);
}
if (well.getStatus() == Well::Status::STOP) {
// Stopped well:
// 1. Rates: zero well rates.

View File

@ -190,6 +190,23 @@ namespace Opm
perfRateBrine_.clear();
perfRateBrine_.resize(nperf, 0.0);
for (int w = 0; w < nw; ++w) {
switch (wells_ecl[w].getStatus()) {
case Well::Status::SHUT:
this->shutWell(w);
break;
case Well::Status::STOP:
this->stopWell(w);
break;
default:
this->openWell(w);
break;
}
}
// intialize wells that have been there before
// order may change so the mapping is based on the well name
if (prevState && !prevState->wellMap().empty()) {