diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index e34b59eabbe..fb11c8265b5 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -28,6 +28,7 @@ # make print(*args) function available in PY2.6+, does'nt work on PY < 2.6 from __future__ import print_function +import os import sys from TestCase import TestCase @@ -199,6 +200,24 @@ def main(): tutorial_inv_wedge.no_restart = True test_list.append(tutorial_inv_wedge) + # Sod shock tube, last 10 time steps from the restart at step 990 (solution_flow_00990.csv in + # the tutorial folder). Write a copy of the tutorial config that restarts from that file. + # CUR_TIME counts from the restart, so it shows 10 time steps. + sod_dir = "../Tutorials/compressible_flow/Sod_Shock_Tube" + if os.path.isfile(sod_dir + "/sod.cfg"): + with open(sod_dir + "/sod.cfg") as f: + sod_cfg = f.read() + with open(sod_dir + "/sod_restart.cfg", "w") as f: + f.write(sod_cfg.replace("RESTART_ITER= 1\n", "RESTART_ITER= 991\n")) + + tutorial_sod_shock_tube = TestCase('sod_shock_tube_tutorial') + tutorial_sod_shock_tube.cfg_dir = sod_dir + tutorial_sod_shock_tube.cfg_file = "sod_restart.cfg" + tutorial_sod_shock_tube.test_iter = 1000 + tutorial_sod_shock_tube.test_vals = [0.000006, -2.501790] + tutorial_sod_shock_tube.unsteady = True + test_list.append(tutorial_sod_shock_tube) + # Inviscid ONERA M6 tutorial_inv_onera = TestCase('inviscid_onera_tutorial') tutorial_inv_onera.cfg_dir = "../Tutorials/compressible_flow/Inviscid_ONERAM6"