Determine pressure and depth above for distributed wells.

This commit is contained in:
Markus Blatt
2020-11-27 18:26:59 +01:00
parent 6f4fa114c1
commit f7ed1b21fa
2 changed files with 23 additions and 6 deletions

View File

@@ -460,6 +460,11 @@ namespace Opm {
void
BlackoilWellModel<TypeTag>::
endReportStep() {
// Clear the communication data structures for above values.
for(auto&& pinfo : local_parallel_well_info_)
{
pinfo->clearCommunicateAbove();
}
}
// called at the end of a report step
@@ -612,12 +617,15 @@ namespace Opm {
well_perf_data_.resize(wells_ecl_.size());
int well_index = 0;
for (const auto& well : wells_ecl_) {
std::size_t completion_index = 0;
int completion_index = 0;
int completion_index_above = -1; // -1 marks no above perf available
well_perf_data_[well_index].clear();
well_perf_data_[well_index].reserve(well.getConnections().size());
CheckDistributedWellConnections checker(well, *local_parallel_well_info_[well_index]);
bool hasFirstPerforation = false;
bool firstOpenCompletion = true;
auto& parallelWellInfo = *local_parallel_well_info_[well_index];
parallelWellInfo.beginReset();
for (const auto& completion : well.getConnections()) {
const int i = completion.getI();
@@ -638,6 +646,8 @@ namespace Opm {
pd.satnum_id = completion.satTableId();
pd.ecl_index = completion_index;
well_perf_data_[well_index].push_back(pd);
parallelWellInfo.pushBackEclIndex(completion_index_above,
completion_index);
}
firstOpenCompletion = false;
} else {
@@ -647,10 +657,14 @@ namespace Opm {
"Completion state: " << Connection::State2String(completion.state()) << " not handled");
}
}
// Note: we rely on the connections being filtered! I.e. there are only connections
// to active cells in the global grid.
++completion_index;
++completion_index_above;
}
parallelWellInfo.endReset();
checker.checkAllConnectionsFound();
local_parallel_well_info_[well_index]->communicateFirstPerforation(hasFirstPerforation);
parallelWellInfo.communicateFirstPerforation(hasFirstPerforation);
++well_index;
}
}