Merge pull request #5613 from steink/Disallow-switcing-to-group-controls-in-local-well-solves

Testing: Disallow switcing to group controls during local well solves
This commit is contained in:
Kai Bao
2024-09-19 14:13:52 +02:00
committed by GitHub

View File

@@ -279,7 +279,6 @@ namespace Opm
const bool fixed_status) const bool fixed_status)
{ {
const auto& summary_state = simulator.vanguard().summaryState(); const auto& summary_state = simulator.vanguard().summaryState();
const auto& schedule = simulator.vanguard().schedule();
auto& ws = well_state.well(this->index_of_well_); auto& ws = well_state.well(this->index_of_well_);
std::string from; std::string from;
if (this->isInjector()) { if (this->isInjector()) {
@@ -301,13 +300,18 @@ namespace Opm
} else { } else {
bool changed = false; bool changed = false;
if (!fixed_control) { if (!fixed_control) {
const bool hasGroupControl = this->isInjector() ? inj_controls.hasControl(Well::InjectorCMode::GRUP) : // We don't allow changing to group controls here since this may lead to inconsistencies
prod_controls.hasControl(Well::ProducerCMode::GRUP); // in the group handling which in turn may result in excessive back and forth switching.
// If we are to allow this change, one needs to make sure all necessary information propagates
// properly, but for now, we simply disallow it. The commented code below is kept for future reference
// const bool hasGroupControl = this->isInjector() ? inj_controls.hasControl(Well::InjectorCMode::GRUP) :
// prod_controls.hasControl(Well::ProducerCMode::GRUP);
changed = this->checkIndividualConstraints(ws, summary_state, deferred_logger, inj_controls, prod_controls); changed = this->checkIndividualConstraints(ws, summary_state, deferred_logger, inj_controls, prod_controls);
if (hasGroupControl) { // if (hasGroupControl) {
changed = changed || this->checkGroupConstraints(well_state, group_state, schedule, summary_state,deferred_logger); // changed = changed || this->checkGroupConstraints(well_state, group_state, schedule, summary_state,deferred_logger);
} // }
if (changed) { if (changed) {
const bool thp_controlled = this->isInjector() ? ws.injection_cmode == Well::InjectorCMode::THP : const bool thp_controlled = this->isInjector() ? ws.injection_cmode == Well::InjectorCMode::THP :