Fixed-step loop over TORAX and a time-step convergence study
Our brief requires the simulation loop to use fixed time steps, to be compiled as one program, and to be differentiable end to end. TORAX, the transport code we build on, chooses its own step size during a run. The options seemed to be re-implementing its physics inside our loop, or dropping those requirements.
Neither was needed. TORAX’s single time step is itself a compiled function, so we configured it for fixed steps and call it from our own loop. The result matches TORAX’s own driver to 10−13C-006, reproduces the stored reference to 10−14C-007, and is differentiable: the sensitivity of the final stored energy to the initial temperature, through several coupled steps, matches finite differences to 10−6C-008.
Time-step convergence
With fixed steps we can halve the step size and check that the answer converges. We did this and compared each result with the stored reference. As the step got smaller, the result moved further from the reference, by tens of percent in the core temperature.
We first suspected sawtooth crashes (periodic internal collapses whose timing could depend on the step size), but this scenario has no sawtooth model. Plotting the error against time showed that almost all of it is in the first few seconds, when the plasma heats quickly and a coarse step cannot resolve the transient. Later the differences decrease as expected for a first-order scheme: the difference between the coarsest and finest steps is three times the difference between the middle and finest.
Our loop is therefore behaving correctly, and the reference is not converged in time.
| core temperature difference | |
|---|---|
| ramp-up, early transient, coarse vs fine step | 18%C-012 |
| flat-top, adaptive reference vs converged | 34%C-013 |
This is not a defect in TORAX: its example configurations are set up to run fast, not to be converged in time. It does affect what “reproduces the published benchmark within tolerance” means. If the published profiles contain a few percent of time-step error, part of any difference we measure comes from the time step, not the physics. We have asked the owner to decide whether the benchmark is run at the published settings, at a converged step, or both, with the difference reported separately.
Open issue
At the smallest steps, the nonlinear solver reports non-converged steps late in the ramp-up. Smaller steps normally make the solve easier, so this is unexpected. The failures are recorded in the trace and investigated in entry 5.
Where this stands: M1 in progress; benchmark tolerance awaiting a decision (OQ-5).
Technical details → Coupling loop › fixed step driver · Backends › transport code
Decisions → OQ-5