SpectraSim Documentation
Parameter · 06 Solver Settings

Upwind iterations before the switch

numerics.turbulence_upwind_iterations Unit: iterations Step 06 · Solver Settings

The length of the first-order start-up phase of a steady run. For this many iterations kk and ω\omega are convected with first-order upwind; the solver is then restarted with the final schemes and relaxation.

Last updated

Theory

A steady run consists of two solver invocations.

1. Phase 1 (iterations 1 to NupN_{up}) uses first-order upwind for kk and ω\omega (bounded Gauss upwind; the plain form for the pseudo-transient solver). The transonic SIMPLE and pseudo-transient compressible solvers also use it for U and energy. The phase uses the start-up velocity relaxation and, for the pseudo-transient solver, the start-up Courant number. A full field set is written at its last iteration. 2. Phase 2 restarts from that field set with the scheme of k and ω convection scheme, the final velocity relaxation (Velocity relaxation) and the final Courant number.

The switch is a real restart with the dictionaries edited in place, not a scheme switched at run time, because the installed OpenFOAM build cannot compile code.

A restart disturbs the solution: on a real muffler the first iteration after it showed a pressure residual of about 0.4, a continuity error about 18 times higher than before, and a pressure drop 17 % off for about 40 iterations. The convergence rule therefore does not use the pressure-drop samples of phase 1 or of the disturbed stretch after the restart (the settle iterations), equation (1).

  • Each time it judges convergence, the program finds the end of the disturbance from the pressure drop itself with the Marginal Standard Error Rule on batch means of 5 samples (MSER-5), equation (2). It removes the stretch whose removal makes the mean of the remaining samples most precise.
  • With perforated tubes whose loss coefficient follows the flow, a later restart for a changed coefficient moves the start further.

The upwind phase also counts in the automatic iteration budget (Maximum iterations). A run paused inside it cannot be continued.

Equations

istart=max⁡ ⁣(Nup, irestart)+Nsettle(1)i_{start} = \max\!\left(N_{up},\ i_{restart}\right) + N_{settle} \qquad (1)
(1)
Nsettle=5 d∗,d∗=arg⁡min⁡0≤d≤b/21(b−d)2∑j=d+1b(Zj−Zˉd)2(2)N_{settle} = 5\,d^{*}, \qquad d^{*} = \arg\min_{0 \le d \le b/2} \frac{1}{(b-d)^2} \sum_{j=d+1}^{b} \left(Z_j - \bar Z_{d}\right)^2 \qquad (2)
(2)
wheremeaningunit
istarti_{start}First iteration whose pressure-drop sample counts for convergence-
NupN_{up}Upwind iterations (this setting), capped at the maximum number of iterations-
irestarti_{restart}Iteration of the last restart made for a perforate loss update (if any)-
NsettleN_{settle}Settle iterations after a restart, found by equation (2)-
ZjZ_jMean of the j-th batch of 5 pressure-drop samples after the restartPa
bbNumber of batches so far-
Zˉd\bar Z_{d}Mean of the batches after the first dPa

Default and rule

Default
200
Rule

200 iterations. With 0, or with NupN_{up} at or above the maximum number of iterations, there is only one phase.

Source

The two-phase start is the program's convention for robustness of kk and ω\omega near the jets during the crude first iterations; it is not taken from a publication. The restart disturbance described above was measured on the two-baffle test muffler.

Settle iterations: MSER (White, 1997), used as MSER-5, the variant found most effective and robust in a comparison of five truncation rules (White, Cobb and Spratt, 2000). The search covers the first half of the samples (the method's assumption "n >> d"); a minimum at the end of that half means the disturbance has not died out yet. The stretch is capped at 300 iterations: once 300 samples have run since the restart, at most 300 are removed. Validation results: on the two-baffle test muffler the settle stretch ends 60 iterations after the restart; on a V5 muffler with no visible disturbance nothing is removed, and the run converges at iteration 385 instead of 669 with a fixed 300-iteration stretch (means 0.4 % apart). OpenFOAM restart mechanics: (OpenFOAM user guide, 2026).

Valid range ≥ 0

Values

Any whole number ≥ 0. Larger values give a more established field at the switch and a longer run.

Transient

Transient runs have no start-up phase: they use first-order kk and ω\omega convection throughout.

References 3

  1. OpenCFD Ltd. (2026). OpenFOAM user guide. openfoam.com. Web page
  2. White, K. P., Jr. (1997). An effective truncation heuristic for bias reduction in simulation output. Simulation, 69(6), 323-334. DOI 10.1177/003754979706900601
  3. White, K. P., Jr., Cobb, M. J. and Spratt, S. C. (2000). A comparison of five steady-state truncation heuristics for simulation. Proceedings of the 2000 Winter Simulation Conference, 755-760. DOI 10.1109/WSC.2000.899843