22. Restarting a simulation

The restart functionality of ComFLOW can be used to restart a simulation, for example after a system failure or power breakdown. It can also be used ‘’by design” to restart a simulation with modified simulation settings. One could for example start a simulation with large Poisson tolerance linear_solver/stopping_criterion/outer_p (see Section 17.1) for faster spin-up of the simulation and then continue with a smaller value for increased accuracy. Similarly one could start-up a simulation with a large time step and then continue with a smaller one by reducing the CFL tolerance (see Chapter 16).

It is possible to apply a restart with almost any change of simulation settings as long as it does not concern the domain and grid setup or type of simulation (e.g. one or two-phase). As a general rule, one should be careful with changing simulation settings after a restart. The time step size as well as the end time of the simulation can be changed. The time interval for post-processing output (snapshots, monitor points, etc.) is identical to that of the original simulation unless the attribute @reset_counters~ is set to "true".

The ComFLOW program includes the possibility to save your simulation and restart it at a later time. Special snapshot files including additional information about the simulation status can be written at a specified time interval. The settings related to the restart functionality are included in the XML section /comflow/restart/. The following parameters can be specified:

  • @tmin, @tmax, @dt, @nr: Output interval using the notation as explained in Section 26.2.
  • @reset_counters: If this parameter is set to "true" all the counters for post-processing output are reset upon restart, otherwise counting just continues where ComFLOW left off.

Upon restart ComFLOW reinterprets the main input file(s) hence it is possible to restart a simulation with modified settings (e.g. a different convection scheme or a different CFL limit).

Note

Be careful when changing simulation settings after a restart. Some settings such as the simulation type (e.g. one-phase/two-phase, with/without moving bodies, etc.) cannot be changed afterwards.

22.1. Example

The following code can be used to produce restart files at a given interval:

<comflow>
   <restart dt="1.0" />
</comflow>

The restart files will be stored at the locations ${OUTPUT}/restart/autosave####.save, where #### is replaced by the file counter. It is recommended to copy or move important restart files to a new location outside the subdirectory restart since this will prevent it from being overwritten by subsequent simulations.

To restart a simulation use the command-line option --restart RESTART where RESTART has to be replaced by the location of the desired restart file. For more details, see Chapter 4.

It is possible to restart the simulation with a modified input file. The option restart/@reset_counters causes the output intervals and counters of restart files and other post-processing output to be reset to the values specified in the new input file. Compare the following input section with that of the original input file listed above:

<comflow>
   <restart dt="0.1" reset_counters="true"/>
</comflow>