Skip to content

Commit

Permalink
fix #7374 use bounded_universe() if no graveyard
Browse files Browse the repository at this point in the history
  • Loading branch information
moellep committed Feb 14, 2025
1 parent a95483b commit bdf0d03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
11 changes: 3 additions & 8 deletions sirepo/package_data/template/openmc/parameters.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,16 @@ def create_geometry():
auto_geom_ids=True,
)
{% if reflectivePlanes_useReflectivePlanes == '1' %}
# creates an edge of universe boundary surface
vac_surf = openmc.Sphere(r=10000, boundary_type="vacuum")
{{ planes }}
univ = openmc.Cell(
region=-vac_surf {{ region }},
fill=univ,
region={{ region }},
fill=univ.bounded_universe(),
)
openmc.Geometry([univ]).export_to_xml()
{% elif hasGraveyard %}
openmc.Geometry(univ).export_to_xml()
{% else %}
graveyard = openmc.Sphere(r=10000, boundary_type="vacuum")
root = openmc.Universe()
root.add_cells([openmc.Cell(region=-graveyard, fill=univ)])
openmc.Geometry(root).export_to_xml()
openmc.Geometry(univ.bounded_universe()).export_to_xml()
{% endif %}


Expand Down
6 changes: 4 additions & 2 deletions sirepo/template/openmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,10 +1126,12 @@ def _prep_standard_material_cache():
def _region(data):
res = ""
for i, p in enumerate(data.models.reflectivePlanes.planesList):
if res:
res += " & "
if p.inside == "1":
res += f"& +p{i + 1} "
res += f"+p{i + 1}"
else:
res += f"& -p{i + 1} "
res += f"-p{i + 1}"
return res


Expand Down

0 comments on commit bdf0d03

Please sign in to comment.