SpectraSim Documentation
Parameter · 07 Run Settings

Residual target

simulation_control.residual_target Step 07 · Run Settings

The absolute target for the initial residual of every equation, judged by quality gate 2 after a steady run. It does not stop the run: the pressure-drop rule does.

Last updated

Theory

Each iteration of the steady solver starts every linear solve with a residual: how far the current solution is from satisfying that equation, normalised by OpenFOAM (OpenFOAM user guide, 2026). This "initial residual" measures the progress of the whole nonlinear iteration. The "final residual" printed after the linear solve is the initial one reduced by the linear solver's tolerance (here 0.05 for pressure, 0.1 for the other fields), 1-2 decades lower; judging it would call an unconverged run converged.

Gate 2 takes the largest initial residual of each field over the last 50 iterations, equation (1), so a single low iteration of a noisy field does not pass by chance, and accepts the field when it is below the target OR has fallen by Residual drop from the start, equation (2). The velocity components Ux,Uy,UzU_x, U_y, U_z are judged separately; with Per-field residual tolerances each equation can have its own target.

The run itself stops on the converged mean of the pressure drop (Δp mean-stability tolerance). OpenFOAM's own residualControl, which would end the run when every residual is below its value, is fixed at 10−510^{-5} so that it never ends a run before the pressure-drop window is complete. A run whose pressure-drop mean converged but whose residuals miss the target is reported as "completed with warnings".

Equations

rϕ=max⁡i∈last 50rϕ,ir_\phi = \max_{i \in \text{last 50}} r_{\phi,i}
(1)
passϕ  ⟺  rϕ<rtarget  ∨  log⁡10max⁡i≤10rϕ,irϕ≥D\text{pass}_\phi \iff r_\phi < r_{target} \ \ \lor\ \ \log_{10}\frac{\max_{i \le 10} r_{\phi,i}}{r_\phi} \ge D
(2)
wheremeaningunit
rϕ,ir_{\phi,i}Initial residual of field ϕ\phi at iteration ii-
rtargetr_{target}Residual target (this setting, or the field's own)-
DDResidual drop (decades), when set-

Default and rule

Default
auto: 1e-3 (steady), 1e-2 (transient)Computed by the programMeasured
Rule

Auto: 10−310^{-3} for steady runs, 10−210^{-2} for transient runs (the transient value is shown, but transient runs are judged on the time-averaged pressure drop, not on residuals). The auto value follows a change of the time dependency; a typed value is kept and gets a warning when it is ten times larger or smaller than the mode's default.

Source

The program's residual-sensitivity study: a target of 10−410^{-4} is rarely reachable on a real muffler, whose jets keep the initial residuals at 10−210^{-2} to 10−310^{-3}, while the pressure drop is already stable; across relaxation settings on the two-inlet muffler no run reached 10−410^{-4}, and the pressure drop stayed within 1918-1951 Pa. The looser transient value follows PIMPLE practice: the accuracy of a transient run comes from the time integration, not from converging each step tightly.

Valid range 0 < r < 1; a warning when a typed value is ten times off the mode's default

Values

Between 0 and 1.

Unreachable targets

Muffler jets often hold the residuals above 10−310^{-3}; the residual drop (decades) then decides, and the pressure-drop rule decides when the run stops.

References 1

  1. OpenCFD Ltd. (2026). OpenFOAM user guide. openfoam.com. Web page