mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3168 from joakim-hove/simplify-global-is-grup
Simplify global is grup
This commit is contained in:
@@ -1218,10 +1218,10 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
std::fill(globalIsInjectionGrup_.begin(), globalIsInjectionGrup_.end(), 0);
|
std::fill(globalIsInjectionGrup_.begin(), globalIsInjectionGrup_.end(), 0);
|
||||||
std::fill(globalIsProductionGrup_.begin(), globalIsProductionGrup_.end(), 0);
|
std::fill(globalIsProductionGrup_.begin(), globalIsProductionGrup_.end(), 0);
|
||||||
int global_well_index = 0;
|
|
||||||
const auto& end = wellMap().end();
|
const auto& end = wellMap().end();
|
||||||
for (const auto& well : schedule.getWells(reportStepIdx)) {
|
for (const auto& well : schedule.getWells(reportStepIdx)) {
|
||||||
// Build global name->index map.
|
// Build global name->index map.
|
||||||
|
auto global_well_index = well.seqIndex();
|
||||||
wellNameToGlobalIdx_[well.name()] = global_well_index;
|
wellNameToGlobalIdx_[well.name()] = global_well_index;
|
||||||
|
|
||||||
// For wells on this process...
|
// For wells on this process...
|
||||||
@@ -1229,14 +1229,7 @@ namespace Opm
|
|||||||
if (it != end) {
|
if (it != end) {
|
||||||
// ... set the GRUP/not GRUP states.
|
// ... set the GRUP/not GRUP states.
|
||||||
const int well_index = it->second[0];
|
const int well_index = it->second[0];
|
||||||
if (this->status_[well_index] != Well::Status::OPEN) {
|
if (this->status_[well_index] == Well::Status::OPEN) {
|
||||||
// Well is shut.
|
|
||||||
if (well.isInjector()) {
|
|
||||||
globalIsInjectionGrup_[global_well_index] = 0;
|
|
||||||
} else {
|
|
||||||
globalIsProductionGrup_[global_well_index] = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (well.isInjector()) {
|
if (well.isInjector()) {
|
||||||
globalIsInjectionGrup_[global_well_index] = (currentInjectionControls()[well_index] == Well::InjectorCMode::GRUP);
|
globalIsInjectionGrup_[global_well_index] = (currentInjectionControls()[well_index] == Well::InjectorCMode::GRUP);
|
||||||
} else {
|
} else {
|
||||||
@@ -1244,7 +1237,6 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
++global_well_index;
|
|
||||||
}
|
}
|
||||||
comm.sum(globalIsInjectionGrup_.data(), globalIsInjectionGrup_.size());
|
comm.sum(globalIsInjectionGrup_.data(), globalIsInjectionGrup_.size());
|
||||||
comm.sum(globalIsProductionGrup_.data(), globalIsProductionGrup_.size());
|
comm.sum(globalIsProductionGrup_.data(), globalIsProductionGrup_.size());
|
||||||
|
|||||||
Reference in New Issue
Block a user