Make check whether a connection exists work for distributed wells.

This commit is contained in:
Markus Blatt
2020-11-27 18:19:23 +01:00
parent bd06dff7e2
commit a9a733ebc1
2 changed files with 26 additions and 24 deletions

View File

@@ -1194,23 +1194,23 @@ namespace Opm
// COMPDAT handling
const auto& connectionSet = well_ecl_.getConnections();
CheckDistributedWellConnections checker(well_ecl_, parallel_well_info_);
for (size_t c=0; c<connectionSet.size(); c++) {
const auto& connection = connectionSet.get(c);
const int i = connection.getI();
const int j = connection.getJ();
const int k = connection.getK();
const int* cpgdim = cart_dims;
const int cart_grid_indx = i + cpgdim[0]*(j + cpgdim[1]*k);
const int cell = cartesian_to_compressed[cart_grid_indx];
if (connection.state() != Connection::State::OPEN || cell >= 0)
{
checker.connectionFound(c);
}
if (connection.state() == Connection::State::OPEN) {
const int i = connection.getI();
const int j = connection.getJ();
const int k = connection.getK();
const int* cpgdim = cart_dims;
const int cart_grid_indx = i + cpgdim[0]*(j + cpgdim[1]*k);
const int cell = cartesian_to_compressed[cart_grid_indx];
if (cell < 0) {
OPM_DEFLOG_THROW(std::runtime_error, "Cell with i,j,k indices " << i << ' ' << j << ' '
<< k << " not found in grid (well = " << name() << ')', deferred_logger);
}
{
if (cell >= 0) {
double radius = connection.rw();
const std::array<double, 3> cubical =
wellhelpers::getCubeDim<3>(cell_to_faces, begin_face_centroids, cell);
@@ -1242,6 +1242,7 @@ namespace Opm
}
}
}
checker.checkAllConnectionsFound();
}
template<typename TypeTag>