Merge pull request #2204 from joakim-hove/shut-wells-timestep

Evaluate ACTIONX at the end of every timestep
This commit is contained in:
Joakim Hove 2019-12-06 13:29:19 +01:00 committed by GitHub
commit 4ad0074552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 5 deletions

View File

@ -966,7 +966,7 @@ public:
}
#endif // NDEBUG
const auto& simulator = this->simulator();
auto& simulator = this->simulator();
wellModel_.endTimeStep();
if (enableAquifers_)
aquiferModel_.endTimeStep();
@ -987,6 +987,13 @@ public:
bool isSubStep = !EWOMS_GET_PARAM(TypeTag, bool, EnableWriteAllSolutions) && !this->simulator().episodeWillBeOver();
eclWriter_->evalSummaryState(isSubStep);
auto& schedule = simulator.vanguard().schedule();
int episodeIdx = simulator.episodeIndex();
this->applyActions(episodeIdx,
simulator.time() + simulator.timeStepSize(),
schedule,
simulator.vanguard().summaryState());
}
/*!
@ -999,10 +1006,6 @@ public:
const auto& timeMap = schedule.getTimeMap();
int episodeIdx = simulator.episodeIndex();
this->applyActions(episodeIdx + 1,
simulator.time() + simulator.timeStepSize(),
schedule,
simulator.vanguard().summaryState());
// check if we're finished ...
if (episodeIdx + 1 >= static_cast<int>(timeMap.numTimesteps())) {

View File

@ -677,6 +677,18 @@ namespace Opm {
}
}
// Due to ACTIONX the well might have been closed 'behind our back'.
const auto well_status = schedule().getWell(well_name, time_step).getStatus();
if (well_status == Well::Status::SHUT) {
well_state_.shutWell(w);
continue;
}
if (well_status == Well::Status::STOP) {
well_state_.thp()[w] = 0.;
wellIsStopped = true;
}
// Use the pvtRegionIdx from the top cell
const int well_cell_top = well_perf_data_[w][0].cell_index;
const int pvtreg = pvt_region_idx_[well_cell_top];