diff --git a/Exec/science/Detonation/shock_paper/inputs-det-x.subch_base b/Exec/science/Detonation/shock_paper/inputs-shock-burn.template similarity index 91% rename from Exec/science/Detonation/shock_paper/inputs-det-x.subch_base rename to Exec/science/Detonation/shock_paper/inputs-shock-burn.template index c233d2d926..7758414c87 100644 --- a/Exec/science/Detonation/shock_paper/inputs-det-x.subch_base +++ b/Exec/science/Detonation/shock_paper/inputs-shock-burn.template @@ -7,7 +7,7 @@ geometry.is_periodic = 0 0 0 geometry.coord_sys = 0 # 0 => cart, 1 => RZ 2=>spherical geometry.prob_lo = 0 0 0 geometry.prob_hi = 5.89824e7 2500 2500 -amr.n_cell = 48 16 16 +amr.n_cell = @nx@ 16 16 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< @@ -30,6 +30,9 @@ castro.ppm_temp_fix = 0 castro.time_integration_method = 3 +castro.disable_shock_burning = @shock_flag@ +castro.shock_detection_threshold = @shock_thresh@ + # castro.transverse_reset_density = 1 castro.small_dens = 1.e-5 @@ -53,8 +56,8 @@ amr.v = 1 # verbosity in Amr.cpp #amr.grid_log = grdlog # name of grid logging file # REFINEMENT / REGRIDDING -amr.max_level = 0 # maximum level number allowed -amr.ref_ratio = 2 2 2 2 # refinement ratio +amr.max_level = @nlevel@ # maximum level number allowed +amr.ref_ratio = 4 4 2 2 # refinement ratio amr.regrid_int = 2 2 2 2 # how often to regrid amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 512 diff --git a/Exec/science/Detonation/shock_paper/setup_runs.py b/Exec/science/Detonation/shock_paper/setup_runs.py new file mode 100755 index 0000000000..15c0b525b9 --- /dev/null +++ b/Exec/science/Detonation/shock_paper/setup_runs.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python + +import os +import shutil + +# tuples of label, nx, and max_level +RES_INFO = [("12.288km", "48", "0"), + ("1.536km", "384", "0"), + ("0.192km", "3072", "0"), + ("0.024km", "6144", "1"), + ("0.003km", "12288", "2")] + +INPUTS_TEMPLATE = "inputs-shock-burn.template" + +COMMON_FILES = ["helm_table.dat", + "Castro1d.gnu.MPI.SMPLSDC.ex"] + +shock_flag = "0" +shock_thresh = "0.6666" + +def doit(): + + # read in the template + with open(INPUTS_TEMPLATE) as tf: + template = tf.readlines() + + # loop over resolutions + for label, nx, max_level in RES_INFO: + + # create output direct + odir = f"res{label}" + if shock_flag == 1: + odir += "_noshockburn" + + os.mkdir(odir) + + # copy files + for f in COMMON_FILES: + shutil.copy(f, odir) + + # modify inputs + with open(f"{odir}/inputs", "w") as fin: + for line in template: + fin.write(line.replace("@nx@", nx).replace("@nlevel@", max_level).replace("@shock_flag@", shock_flag).replace("@shock_thresh@", shock_thresh)) + + +if __name__ == "__main__": + doit()