Use PerfData for solvent perforation rates

This commit is contained in:
Joakim Hove 2021-06-07 08:34:38 +02:00
parent 49e9b51269
commit db02b9f112
3 changed files with 5 additions and 29 deletions

View File

@ -240,7 +240,7 @@ namespace Opm
// Store the perforation phase flux for later usage.
if (has_solvent && componentIdx == contiSolventEqIdx) {
auto& perf_rate_solvent = well_state.perfRateSolvent(this->index_of_well_);
auto& perf_rate_solvent = perf_data.solvent_rates;
perf_rate_solvent[perf] = cq_s[componentIdx].value();
} else {
perf_rates[perf*np + ebosCompIdxToFlowCompIdx(componentIdx)] = cq_s[componentIdx].value();
@ -440,7 +440,7 @@ namespace Opm
const double dis_gas_frac = perf_dis_gas_rate / cq_s_zfrac_effective.value();
cq_s_zfrac_effective *= this->extendEval(dis_gas_frac*intQuants.xVolume() + (1.0-dis_gas_frac)*intQuants.yVolume());
}
auto& perf_rate_solvent = well_state.perfRateSolvent(this->index_of_well_);
auto& perf_rate_solvent = perf_data.solvent_rates;
perf_rate_solvent[perf] = cq_s_zfrac_effective.value();
cq_s_zfrac_effective *= well_efficiency_factor_;
@ -1144,7 +1144,7 @@ namespace Opm
}
if constexpr (has_solvent) {
const auto& solvent_perf_rates_state = well_state.perfRateSolvent(this->index_of_well_);
const auto& solvent_perf_rates_state = perf_data.solvent_rates;
for (int perf = 0; perf < nperf; ++perf) {
perfRates[perf * num_components_ + contiSolventEqIdx] = solvent_perf_rates_state[perf];
}

View File

@ -44,7 +44,6 @@ void WellState::base_init(const std::vector<double>& cellPressures,
this->perf_skin_pressure_.clear();
this->perf_water_throughput_.clear();
this->perf_water_velocity_.clear();
this->perfRateSolvent_.clear();
this->status_.clear();
this->well_perf_data_.clear();
this->parallel_well_info_.clear();
@ -105,13 +104,10 @@ void WellState::initSingleWell(const std::vector<double>& cellPressures,
this->well_potentials_.add(well.name(), std::vector<double>(np, 0));
const int num_perf_this_well = well_info->communication().sum(well_perf_data_[w].size());
this->segment_state.add(well.name(), SegmentState{});
this->perfdata.add(well.name(), PerfData{num_perf_this_well, this->phase_usage_});
this->perfdata.add(well.name(), PerfData{static_cast<std::size_t>(num_perf_this_well), this->phase_usage_});
this->perf_skin_pressure_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
this->perf_water_velocity_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
this->perf_water_throughput_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
this->perfRateSolvent_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
this->perfRateBrine_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
this->perfdata.add(well.name(), PerfData{static_cast<std::size_t>(num_perf_this_well), this->phase_usage_});
this->bhp_.add(well.name(), 0.0);
this->thp_.add(well.name(), 0.0);
this->productivity_index_.add(well.name(), std::vector<double>(np, 0));
@ -298,7 +294,6 @@ void WellState::init(const std::vector<double>& cellPressures,
const int num_perf_this_well = well_info[2];
const int global_num_perf_this_well = ecl_well.getConnections().num_open();
auto& perf_data = this->perfData(w);
auto& phase_rates = perf_data.phase_rates;
for (int perf = 0; perf < num_perf_this_well; ++perf) {
if (wells_ecl[w].getStatus() == Well::Status::OPEN) {
@ -435,7 +430,7 @@ void WellState::init(const std::vector<double>& cellPressures,
}
}
// perfPressures
// perf data
if (global_num_perf_same)
{
auto& perf_data = this->perfData(w);
@ -443,14 +438,6 @@ void WellState::init(const std::vector<double>& cellPressures,
perf_data.try_assign( prev_perf_data );
}
// perfSolventRates
if (pu.has_solvent) {
if (global_num_perf_same)
{
this->perfRateSolvent_.copy_welldata(prevState->perfRateSolvent_, wname);
}
}
// polymer injectivity related
//
// here we did not consider the case that we close

View File

@ -144,15 +144,6 @@ public:
return this->events_[well_index];
}
/// One rate pr well connection.
std::vector<double>& perfRateSolvent(std::size_t well_index) {
return this->perfRateSolvent_[well_index];
}
const std::vector<double>& perfRateSolvent(std::size_t well_index) const {
return this->perfRateSolvent_[well_index];
}
/// One rate pr well
double solventWellRate(const int w) const;
@ -421,8 +412,6 @@ private:
std::map<std::string, std::pair<bool, std::vector<double>>> well_rates;
WellContainer<std::vector<double>> perfRateSolvent_;
// 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