mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Cut timestep if penlaty exceeds limit
This commit is contained in:
@@ -1172,6 +1172,15 @@ namespace Opm {
|
||||
}
|
||||
// check card penalty, and add to report
|
||||
checkCardPenalty(report, iteration);
|
||||
|
||||
int cut_off_limit = 30;
|
||||
if (total_penaltyCard_.total() > cut_off_limit) {
|
||||
report.setReservoirFailed({ConvergenceReport::ReservoirFailure::Type::ConvergenceMonitorFailure,
|
||||
ConvergenceReport::Severity::TooLarge,
|
||||
-1}); // -1 indicates it's not specific to any component
|
||||
throw ConvergenceMonitorFailure("Total penalty count exceeded cut-off-limit of " + std::to_string(cut_off_limit) + ". Cutting timestep.");
|
||||
}
|
||||
|
||||
return report;
|
||||
}
|
||||
|
||||
|
||||
@@ -247,6 +247,9 @@ void registerAdaptiveParameters();
|
||||
logException_(e, solverVerbose_);
|
||||
// since linearIterations is < 0 this will restart the solver
|
||||
}
|
||||
catch (const ConvergenceMonitorFailure& e) {
|
||||
causeOfFailure = "Convergence monitor failure";
|
||||
}
|
||||
catch (const LinearSolverProblem& e) {
|
||||
substepReport = solver.failureReport();
|
||||
causeOfFailure = "Linear solver convergence failure";
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Opm
|
||||
class ReservoirFailure
|
||||
{
|
||||
public:
|
||||
enum struct Type { Invalid, MassBalance, Cnv };
|
||||
enum struct Type { Invalid, MassBalance, Cnv, ConvergenceMonitorFailure };
|
||||
|
||||
// Default constructor needed for object serialisation. Don't
|
||||
// use this for anything else.
|
||||
|
||||
Reference in New Issue
Block a user