Merge pull request #3647 from joakim-hove/update-rates-after-actionx

Update rates after actionx
This commit is contained in:
Joakim Hove
2021-11-05 12:01:22 +01:00
committed by GitHub
5 changed files with 15 additions and 3 deletions

View File

@@ -1317,7 +1317,7 @@ public:
const auto& wellpi = this->fetchWellPI(reportStep, *action, schedule, matching_wells);
auto affected_wells = schedule.applyAction(reportStep, TimeService::from_time_t(simTime), *action, actionResult, wellpi);
this->wellModel_.updateEclWells(reportStep, affected_wells);
this->wellModel_.updateEclWells(reportStep, affected_wells, summaryState);
if (!affected_wells.empty())
commit_wellstate = true;
actionState.add_run(*action, simTime, std::move(actionResult));

View File

@@ -1447,7 +1447,8 @@ actionOnBrokenConstraints(const Group& group,
void
BlackoilWellModelGeneric::
updateEclWells(const int timeStepIdx,
const std::unordered_set<std::string>& wells)
const std::unordered_set<std::string>& wells,
const SummaryState& st)
{
for (const auto& wname : wells) {
auto well_iter = std::find_if(this->wells_ecl_.begin(), this->wells_ecl_.end(),
@@ -1476,6 +1477,7 @@ updateEclWells(const int timeStepIdx,
ws.updateStatus( well.getStatus() );
ws.reset_connection_factors(pd);
ws.update_targets(well, st);
this->prod_index_calc_[well_index].reInit(well);
}
}

View File

@@ -128,7 +128,8 @@ public:
double wellPI(const std::string& well_name) const;
void updateEclWells(const int timeStepIdx,
const std::unordered_set<std::string>& wells);
const std::unordered_set<std::string>& wells,
const SummaryState& st);
void loadRestartData(const data::Wells& rst_wells,

View File

@@ -251,6 +251,14 @@ void SingleWellState::update_injector_targets(const Well& ecl_well, const Summar
else
this->bhp = this->perf_data.pressure_first_connection * bhp_safety_factor;
}
void SingleWellState::update_targets(const Well& ecl_well, const SummaryState& st) {
if (this->producer)
this->update_producer_targets(ecl_well, st);
else
this->update_injector_targets(ecl_well, st);
}
}

View File

@@ -76,6 +76,7 @@ public:
void reset_connection_factors(const std::vector<PerforationData>& new_perf_data);
void update_producer_targets(const Well& ecl_well, const SummaryState& st);
void update_injector_targets(const Well& ecl_well, const SummaryState& st);
void update_targets(const Well& ecl_well, const SummaryState& st);
void updateStatus(Well::Status status);
void init_timestep(const SingleWellState& other);
void shut();