Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

How simulations stop

A simulation stops when it meets a solver criterion, receives a stop request, or cannot continue. Its terminal status records why it stopped, not whether the result is physically correct.

Solver stopping criteria

A full solve can end in three normal ways:

  • Maximum iterations: max_iterations is a hard iteration limit. Reaching it produces max_iterations_reached; it does not imply convergence.
  • Residual convergence: all scaled SIMPLE residuals must meet target_residual. This produces residual_converged.
  • Monitored-quantity convergence: all monitors and junction temperatures configured for stopping must settle over convergence_window. This produces monitor_converged.

A monitor without an exit_tolerance is recorded but cannot stop the run.

Monitor and junction-temperature tolerances

exit_tolerance uses the same stability test wherever it is configured, but attaches to different quantities:

  • exit_tolerance belongs to a maximum, minimum, mean, point probe, mass-balance, or energy-balance monitor.
  • On an individual compact thermal model, exit_tolerance measures its junction temperature in °C.

For each stopping quantity, the solver:

  1. takes the last convergence_window values;
  2. calculates their mean;
  3. finds the largest absolute deviation from that mean; and
  4. considers the quantity settled when the deviation is at or below its tolerance.

For example, junction temperatures of 70.00, 70.02, and 69.98 °C have a mean of 70.00 °C and a largest deviation of 0.02 °C. They satisfy a tolerance of 0.05 °C, but not 0.01 °C.

Important consequences:

  • A tolerance measures stability, not magnitude. exit_tolerance: 0.01 on a temperature monitor means variation within 0.01 °C, not a temperature below 0.01 °C.
  • Tolerances use the monitored quantity’s units; relative mass and energy balances are dimensionless.
  • The solver cannot use this test until the complete window exists.
  • convergence_window must be greater than 1 and no greater than max_iterations.
  • To stop with monitor_converged, every monitor and active CTM exit_tolerance must pass on the same iteration. Each uses its own tolerance over the shared window.

How the criteria interact

The criteria are alternatives. A normal solve stops as soon as any of these is true:

  • max_iterations has been reached;
  • all residuals have converged; or
  • all configured monitor and junction-temperature stopping quantities have converged.

Monitor or junction-temperature convergence can therefore stop a run while residuals remain above target. Residual convergence can likewise stop it before monitored quantities settle.

If several conditions become true on the same terminal iteration, status records one reason. The current tie-breaking order is:

  1. max_iterations_reached;
  2. residual_converged; then
  3. monitor_converged.

This order only selects the status label; it does not delay any stopping criterion. Use iteration_info.csv to inspect all residual, monitor, and junction-temperature histories.

Cancellation, timeouts, and failures

  • Cancel stops at an iteration boundary, produces canceled, and preserves partial results. timeout_cancel can request this automatically.
  • Kill stops the worker immediately, produces killed, and preserves no result bundle. timeout_kill is the corresponding hard deadline. If it is not later than timeout_cancel, the timeout policy goes directly to killing.
  • Divergence means numerical fields became non-finite. Diagnostic fields and histories are preserved with diverged status, but they are not a valid solution.
  • Execution errors produce error and no result bundle.

Terminal statuses and results

StatusMeaningResult bundle
dry_runMeshing completed without a physical solveYes, with placeholder fields
residual_convergedAll residuals met their targetYes
monitor_convergedAll stopping monitors and junction temperatures settledYes
max_iterations_reachedThe iteration limit was reachedYes
canceledGraceful cancellation completedYes, with partial results
divergedThe numerical solution became non-finiteYes, for diagnosis
killedThe worker stopped immediatelyNo
errorPreparation or execution failedNo

A dry_run stops after meshing, before any convergence criteria are evaluated. completed means persisted results are available; it does not mean the solution converged or is correct.

See also