Catch exceptions from well testing (often: inf/nan in MSW matrices).

This commit is contained in:
Vegard Kippe 2023-11-29 09:17:53 +01:00
parent c6bb607cdc
commit 2294983759

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 (std::runtime_error& 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);
}
}
}