Restarting and Stopping CONVERGE

During a simulation, CONVERGE periodically writes restart files from which you can restart a simulation. The restart file name format is restart*.rst, where * is a placeholder for the restart number. You can set parameters in inputs.in to control the number of restart files and how frequently they are written. Refer to the CONVERGE Manual for more information about these parameters.

 

You can also force CONVERGE to write a restart file by placing an empty file called RESTART in the Case Directory. To create this file from the command line, navigate to the Case Directory and type

 

touch RESTART (Linux)

 

or

 

powershell New-Item RESTART (Windows)

 

Upon reading the empty file, CONVERGE will write a restart*.rst file at the end of the current time-step and then delete the empty file.

 

To restart a simulation, copy the desired restart*.rst file to restart.rst and set simulation_control > restart_flag = 1 in inputs.in, then run the code as you normally do. In CONVERGE 3.1+, be sure to save restart.rst in the root Case Directory instead of the outputs_* directory. If a file named restart.rst does not exist, CONVERGE will use the restart file with the highest number.

 

The results from a restarted simulation might not exactly match the results from the original run. Some of the physical models incorporate random number elements that are not replicated in a restart case. These variations will be consistent with using a different random seed for the same set of inputs.

 

For simulations using Adaptive Mesh Refinement (AMR), CONVERGE recreates the AMR embedding at the beginning of a restart. To ensure that the new AMR embedding matches exactly the AMR embedding from before the restart, CONVERGE saves the AMR embedding information to the restart file.

 

Checking the Restart Time

To confirm that a specific restart file is complete and to see the time-step at which it was written, type the following command in a terminal (HDF5 libraries must be installed):

 
h5dump -a TIME_STEP <filename> (CONVERGE 3.0)

 

or

 

h5dump -a "STREAM_00/TIME_STEP" <filename> (CONVERGE 3.1+)

 

Figure 1 below shows an example of the output. If the restart file is incomplete (for example, if the simulation crashed while the file was being written), this command returns an error.

 

HDF5 "restart0002.rst" {

ATTRIBUTE "TIME_STEP" {

  DATATYPE  H5T_IEEE_F64LE

  DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }

  DATA {

  (0): 0.0101109

  }

}

}

Figure 1: Example h5dump output. Here, the restart0002.rst file was written at a simulation time of 0.0101109 s.

 

Stopping and Restarting a Simulation

If you place an empty file in your directory called STOP, CONVERGE will immediately create a restart file, create the post files, do all its other normal finishing procedures, end the simulation, and delete the STOP file. Type

 

touch STOP (Linux)

 

or

 

powershell New-Item STOP (Windows)

 

in your Case Directory to create an empty STOP file. You can then see exactly what was happening in the flow at the time-step where you stopped the simulation, edit the input files if you wish, and restart your job as described above.