mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3771 from totto82/fixUpdateGR
Update guiderates after with new rates from newly opened wells
This commit is contained in:
commit
9fc9f5421c
@ -2377,14 +2377,28 @@ runWellPIScaling(const int timeStepIdx,
|
||||
|
||||
bool
|
||||
BlackoilWellModelGeneric::
|
||||
guideRateUpdateIsNeeded() const {
|
||||
const auto need_update =
|
||||
guideRateUpdateIsNeeded(const int reportStepIdx) const {
|
||||
auto need_update =
|
||||
std::any_of(this->well_container_generic_.begin(),
|
||||
this->well_container_generic_.end(),
|
||||
[](const WellInterfaceGeneric* well)
|
||||
{
|
||||
return well->changedToOpenThisStep();
|
||||
});
|
||||
if (!need_update && this->report_step_starts_) {
|
||||
const auto& events = this->schedule()[reportStepIdx].wellgroup_events();
|
||||
const auto effective_events_mask = ScheduleEvents::WELL_STATUS_CHANGE
|
||||
+ ScheduleEvents::INJECTION_TYPE_CHANGED
|
||||
+ ScheduleEvents::WELL_SWITCHED_INJECTOR_PRODUCER
|
||||
+ ScheduleEvents::NEW_WELL;
|
||||
|
||||
need_update = std::any_of(this->well_container_generic_.begin(),
|
||||
this->well_container_generic_.end(),
|
||||
[&events, effective_events_mask](const WellInterfaceGeneric* well)
|
||||
{
|
||||
return events.hasEvent(well->name(), effective_events_mask);
|
||||
});
|
||||
}
|
||||
return this->comm_.max(static_cast<int>(need_update));
|
||||
}
|
||||
|
||||
|
@ -396,7 +396,7 @@ protected:
|
||||
const SummaryConfig& summaryConfig,
|
||||
DeferredLogger& deferred_logger);
|
||||
|
||||
bool guideRateUpdateIsNeeded() const;
|
||||
bool guideRateUpdateIsNeeded(const int reportStepIdx) const;
|
||||
|
||||
// create the well container
|
||||
virtual void createWellContainer(const int time_step) = 0;
|
||||
|
@ -842,8 +842,8 @@ namespace Opm {
|
||||
terminal_output_, grid().comm());
|
||||
|
||||
//update guide rates
|
||||
if (guideRateUpdateIsNeeded()) {
|
||||
const int reportStepIdx = ebosSimulator_.episodeIndex();
|
||||
const int reportStepIdx = ebosSimulator_.episodeIndex();
|
||||
if (guideRateUpdateIsNeeded(reportStepIdx)) {
|
||||
const double simulationTime = ebosSimulator_.time();
|
||||
const auto& comm = ebosSimulator_.vanguard().grid().comm();
|
||||
const auto& summaryState = ebosSimulator_.vanguard().summaryState();
|
||||
|
Loading…
Reference in New Issue
Block a user