From b4037e62ff173b5850bb500ad169eb7a7228079f Mon Sep 17 00:00:00 2001 From: Connor Moore Date: Wed, 8 Jul 2026 14:38:13 +0200 Subject: Added optional run flag for python script and merlin7 support for bash driver --- hp_height_study_driver.sh | 13 +++++++++---- krusty.py | 7 ++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/hp_height_study_driver.sh b/hp_height_study_driver.sh index ee4d4d9..e202d8c 100755 --- a/hp_height_study_driver.sh +++ b/hp_height_study_driver.sh @@ -5,16 +5,21 @@ touch results/keff_table echo "#" $(date) > results/keff_table -if [[ $1 == "lcl" ]]; then - prog=(openmc-inst01.py krusty.py -l) +if [[ $1 == "lclrs" ]]; then + prog=(openmc-inst01.py krusty.py -l -r) + pool_seq=$(seq 1 45) +elif [[ $1 == "merlin" ]]; then + prog=(../krusty.py) + pool_seq=$2 else - prog=./krusty.py + prog=(./krusty.py -r) + pool_seq=$(seq 1 45) fi green="\e[0;32m" reset="\e[0m" -for pool_height in $(seq 1 45); do +for pool_height in $pool_seq; do echo -e "$green Starting runs for $pool_height cm pool height... $reset" for sat_height in $(seq $pool_height 45); do output_file=results/outputs/p$pool_height\_s$sat_height.out diff --git a/krusty.py b/krusty.py index 80f9b64..9e0ea06 100755 --- a/krusty.py +++ b/krusty.py @@ -18,6 +18,7 @@ cli_parser = argparse.ArgumentParser( cli_parser.add_argument("-s","--sat-height",default=5.5,type=float,help="Height of wick that is saturated with Na starting at the bottom of the heat pipe (0-45) [cm], default 25.0") cli_parser.add_argument("-p","--pool-height",default=5.0,type=float,help="Height of Na pool starting at the bottom of the heat pipe (0-45) [cm], default 5.0") cli_parser.add_argument("-l","--lclrs",default=False,action="store_true",help="Flag for specifying LCLRS accessible cross-sections, default false.") +cli_parser.add_argument("-r","--run",default=False,action="store_true",help="Whether or not to automatically run OpenMC, default false.") cli_args = cli_parser.parse_args() if cli_args.pool_height < 0.0 or cli_args.pool_height > 100.0: @@ -188,8 +189,8 @@ geo_z_core_top = openmc.ZPlane(z0=25) geo_z_abs_top = openmc.ZPlane(z0=35.16,boundary_type="vacuum") geo_z_region = +geo_z_abs_bot & -geo_z_abs_top -geo_z_hp_sat = openmc.ZPlane(z0=geo_z_abs_bot.z0 + cli_args.sat_height) -geo_z_hp_pool = openmc.ZPlane(z0=geo_z_abs_bot.z0 + cli_args.pool_height) +geo_z_hp_sat = openmc.ZPlane(surface_id=416,z0=geo_z_abs_bot.z0 + cli_args.sat_height) +geo_z_hp_pool = openmc.ZPlane(surface_id=647,z0=geo_z_abs_bot.z0 + cli_args.pool_height) ## Heat Pipes ## geo_hp_cyl = [openmc.ZCylinder(r=dia/2, x0=0.0, y0=0.0) for dia in [0.8920, 1.0920, 1.270]] @@ -281,4 +282,4 @@ set_src.space = openmc.stats.CylindricalIndependent( set_obj.export_to_xml() # Run! -openmc.run() +openmc.run() if cli_args.run else None -- cgit v1.2.3