diff options
| author | Connor Moore <connor.moore@psi.ch> | 2026-06-25 14:39:42 +0200 |
|---|---|---|
| committer | Connor Moore <connor.moore@psi.ch> | 2026-06-25 14:39:42 +0200 |
| commit | f9f31b56f1a3f1d1cc72c0cf31472ca427a85dad (patch) | |
| tree | c3ba21c123f5844494502cba8c34306adf36ed8b | |
| parent | 6507da94c5011a6e378f0edd4533e58ea7d67676 (diff) | |
Finished unit assembly structure
| -rwxr-xr-x | hpmr.py | 27 |
1 files changed, 19 insertions, 8 deletions
@@ -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 |
