diff options
| author | Connor Moore <connor.moore@psi.ch> | 2026-06-25 15:13:22 +0200 |
|---|---|---|
| committer | Connor Moore <connor.moore@psi.ch> | 2026-06-25 15:13:22 +0200 |
| commit | 6c2d952d19bec1a0866e0ccc547bacd63d19c560 (patch) | |
| tree | 12ce20faa1dbbb28f0db4706cfe49b7a18121c89 /hpmr.py | |
| parent | f9f31b56f1a3f1d1cc72c0cf31472ca427a85dad (diff) | |
Working minimum example of infinite fuel lattice. Added entropy support.
Diffstat (limited to 'hpmr.py')
| -rwxr-xr-x | hpmr.py | 34 |
1 files changed, 27 insertions, 7 deletions
@@ -121,12 +121,12 @@ materials.export_to_xml() ############ GEOMETRY ############ # All measurements are in cm unless specified geo_constant_pin_pitch = 2.3 -geo_constant_lattice_pitch = 26.752 +geo_constant_lattice_pitch = 26.752/3**0.5 geo_constant_triso_radius = 1.0 geo_constant_triso_packing = 0.40 geo_constant_height = 1.0 -geo_constant_z_max = openmc.ZPlane(z0=+geo_constant_height) -geo_constant_z_min = openmc.ZPlane(z0=-geo_constant_height) +geo_constant_z_max = openmc.ZPlane(z0=+geo_constant_height,boundary_type="reflective") +geo_constant_z_min = openmc.ZPlane(z0=-geo_constant_height,boundary_type="reflective") ### Inidividual Pin Universes ### @@ -214,15 +214,16 @@ 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=geo_constant_lattice_pitch, orientation="y", origin=(0.0,0.0), boundary_type="reflective" ) -geo_assembly_cell = openmc.Cell(name="Unit Assembly Cell",fill=geo_assembly_lattice,region=-geo_assembly_region) -geo_outer_cell = openmc.Cell(name="Unit Assembly Void Outer",fill=None,region=+geo_assembly_region) -geo_assembly_universe = openmc.Universe(cells=[geo_assembly_cell,geo_outer_cell]) +# Clip the lattice to the space and make it root +geo_assembly_cell = openmc.Cell(name="Unit Assembly Cell",fill=geo_assembly_lattice,region=-geo_assembly_region&+geo_constant_z_min&-geo_constant_z_max) +#geo_outer_cell = openmc.Cell(name="Unit Assembly Void Outer",fill=None,region=~(geo_assembly_cell.region)) +geo_assembly_universe = openmc.Universe(cells=[geo_assembly_cell]) geometry = openmc.Geometry(geo_assembly_universe) geometry.export_to_xml() @@ -232,4 +233,23 @@ settings = openmc.Settings() settings.particles = 10000 settings.batches = 100 settings.inactive = 50 + +# Source sampling +set_source_pts = [] +for loc in geo_triso_compact_packing: + point = openmc.stats.Point(xyz=loc) + set_source_pts.append(openmc.IndependentSource(space=point)) + +settings.source = set_source_pts + +# Mesh for Shannon Entropy +set_entropy_mesh = openmc.RegularMesh() +set_entropy_mesh.lower_left=(-geo_constant_lattice_pitch,-geo_constant_lattice_pitch,-geo_constant_height) +set_entropy_mesh.upper_right=(+geo_constant_lattice_pitch,+geo_constant_lattice_pitch,+geo_constant_height) +set_entropy_mesh.dimension=(30,30,30) + +settings.entropy_mesh=set_entropy_mesh + +# Run! settings.export_to_xml() +openmc.run() |
