diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 3a6dc1317..fab9883f9 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -580,8 +580,9 @@ namespace Opm std::transform(src, src + np, dest, dest, std::plus<>{}); }; + auto& perf_data = well_state.perfData(this->index_of_well_); auto* wellPI = well_state.productivityIndex(this->index_of_well_).data(); - auto* connPI = well_state.connectionProductivityIndex(this->index_of_well_).data(); + auto* connPI = perf_data.prod_index.data(); setToZero(wellPI); diff --git a/opm/simulators/wells/PerfData.cpp b/opm/simulators/wells/PerfData.cpp index 907b86f91..121886c29 100644 --- a/opm/simulators/wells/PerfData.cpp +++ b/opm/simulators/wells/PerfData.cpp @@ -32,7 +32,7 @@ PerfData::PerfData(std::size_t num_perf, const PhaseUsage& pu_arg): solvent_rates(num_perf), polymer_rates(num_perf), brine_rates(num_perf), - prod_index(num_perf), + prod_index(num_perf * pu.num_phases), water_throughput(num_perf), skin_pressure(num_perf), water_velocity(num_perf) diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index 053ad0330..60ab48a59 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -1072,8 +1072,9 @@ namespace Opm std::transform(src, src + np, dest, dest, std::plus<>{}); }; + auto& perf_data = well_state.perfData(this->index_of_well_); auto* wellPI = well_state.productivityIndex(this->index_of_well_).data(); - auto* connPI = well_state.connectionProductivityIndex(this->index_of_well_).data(); + auto* connPI = perf_data.prod_index.data(); setToZero(wellPI); diff --git a/opm/simulators/wells/WellState.cpp b/opm/simulators/wells/WellState.cpp index addd920b3..b652ad74a 100644 --- a/opm/simulators/wells/WellState.cpp +++ b/opm/simulators/wells/WellState.cpp @@ -51,7 +51,6 @@ void WellState::base_init(const std::vector& cellPressures, this->segment_state.clear(); this->well_potentials_.clear(); this->productivity_index_.clear(); - this->conn_productivity_index_.clear(); { // const int nw = wells->number_of_wells; const int nw = wells_ecl.size(); @@ -105,7 +104,6 @@ void WellState::initSingleWell(const std::vector& cellPressures, this->bhp_.add(well.name(), 0.0); this->thp_.add(well.name(), 0.0); this->productivity_index_.add(well.name(), std::vector(np, 0)); - this->conn_productivity_index_.add(well.name(), std::vector(num_perf_this_well * np, 0)); if ( well.isInjector() ) this->temperature_.add(well.name(), well.injectionControls(summary_state).temperature); else @@ -687,7 +685,7 @@ void WellState::reportConnections(data::Well& well, } for( auto& comp : well.connections) { const auto * rates = &perf_data.phase_rates[np*local_comp_index]; - const auto& connPI = this->connectionProductivityIndex(well_index); + const auto& connPI = perf_data.prod_index; for( int i = 0; i < np; ++i ) { comp.rates.set( phs[ i ], rates[i] ); @@ -908,7 +906,8 @@ void WellState::shutWell(int well_index) wpi[p] = 0.0; } - auto& connpi = this->conn_productivity_index_[well_index]; + auto& perf_data = this->perfData(well_index); + auto& connpi = perf_data.prod_index; connpi.assign(connpi.size(), 0); } diff --git a/opm/simulators/wells/WellState.hpp b/opm/simulators/wells/WellState.hpp index 06e4e9a71..71a3af9a8 100644 --- a/opm/simulators/wells/WellState.hpp +++ b/opm/simulators/wells/WellState.hpp @@ -202,15 +202,6 @@ public: return this->productivity_index_[well_index]; } - std::vector& connectionProductivityIndex(std::size_t well_index) { - return this->conn_productivity_index_[well_index]; - } - - const std::vector& connectionProductivityIndex(std::size_t well_index) const { - return this->conn_productivity_index_[well_index]; - } - - std::vector& wellPotentials(std::size_t well_index) { return this->well_potentials_[well_index]; } @@ -409,9 +400,6 @@ private: // Productivity Index WellContainer> productivity_index_; - // Connection-level Productivity Index - WellContainer> conn_productivity_index_; - // Well potentials WellContainer> well_potentials_;