diff --git a/opm/simulators/wells/WellState.cpp b/opm/simulators/wells/WellState.cpp index 7bb85c670..b792362e3 100644 --- a/opm/simulators/wells/WellState.cpp +++ b/opm/simulators/wells/WellState.cpp @@ -42,6 +42,7 @@ void WellState::base_init(const std::vector& cellPressures, this->wellMap_.clear(); this->perfpress_.clear(); this->perf_skin_pressure_.clear(); + this->perf_water_throughput_.clear(); this->perfrates_.clear(); this->status_.clear(); this->well_perf_data_.clear(); @@ -103,6 +104,7 @@ void WellState::initSingleWell(const std::vector& cellPressures, this->perfpress_.add(well.name(), std::vector(num_perf_this_well, -1e100)); this->perfrates_.add(well.name(), std::vector(num_perf_this_well, 0)); this->perf_skin_pressure_.add(well.name(), std::vector(num_perf_this_well, 0)); + this->perf_water_throughput_.add(well.name(), std::vector(num_perf_this_well, 0)); this->bhp_.add(well.name(), 0.0); this->thp_.add(well.name(), 0.0); if ( well.isInjector() ) @@ -282,8 +284,6 @@ void WellState::init(const std::vector& cellPressures, perfphaserates_.resize(nperf * this->numPhases(), 0.0); // these are only used to monitor the injectivity - perf_water_throughput_.clear(); - perf_water_throughput_.resize(nperf, 0.0); perf_water_velocity_.clear(); perf_water_velocity_.resize(nperf, 0.0); @@ -481,18 +481,16 @@ void WellState::init(const std::vector& cellPressures, if (pu.has_polymermw) { if (global_num_perf_same) { - auto * throughput_target = this->perfThroughput(newIndex); auto * velocity_target = this->perfWaterVelocity(newIndex); - const auto * throughput_src = prevState->perfThroughput(oldIndex); const auto * velocity_src = prevState->perfWaterVelocity(oldIndex); for (int perf = 0; perf < num_perf_this_well; ++perf) { - throughput_target[ perf ] = throughput_src[perf]; velocity_target[ perf ] = velocity_src[perf]; } this->perf_skin_pressure_.copy_welldata(prevState->perf_skin_pressure_, wname); + this->perf_water_throughput_.copy_welldata(prevState->perf_water_throughput_, wname); } } diff --git a/opm/simulators/wells/WellState.hpp b/opm/simulators/wells/WellState.hpp index 4d9151834..11addf1d0 100644 --- a/opm/simulators/wells/WellState.hpp +++ b/opm/simulators/wells/WellState.hpp @@ -258,12 +258,12 @@ public: return well_potentials_; } - double * perfThroughput(std::size_t well_index) { - return &perf_water_throughput_[this->first_perf_index_[well_index]]; + std::vector& perfThroughput(std::size_t well_index) { + return perf_water_throughput_[well_index]; } - const double * perfThroughput(std::size_t well_index) const { - return &perf_water_throughput_[this->first_perf_index_[well_index]]; + const std::vector& perfThroughput(std::size_t well_index) const { + return perf_water_throughput_[well_index]; } std::vector& perfSkinPressure(std::size_t well_index) { @@ -461,7 +461,7 @@ private: // it is the throughput of water flow through the perforations // it is used as a measure of formation damage around well-bore due to particle deposition // it will only be used for injectors to check the injectivity - std::vector perf_water_throughput_; + WellContainer> perf_water_throughput_; // skin pressure of peforation // it will only be used for injectors to check the injectivity