Merge pull request #5032 from vkip/catch_welltesting

Catch exceptions from well testing
This commit is contained in:
Bård Skaflestad 2023-12-01 10:33:01 +01:00 committed by GitHub
commit b7ad5a9d29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -584,7 +584,12 @@ namespace Opm {
well->setPrevSurfaceRates(this->wellState(), this->prevWellState());
}
well->wellTesting(ebosSimulator_, simulationTime, this->wellState(), this->groupState(), wellTestState(), deferred_logger);
try {
well->wellTesting(ebosSimulator_, simulationTime, this->wellState(), this->groupState(), wellTestState(), deferred_logger);
} catch (const std::exception& e) {
const std::string msg = fmt::format("Exception during testing of well: {}. The well will not open.\n Exception message: {}", wellEcl.name(), e.what());
deferred_logger.warning("WELL_TESTING_FAILED", msg);
}
}
}