From 52dd1c6a6808d8f0ea17a656f829bb63a714ef57 Mon Sep 17 00:00:00 2001 From: Connor Moore Date: Wed, 22 Jul 2026 16:54:55 +0200 Subject: Added slice height as a parameter --- hpmr.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hpmr.py b/hpmr.py index ed703f7..02ace64 100755 --- a/hpmr.py +++ b/hpmr.py @@ -6,6 +6,7 @@ import hashlib import sys import time import string +import numpy as np ############ HLPER FUNCTIONS ############ @@ -29,10 +30,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("-z","--z-height",default="1",type=float,help="Depth of pin/assembly slice in the z-direction [cm]. Should divide nicely into 80, default 1.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("-g","--geometry-level",default="pin",choices=["pin","ass","core"],help="Geometry level to run the computation at [pin/ass/core], default pin.") cli_parser.add_argument("-d","--drums-in",default=False,action="store_true",help="Flag for specifying the control drums are rotated in, default false") -cli_parser.add_argument("-e","--execute",default=False,action="store_true",help="Whether or not to automatically run OpenMC, default false.") +cli_parser.add_argument("-p","--packing",default=False,action="store_true",help="Flag for specifying if packing information should be read from file") +cli_parser.add_argument("-e","--execute",default=False,action="store_true",help="Flag for automatically running OpenMC, default false.") cli_args = cli_parser.parse_args() if cli_args.lclrs: @@ -445,7 +448,7 @@ geo_const_pin_pitch = 2.3 geo_const_lattice_pitch = 26.752 geo_const_triso_radius = 1.0 geo_const_triso_packing = 0.40 -geo_const_height = 1.0 +geo_const_height = cli_args.z_height geo_const_z_max = openmc.ZPlane(z0=+geo_const_height,boundary_type="transmission" if cli_args.geometry_level=="core" else "reflective") geo_const_z_min = openmc.ZPlane(z0=-geo_const_height,boundary_type="transmission" if cli_args.geometry_level=="core" else "reflective") @@ -464,7 +467,7 @@ geo_triso_universe = openmc.Universe(name="TRISO Kernel Universe",cells=geo_tris ## TRISO compact ## geo_triso_compact_region = -openmc.ZCylinder(r=geo_const_triso_radius,x0=0.0,y0=0.0)&+geo_const_z_min&-geo_const_z_max -geo_triso_compact_domain = (4,4,int(2*geo_const_height)) +geo_triso_compact_domain = (4,4,int(4*geo_const_height)) # Generate packing geo_triso_compact_packing = openmc.model.pack_spheres( @@ -475,6 +478,9 @@ geo_triso_compact_packing = openmc.model.pack_spheres( pf=geo_const_triso_packing ) +# Export positions to file for backup +np.savetxt("positions.out",geo_triso_compact_packing,delimiter=",") + # Create the TRISO particles geo_triso_compact_trisos = [openmc.model.TRISO(geo_triso_spheres[4].r, geo_triso_universe, loc) for loc in geo_triso_compact_packing] -- cgit v1.2.3