gdtk-uq/gdtk

No test coverage for restarting a simulation from a prior timestep

Closed this issue · 1 comments

A recent commit of mine fixed a bug with the NK solver that only occurred when restarting the solver from a non-initial snapshot. We would have caught this if we had a test that performed restart.

Commit 27b0f12 introduces a test that kind of resolves this issue.

The test works by running the steady state solver for 80 steps, saving snapshot 1 at step 40 and snapshot 2 at step 80. It then restarts from snapshot 1 and saves snapshot 3, also at 80 steps. A lua custom post script then compares the L2 normal of the pressure differences between snapshot 3 and 2, which should be in the range of machine zero if the solution was written and read correctly.

Some limitations:

  • This only exercises the NK solver, which has its own codepath for reading and writing solution files.
  • We only test the gziptext legacy format, though others could be added easily
  • We have to fix the CFL.

This last thing is a problem, because it means the new test wouldn't have caught the original bug that prompted this issue, where the CFL was read in incorrectly during a restart. Unfortunately, allowing the CFL to vary automatically with the residual introduces a hysteresis in the solver, which means the two snapshots don't match to within machine precision, even though they aren't noticeably different.

I'm not exactly sure what to do about this. It might be an academic problem that isn't worth fixing, even though it would be nice if we did.