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