mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3212 from joakim-hove/num-connections
Store the number of connections in separate vector
This commit is contained in:
commit
a6c7453a24
@ -144,7 +144,8 @@ namespace Opm
|
|||||||
perf_skin_pressure_.clear();
|
perf_skin_pressure_.clear();
|
||||||
perf_skin_pressure_.resize(nperf, 0.0);
|
perf_skin_pressure_.resize(nperf, 0.0);
|
||||||
|
|
||||||
first_perf_index_.resize(nw+1, 0);
|
num_perf_.resize(nw, 0);
|
||||||
|
first_perf_index_.resize(nw, 0);
|
||||||
first_perf_index_[0] = 0;
|
first_perf_index_[0] = 0;
|
||||||
for (int w = 0; w < nw; ++w) {
|
for (int w = 0; w < nw; ++w) {
|
||||||
// Initialize perfphaserates_ to well
|
// Initialize perfphaserates_ to well
|
||||||
@ -163,8 +164,8 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
perfPress()[perf] = cellPressures[well_perf_data[w][perf-connpos].cell_index];
|
perfPress()[perf] = cellPressures[well_perf_data[w][perf-connpos].cell_index];
|
||||||
}
|
}
|
||||||
|
num_perf_[w] = num_perf_this_well;
|
||||||
first_perf_index_[w+1] = connpos + num_perf_this_well;
|
first_perf_index_[w] = connpos;
|
||||||
}
|
}
|
||||||
|
|
||||||
is_producer_.resize(nw, false);
|
is_producer_.resize(nw, false);
|
||||||
@ -824,8 +825,8 @@ namespace Opm
|
|||||||
|
|
||||||
/// One rate pr well
|
/// One rate pr well
|
||||||
double solventWellRate(const int w) const {
|
double solventWellRate(const int w) const {
|
||||||
return parallel_well_info_[w]->sumPerfValues(&perfRateSolvent_[0] + first_perf_index_[w + 0],
|
return parallel_well_info_[w]->sumPerfValues(&perfRateSolvent_[0] + first_perf_index_[w],
|
||||||
&perfRateSolvent_[0] + first_perf_index_[w + 1]);
|
&perfRateSolvent_[0] + first_perf_index_[w] + num_perf_[w]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// One rate pr well connection.
|
/// One rate pr well connection.
|
||||||
@ -834,8 +835,8 @@ namespace Opm
|
|||||||
|
|
||||||
/// One rate pr well
|
/// One rate pr well
|
||||||
double polymerWellRate(const int w) const {
|
double polymerWellRate(const int w) const {
|
||||||
return parallel_well_info_[w]->sumPerfValues(&perfRatePolymer_[0] + first_perf_index_[w + 0],
|
return parallel_well_info_[w]->sumPerfValues(&perfRatePolymer_[0] + first_perf_index_[w],
|
||||||
&perfRatePolymer_[0] + first_perf_index_[w + 1]);
|
&perfRatePolymer_[0] + first_perf_index_[w] + num_perf_[w]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// One rate pr well connection.
|
/// One rate pr well connection.
|
||||||
@ -844,8 +845,8 @@ namespace Opm
|
|||||||
|
|
||||||
/// One rate pr well
|
/// One rate pr well
|
||||||
double brineWellRate(const int w) const {
|
double brineWellRate(const int w) const {
|
||||||
return parallel_well_info_[w]->sumPerfValues(&perfRateBrine_[0] + first_perf_index_[w + 0],
|
return parallel_well_info_[w]->sumPerfValues(&perfRateBrine_[0] + first_perf_index_[w],
|
||||||
&perfRateBrine_[0] + first_perf_index_[w + 1]);
|
&perfRateBrine_[0] + first_perf_index_[w] + num_perf_[w]);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<double>& wellReservoirRates()
|
std::vector<double>& wellReservoirRates()
|
||||||
@ -1000,8 +1001,8 @@ namespace Opm
|
|||||||
wpi[p] = 0.0;
|
wpi[p] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto first = this->first_perf_index_[well_index + 0]*np;
|
const auto first = this->first_perf_index_[well_index]*np;
|
||||||
const auto last = this->first_perf_index_[well_index + 1]*np;
|
const auto last = first + this->num_perf_[well_index]*np;
|
||||||
std::fill(this->conn_productivity_index_.begin() + first,
|
std::fill(this->conn_productivity_index_.begin() + first,
|
||||||
this->conn_productivity_index_.begin() + last, 0.0);
|
this->conn_productivity_index_.begin() + last, 0.0);
|
||||||
}
|
}
|
||||||
@ -1146,8 +1147,9 @@ namespace Opm
|
|||||||
|
|
||||||
// vector with size number of wells +1.
|
// vector with size number of wells +1.
|
||||||
// iterate over all perforations of a given well
|
// iterate over all perforations of a given well
|
||||||
// for (int perf = first_perf_index_[well_index]; perf < first_perf_index_[well_index+1]; ++perf)
|
// for (int perf = first_perf_index_[well_index]; perf < first_perf_index_[well_index] + num_perf_[well_index]; ++perf)
|
||||||
std::vector<int> first_perf_index_;
|
std::vector<int> first_perf_index_;
|
||||||
|
std::vector<int> num_perf_;
|
||||||
std::vector<Opm::Well::InjectorCMode> current_injection_controls_;
|
std::vector<Opm::Well::InjectorCMode> current_injection_controls_;
|
||||||
std::vector<Well::ProducerCMode> current_production_controls_;
|
std::vector<Well::ProducerCMode> current_production_controls_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user