Add inactive wells to rank 0 for output

This commit is contained in:
Vegard Kippe 2024-09-23 12:00:37 +02:00
parent 7ee218b1e2
commit cd26ce5568
2 changed files with 10 additions and 2 deletions

View File

@ -949,7 +949,7 @@ private:
const auto need_wells = param.local_domain_partition_method_ == "zoltan";
const auto wells = need_wells
? this->model_.simulator().vanguard().schedule().getActiveWellsatEnd()
? this->model_.simulator().vanguard().schedule().getWellsatEnd()
: std::vector<Well>{};
const auto& possibleFutureConnectionSet = need_wells

View File

@ -194,7 +194,7 @@ doLoadBalance_(const Dune::EdgeWeightMethod edgeWeightsMethod,
}
const auto wells = ((mpiSize > 1) || partitionJacobiBlocks)
? schedule.getActiveWellsatEnd()
? schedule.getActiveWellsAtEnd()
: std::vector<Well>{};
const auto& possibleFutureConnections = schedule.getPossibleFutureConnections();
// Distribute the grid and switch to the distributed view.
@ -207,6 +207,14 @@ doLoadBalance_(const Dune::EdgeWeightMethod edgeWeightsMethod,
eclState1, parallelWells);
}
// Add inactive wells to RANK0 (possibly needed for RFT file output)
const bool hasInactive = this->grid_->comm().rank() == 0;
const auto inactive_well_names = schedule.getInactiveWellNamesAtEnd();
for (const auto& well_name : inactive_well_names) {
parallelWells.emplace_back(well_name, hasInactive);
}
std::sort(parallelWells.begin(), parallelWells.end());
// Calling Schedule::filterConnections would remove any perforated
// cells that exist only on other ranks even in the case of
// distributed wells. But we need all connections to figure out the