mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
flow_ebos: print statistics about failed time steps
the performance summary at the end of a Norne run which are printed by `flow_ebos` now looks like this on my machine: ``` Total time (seconds): 773.757 Solver time (seconds): 753.349 Assembly time (seconds): 377.218 (Failed: 23.537; 6.23965%) Linear solve time (seconds): 352.022 (Failed: 23.2757; 6.61201%) Update time (seconds): 16.3658 (Failed: 1.13149; 6.91375%) Output write time (seconds): 22.5991 Overall Well Iterations: 870 (Failed: 35; 4.02299%) Overall Linearizations: 2098 (Failed: 136; 6.48236%) Overall Newton Iterations: 1756 (Failed: 136; 7.74487%) Overall Linear Iterations: 26572 (Failed: 1786; 6.72136%) ``` for the flow_legacy family, nothing changes.
This commit is contained in:
@@ -211,6 +211,9 @@ namespace Opm {
|
||||
State last_state( state );
|
||||
WState last_well_state( well_state );
|
||||
|
||||
// reset the statistics for the failed substeps
|
||||
failureReport_ = SimulatorReport();
|
||||
|
||||
// counter for solver restarts
|
||||
int restarts = 0;
|
||||
|
||||
@@ -238,18 +241,26 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
catch (const Opm::NumericalProblem& e) {
|
||||
substepReport += solver.failureReport();
|
||||
|
||||
detail::logException(e, solver_verbose_);
|
||||
// since linearIterations is < 0 this will restart the solver
|
||||
}
|
||||
catch (const std::runtime_error& e) {
|
||||
substepReport += solver.failureReport();
|
||||
|
||||
detail::logException(e, solver_verbose_);
|
||||
// also catch linear solver not converged
|
||||
}
|
||||
catch (const Dune::ISTLError& e) {
|
||||
substepReport += solver.failureReport();
|
||||
|
||||
detail::logException(e, solver_verbose_);
|
||||
// also catch errors in ISTL AMG that occur when time step is too large
|
||||
}
|
||||
catch (const Dune::MatrixBlockError& e) {
|
||||
substepReport += solver.failureReport();
|
||||
|
||||
detail::logException(e, solver_verbose_);
|
||||
// this can be thrown by ISTL's ILU0 in block mode, yet is not an ISTLError
|
||||
}
|
||||
@@ -323,8 +334,10 @@ namespace Opm {
|
||||
}
|
||||
else // in case of no convergence (linearIterations < 0)
|
||||
{
|
||||
report.converged = false;
|
||||
substepTimer.setLastStepFailed(true);
|
||||
|
||||
failureReport_ += substepReport;
|
||||
|
||||
// increase restart counter
|
||||
if( restarts >= solver_restart_max_ ) {
|
||||
const auto msg = std::string("Solver failed to converge after cutting timestep ")
|
||||
|
||||
Reference in New Issue
Block a user