Merge pull request #3337 from bska/protect-against-noconnection-wells

Don't Create Well Instance for Wells With No Connections
This commit is contained in:
Bård Skaflestad 2021-06-22 23:31:24 +02:00 committed by GitHub
commit 256f4a3291
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -587,6 +587,12 @@ namespace Opm {
for (int w = 0; w < nw; ++w) {
const Well& well_ecl = wells_ecl_[w];
if (well_ecl.getConnections().empty()) {
// No connections in this well. Nothing to do.
continue;
}
const std::string& well_name = well_ecl.name();
const auto well_status = this->schedule()
.getWell(well_name, time_step).getStatus();
@ -1370,6 +1376,11 @@ namespace Opm {
// corresponding "this->wells_ecl_[shutWell]".
for (const auto& shutWell : this->local_shut_wells_) {
if (this->wells_ecl_[shutWell].getConnections().empty()) {
// No connections in this well. Nothing to do.
continue;
}
auto wellPtr = this->template createTypedWellPointer
<StandardWell<TypeTag>>(shutWell, reportStepIdx);