summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xhpmr.py10
-rwxr-xr-xtriso_study_driver.sh18
2 files changed, 19 insertions, 9 deletions
diff --git a/hpmr.py b/hpmr.py
index 0eaa9ba..8551f7d 100755
--- a/hpmr.py
+++ b/hpmr.py
@@ -20,8 +20,12 @@ cli_parser = argparse.ArgumentParser(
cli_parser.add_argument("-t","--technique",default="none",choices=["none","vwh","rpt","rrpt"],help="What homogenization technique to use (if any) [none/vwh/rpt/rrpt], default none")
cli_parser.add_argument("-r","--radius",default="0.8",type=float,help="Radius for RPT or RRPT homogenization [cm], default 0.8 cm. In the case of RRPT, this is the inner radius.")
+cli_parser.add_argument("-l","--lclrs",default=False,action="store_true",help="Flag for specifying LCLRS accessible cross-sections, default false.")
cli_args = cli_parser.parse_args()
+if cli_args.lclrs:
+ openmc.config["cross_sections"] = "/libs/endfb81_official/cross_sections.xml"
+
############ INTPUT-OUTPUT MAPPING ############
path = sys.argv[0]
@@ -30,11 +34,11 @@ with open(path, "rb") as file:
filehash = hashlib.md5(contents).hexdigest()
-print("="*60)
+print("="*70)
print(f"Run date CET: {time.ctime()}")
print(f"Input file MD5: {filehash}")
print(f"Input arguments: {cli_args}")
-print("="*60)
+print("="*70)
############ MATERIALS ############
# All materials are specified in the report on HEAT PIPE MICROREACTOR MODELING WITH BLUECRAB
@@ -667,4 +671,4 @@ geometry.export_to_xml()
settings.export_to_xml()
# Run!
-#openmc.run()
+openmc.run()
diff --git a/triso_study_driver.sh b/triso_study_driver.sh
index 835d819..4c99c1e 100755
--- a/triso_study_driver.sh
+++ b/triso_study_driver.sh
@@ -1,20 +1,26 @@
#!/bin/bash
+if [[ $1 == "lcl" ]]; then
+ prog=openmc-inst01.py
+else
+ prog=./hpmr.py
+fi
+
mkdir -p results/ results/rpt results/rrpt
touch results/rpt_table results/rrpt_table
-echo "\#" `date` > results/rpt_table
-echo "\#" `date` > results/rrpt_table
+echo "\#" $(date) > results/rpt_table
+echo "\#" $(date) > results/rrpt_table
# 1. Basic calculation without homogenization
echo "Running explicit TRISO calculation..."
-./hpmr.py > results/explicit.out
+$prog -t none > results/explicit.out
keff=$(cat results/explicit.out| grep "Combined k-effective" | cut -d "=" -f 2 | cut -d "+" -f 1)
pm=$(cat results/rpt/explicit.out | grep "Combined k-effective" | cut -d "=" -f 2 | cut -d "-" -f 2)
echo Found $keff +/- $pm for explicit!
# 2. VWH calculation
echo "Running VWH homogenization calculation..."
-./hpmr.py > results/vwh.out
+$prog -t vwh > results/vwh.out
keff=$(cat results/vwh.out| grep "Combined k-effective" | cut -d "=" -f 2 | cut -d "+" -f 1)
pm=$(cat results/rpt/vwh.out | grep "Combined k-effective" | cut -d "=" -f 2 | cut -d "-" -f 2)
echo Found $keff +/- $pm for VWH!
@@ -23,7 +29,7 @@ echo Found $keff +/- $pm for VWH!
# 0.025 step size -> 21 iterations
for rad in $(seq 0.65 0.025 1.15); do
echo Running RPT with $rad cm...
- ./hpmr.py -t rpt -r $rad > results/rpt/$rad.out
+ $prog -t rpt -r $rad > results/rpt/$rad.out
keff=$(cat results/rpt/$rad.out | grep "Combined k-effective" | cut -d "=" -f 2 | cut -d "+" -f 1)
pm=$(cat results/rpt/$rad.out | grep "Combined k-effective" | cut -d "=" -f 2 | cut -d "-" -f 2)
echo Found $keff +/- $pm for RPT with r=$rad cm...
@@ -34,7 +40,7 @@ done
# 0.025 step size -> 35 iterations
for rad in $(seq 0.1 0.025 0.95); do
echo Running RRPT with $rad cm...
- ./hpmr.py -t rrpt -r $rad > results/rrpt/$rad.out
+ $prog -t rrpt -r $rad > results/rrpt/$rad.out
keff=$(cat results/rrpt/$rad.out | grep "Combined k-effective" | cut -d "=" -f 2 | cut -d "+" -f 1)
pm=$(cat results/rrpt/$rad.out | grep "Combined k-effective" | cut -d "=" -f 2 | cut -d "-" -f 2)
echo Found $keff +/- $pm for RRPT with r=$rad cm...