mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-01 12:06:54 -06:00
Merge pull request #3055 from joakim-hove/wellpi-update-connections
Extract functionality to update ecl_well
This commit is contained in:
commit
4f112e443f
@ -480,6 +480,7 @@ namespace Opm {
|
||||
|
||||
void setWsolvent(const Group& group, const Schedule& schedule, const int reportStepIdx, double wsolvent);
|
||||
|
||||
void updateEclWell(int timeStepIdx, int well_index);
|
||||
void runWellPIScaling(const int timeStepIdx, DeferredLogger& local_deferredLogger);
|
||||
|
||||
void assignWellGuideRates(data::Wells& wsrpt) const;
|
||||
|
@ -2551,6 +2551,32 @@ namespace Opm {
|
||||
|
||||
|
||||
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
updateEclWell(int timeStepIdx, int well_index)
|
||||
{
|
||||
const auto& schedule = this->ebosSimulator_.vanguard().schedule();
|
||||
const auto& wname = this->wells_ecl_[well_index].name();
|
||||
this->wells_ecl_[well_index] = schedule.getWell(wname, timeStepIdx);
|
||||
|
||||
const auto& well = this->wells_ecl_[well_index];
|
||||
auto& pd = this->well_perf_data_[well_index];
|
||||
auto pdIter = pd.begin();
|
||||
for (const auto& conn : well.getConnections()) {
|
||||
if (conn.state() != Connection::State::SHUT) {
|
||||
pdIter->connection_transmissibility_factor = conn.CF();
|
||||
++pdIter;
|
||||
}
|
||||
}
|
||||
|
||||
this->well_state_.resetConnectionTransFactors(well_index, pd);
|
||||
this->prod_index_calc_[well_index].reInit(well);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
@ -2607,23 +2633,9 @@ namespace Opm {
|
||||
{
|
||||
const auto& wname = this->wells_ecl_[well_index].name();
|
||||
auto& schedule = this->ebosSimulator_.vanguard().schedule(); // Mutable
|
||||
|
||||
schedule.applyWellProdIndexScaling(wname, timeStepIdx, newWellPI);
|
||||
this->wells_ecl_[well_index] = schedule.getWell(wname, timeStepIdx);
|
||||
}
|
||||
|
||||
const auto& well = this->wells_ecl_[well_index];
|
||||
auto& pd = this->well_perf_data_[well_index];
|
||||
auto pdIter = pd.begin();
|
||||
for (const auto& conn : well.getConnections()) {
|
||||
if (conn.state() != Connection::State::SHUT) {
|
||||
pdIter->connection_transmissibility_factor = conn.CF();
|
||||
++pdIter;
|
||||
}
|
||||
}
|
||||
|
||||
this->well_state_.resetConnectionTransFactors(well_index, pd);
|
||||
this->prod_index_calc_[well_index].reInit(well);
|
||||
this->updateEclWell(timeStepIdx, well_index);
|
||||
};
|
||||
|
||||
// Minimal well setup to compute PI/II values
|
||||
@ -2645,7 +2657,6 @@ namespace Opm {
|
||||
}
|
||||
|
||||
this->calculateProductivityIndexValues(local_deferredLogger);
|
||||
|
||||
this->previous_well_state_ = std::move(saved_previous_well_state);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user