From f9f31b56f1a3f1d1cc72c0cf31472ca427a85dad Mon Sep 17 00:00:00 2001 From: Connor Moore Date: Thu, 25 Jun 2026 14:39:42 +0200 Subject: Finished unit assembly structure --- hpmr.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/hpmr.py b/hpmr.py index ff9d549..ea4de91 100755 --- a/hpmr.py +++ b/hpmr.py @@ -194,16 +194,28 @@ geo_mod_universe = openmc.Universe(name="Moderator Pin Universe",cells=geo_mod_c geo_assembly_lattice = openmc.HexLattice() geo_assembly_lattice.center=(0,0) geo_assembly_lattice.pitch=(geo_constant_pin_pitch,) -outer = [geo_triso_compact_universe]*12 -middle = [geo_mod_universe]*6 -inner = [geo_triso_compact_universe] -geo_assembly_lattice.universes=[outer,middle,inner] geo_assembly_lattice.outer=openmc.Universe(cells=[openmc.Cell(fill=mat_graphite_matrix)]) +# Create the lattice structure +geo_assembly_lattice_map = [] +for i in range(0,7): + if i%2 == 0: + ring = [geo_pipe_universe]*(36-6*i) + ring[1::2] = [geo_triso_compact_universe]*len(ring[1::2]) + geo_assembly_lattice_map.append(ring) + else: + ring = [geo_mod_universe]*(36-6*i) + ring[::2] = [geo_triso_compact_universe]*len(ring[::2]) + geo_assembly_lattice_map.append(ring) + +geo_assembly_lattice_map[-1] = [geo_pipe_universe] + +geo_assembly_lattice.universes=geo_assembly_lattice_map + +# Bound it to a unit assembly geo_assembly_region = openmc.model.HexagonalPrism( - #edge_length=geo_constant_lattice_pitch*3**(0.5), - edge_length=10.0, - orientation="x", + edge_length=geo_constant_lattice_pitch/3**0.5, + orientation="y", origin=(0.0,0.0), boundary_type="reflective" ) @@ -215,7 +227,6 @@ geo_assembly_universe = openmc.Universe(cells=[geo_assembly_cell,geo_outer_cell] geometry = openmc.Geometry(geo_assembly_universe) geometry.export_to_xml() - ############ SETTINGS ############ settings = openmc.Settings() settings.particles = 10000 -- cgit v1.2.3