Skip to content

Hold converged steps to the minimum time step size too - #7265

Open
hnil wants to merge 1 commit into
OPM:masterfrom
hnil:bugfix/timestep-floor-on-converged-steps
Open

Hold converged steps to the minimum time step size too#7265
hnil wants to merge 1 commit into
OPM:masterfrom
hnil:bugfix/timestep-floor-on-converged-steps

Conversation

@hnil

@hnil hnil commented Jul 31, 2026

Copy link
Copy Markdown
Member

Both dt floors — --solver-min-time-step and the restart count — are only consulted when a substep fails. A run whose substeps all converge but whose controller keeps proposing smaller steps consults neither: dt shrinks without bound, the clock stands still, and the run never finishes and never fails.

network/NETWORK_MODEL5_STDW_AUTOCHK does exactly this. Every substep converges with 9 Newton iterations, the network never balances, and dt falls past 1e-57 days with the clock frozen at day 143.107 of 152 — past the point where t + dt == t, so no number of steps can finish the report step.

Applying the existing minimum on the accepted path stops it after 357 steps with:

Time step control proposed a step of 9.872E-13 DAYS, below the minimum of 1.000E-12 DAYS,
while every substep converges.  The run is not advancing past 1.431070E+02 DAYS.

The limit is never reached anywhere in the compareECLFiles suite (128 failures before and after, same set — all pre-existing platform diffs on this machine).

Note: reaching this state at all needs #7263's deck to get past its abort; on master the deck stops earlier for the unrelated reason described there. This guard is independent and worth having regardless.

Both dt floors - the minimum step size and the restart count - are only
consulted when a substep fails.  A run whose substeps all converge, but
whose time step controller keeps proposing ever smaller steps, consults
neither: dt shrinks without bound while the elapsed time stands still,
and the run never finishes and never fails.

network/NETWORK_MODEL5_STDW_AUTOCHK reaches this state.  Every substep
converges with 9 Newton iterations, the network never balances ("maximum
of 3 network iterations has been used... continue with unconverged
network results"), and dt falls past 1e-57 days with the clock frozen at
day 143.107 of 152 - at which point t + dt == t and no number of steps
can finish the report step.

Apply the existing minimum to the accepted path as well, with a message
that says what actually happened.  The deck now stops after 357 steps
instead of running forever.

No test in the compareECLFiles suite reaches the limit; the set of
failing tests is unchanged.
@hnil
hnil requested a review from akva2 July 31, 2026 17:49
@hnil hnil added the manual:bugfix This PR is a bug fix and should be noted in the manual label Jul 31, 2026
@hnil
hnil marked this pull request as ready for review July 31, 2026 17:52

@akva2 akva2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I assume there is a reason why this wasn't rolled into setTimeStep?

@akva2

akva2 commented Aug 5, 2026

Copy link
Copy Markdown
Member

jenkins build this please

@hnil

hnil commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

Checked rather than assumed — instrumented setTimeStep_ to log any call below the floor and ran the whole compareECLFiles suite: zero hits. So rolling it in would not make anything currently throw.

Two reasons I still left it at the call site:

  • On the failure path checkTimeStepMinLimit_ already fires first, with a message about the solver failing to converge. Same numeric condition, opposite cause — this one is for the case where every substep converges and the run still stops advancing.
  • setTimeStep_ is also reached from the TUNING/NEXTSTEP path, where the size comes from the deck. Nothing in the suite drives that below the floor, but a deck could, and it would then abort rather than be clamped.

Happy to move it if you would rather have one gate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:bugfix This PR is a bug fix and should be noted in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants