Merge pull request #5748 from steink/Only-update-targets-for-relevant-controls

Only update target of group-controlled wells during updateAndCommunicate
This commit is contained in:
Tor Harald Sandve 2024-11-25 15:30:32 +01:00 committed by GitHub
commit b4fe429b35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2440,8 +2440,12 @@ namespace Opm {
OPM_BEGIN_PARALLEL_TRY_CATCH()
// if a well or group change control it affects all wells that are under the same group
for (const auto& well : well_container_) {
well->updateWellStateWithTarget(simulator_, this->groupState(),
this->wellState(), deferred_logger);
// We only want to update wells under group-control here
auto& ws = this->wellState().well(well->indexOfWell());
if (ws.production_cmode == Well::ProducerCMode::GRUP || ws.injection_cmode == Well::InjectorCMode::GRUP) {
well->updateWellStateWithTarget(simulator_, this->groupState(),
this->wellState(), deferred_logger);
}
}
OPM_END_PARALLEL_TRY_CATCH("BlackoilWellModel::updateAndCommunicate failed: ",
simulator_.gridView().comm())