Merge pull request #3158 from totto82/operability_solve

shut/stop unsolvable wells
This commit is contained in:
Atgeirr Flø Rasmussen
2021-06-18 10:13:14 +02:00
committed by GitHub
5 changed files with 75 additions and 25 deletions

View File

@@ -1408,6 +1408,7 @@ namespace Opm {
std::string exc_msg;
try {
for (const auto& well : well_container_) {
const bool old_well_operable = well->isOperable();
well->checkWellOperability(ebosSimulator_, this->wellState(), deferred_logger);
if (!well->isOperable() ) continue;
@@ -1425,6 +1426,22 @@ namespace Opm {
well->solveWellEquation(ebosSimulator_, this->wellState(), this->groupState(), deferred_logger);
}
const bool well_operable = well->isOperable();
if (!well_operable && old_well_operable) {
const Well& well_ecl = getWellEcl(well->name());
if (well_ecl.getAutomaticShutIn()) {
deferred_logger.info(" well " + well->name() + " gets SHUT at the beginning of the time step ");
} else {
if (!well->wellIsStopped()) {
deferred_logger.info(" well " + well->name() + " gets STOPPED at the beginning of the time step ");
well->stopWell();
}
}
} else if (well_operable && !old_well_operable) {
deferred_logger.info(" well " + well->name() + " gets REVIVED at the beginning of the time step ");
well->openWell();
}
} // end of for (const auto& well : well_container_)
updatePrimaryVariables(deferred_logger);
} catch (const std::runtime_error& e) {