mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use well index for PerfPhaseRates
This commit is contained in:
@@ -1992,7 +1992,7 @@ namespace Opm {
|
|||||||
|
|
||||||
auto& perf_pressure = well_state.perfPress(well_index);
|
auto& perf_pressure = well_state.perfPress(well_index);
|
||||||
auto& perf_rates = well_state.perfRates(well_index);
|
auto& perf_rates = well_state.perfRates(well_index);
|
||||||
auto * perf_phase_rates = well_state.mutable_perfPhaseRates().data() + wm.second[1]*np;
|
auto * perf_phase_rates = &well_state.mutable_perfPhaseRates()[wm.second[1]*np];
|
||||||
const auto& perf_data = this->well_perf_data_[well_index];
|
const auto& perf_data = this->well_perf_data_[well_index];
|
||||||
|
|
||||||
for (std::size_t perf_index = 0; perf_index < perf_data.size(); perf_index++) {
|
for (std::size_t perf_index = 0; perf_index < perf_data.size(); perf_index++) {
|
||||||
|
|||||||
@@ -582,20 +582,18 @@ namespace Opm
|
|||||||
// the maximum water cut value of the completions
|
// the maximum water cut value of the completions
|
||||||
// it is used to identify the most offending completion
|
// it is used to identify the most offending completion
|
||||||
double max_ratio_completion = 0;
|
double max_ratio_completion = 0;
|
||||||
|
const int np = number_of_phases_;
|
||||||
|
|
||||||
|
const auto * perf_phase_rates = &well_state.perfPhaseRates()[first_perf_ * np];
|
||||||
// look for the worst_offending_completion
|
// look for the worst_offending_completion
|
||||||
for (const auto& completion : completions_) {
|
for (const auto& completion : completions_) {
|
||||||
|
|
||||||
const int np = number_of_phases_;
|
|
||||||
std::vector<double> completion_rates(np, 0.0);
|
std::vector<double> completion_rates(np, 0.0);
|
||||||
|
|
||||||
// looping through the connections associated with the completion
|
// looping through the connections associated with the completion
|
||||||
const std::vector<int>& conns = completion.second;
|
const std::vector<int>& conns = completion.second;
|
||||||
for (const int c : conns) {
|
for (const int c : conns) {
|
||||||
const int index_con = c + first_perf_;
|
|
||||||
|
|
||||||
for (int p = 0; p < np; ++p) {
|
for (int p = 0; p < np; ++p) {
|
||||||
const double connection_rate = well_state.perfPhaseRates()[index_con * np + p];
|
const double connection_rate = perf_phase_rates[c * np + p];
|
||||||
completion_rates[p] += connection_rate;
|
completion_rates[p] += connection_rate;
|
||||||
}
|
}
|
||||||
} // end of for (const int c : conns)
|
} // end of for (const int c : conns)
|
||||||
|
|||||||
@@ -787,11 +787,11 @@ void WellState::reportConnections(data::Well& well,
|
|||||||
for( auto& comp : well.connections) {
|
for( auto& comp : well.connections) {
|
||||||
const auto connPhaseOffset = np * (wt.second[1] + local_comp_index);
|
const auto connPhaseOffset = np * (wt.second[1] + local_comp_index);
|
||||||
|
|
||||||
const auto rates = this->perfPhaseRates().begin() + connPhaseOffset;
|
const auto * rates = &this->perfPhaseRates()[connPhaseOffset];
|
||||||
const auto connPI = this->connectionProductivityIndex().begin() + connPhaseOffset;
|
const auto connPI = this->connectionProductivityIndex().begin() + connPhaseOffset;
|
||||||
|
|
||||||
for( int i = 0; i < np; ++i ) {
|
for( int i = 0; i < np; ++i ) {
|
||||||
comp.rates.set( phs[ i ], *(rates + i) );
|
comp.rates.set( phs[ i ], rates[i] );
|
||||||
comp.rates.set( pi [ i ], *(connPI + i) );
|
comp.rates.set( pi [ i ], *(connPI + i) );
|
||||||
}
|
}
|
||||||
if ( pu.has_polymer ) {
|
if ( pu.has_polymer ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user