summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xhpmr.py34
1 files changed, 27 insertions, 7 deletions
diff --git a/hpmr.py b/hpmr.py
index ea4de91..c9e8f18 100755
--- a/hpmr.py
+++ b/hpmr.py
@@ -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()