SpectraSim Documentation
Parameter · 07 Run Settings

Maximum iterations

simulation_control.max_iterations Unit: iterations Step 07 · Run Settings

The largest number of iterations a steady run may take. The run usually stops earlier, as soon as the mean of the pressure drop has converged; this is the budget for the case where it does not.

Last updated

Theory

A steady run stops at the first of: the pressure-drop mean has converged (Δp mean-stability tolerance), the maximum number of iterations is reached, the user stops or pauses it. On auto the budget is what a converged verdict needs at the least, equation (1): the start-up phase, the settle iterations after the restart, one averaging window (at least twice an assumed oscillation period of 200 iterations, since no run exists yet to measure it), 20 % margin, rounded up to 500 and never below 3000.

With the defaults (200 upwind, 50 settle as the planning estimate, 500-iteration window) the formula gives 1000, so the floor of 3000 applies. The fields are written every Nmax/20N_{max}/20 iterations, so a paused or stopped run can be continued from a recent state. A run that reaches NmaxN_{max} without a converged mean is reported as not converged; raise the number and press Continue to go on from where it ended.

Equations

Nmax=max⁡ ⁣(3000, 500⌈1.2(Nup+Nsettle+max⁡(W, 2Pest))500⌉)N_{max} = \max\!\left(3000,\ 500\left\lceil \frac{1.2\left(N_{up} + N_{settle} + \max(W,\ 2P_{est})\right)}{500}\right\rceil\right)
(1)
wheremeaningunit
NmaxN_{max}Maximum iterations (auto)-
NupN_{up}Upwind start-up iterations-
NsettleN_{settle}Settle iterations after the restart: 50 for the budget (found from the data during the run)-
WWΔp window (iterations)-
PestP_{est}Assumed oscillation period, 200-

Default and rule

Default
auto: 3000 with the other defaultsComputed by the program
Rule

Auto: 3000 with every other setting at its default. A typed value is always used as typed and never stops the run from starting. It gets a warning only when it is below what a converged pressure drop strictly needs: the start-up iterations + the settle iterations + the averaging window (200 + 50 + 500 = 750 at the defaults). The auto value is larger on purpose (a 20 % margin, rounded up, at least 3000).

Source

The floor of 3000 is set from the program's validation runs: the bare formula (1000 with the defaults) is well below what real muffler runs need (case V2, a two-inlet single-chamber muffler with internal inlet and outlet tubes, was run with 5000 iterations), because the jets keep the residuals and the pressure-drop window from settling quickly. The setting does not apply to transient runs, which run to their end time.

Valid range whole number >= 1; a warning below start-up + settle + averaging window

Values

Whole numbers. Used by steady runs only.

Too few

Below the auto value the run may stop before enough post-settle iterations exist to judge the pressure drop; the result then reads "not converged".