Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/openmc_mcnp_adapter/openmc_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ def get_openmc_universes(cells, surfaces, materials, data):

# Apply transformation to fill
if 'fill' in c['parameters']:
# TODO: Check for existing transformations on the fill
fill = c['parameters']['fill']
if use_degrees:
c['parameters']['*fill'] = f'{fill} {trcl}'
Expand Down
23 changes: 19 additions & 4 deletions tests/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,32 @@ def test_trcl(cell_card, surface_cards, points_inside, points_outside):
assert point not in cell.region


def test_trcl_fill():
mcnp_str = dedent("""
@mark.parametrize(
"keywords",
[
"FILL=10 TRCL=(2.0 0.0 0.0)",
"FILL=10(2.0 0.0 0.0)",
"FILL=10 TRCL=(2.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0)",
"FILL=10(2.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0)",
"FILL=10 *TRCL=(2.0 0.0 0.0 0.0 90.0 90.0 90.0 0.0 90.0 90.0 90.0 0.0)",
"*FILL=10(2.0 0.0 0.0 0.0 90.0 90.0 90.0 0.0 90.0 90.0 90.0 0.0)",
"FILL=10(1)",
"FILL=10(2)",
]
)
def test_fill_transformation(keywords):
mcnp_str = dedent(f"""
title
1 0 -1 FILL=10 TRCL=(2.0 0.0 0.0)
1 0 -1 {keywords}
2 0 -2 U=10
3 0 +2 U=10

1 so 10.0
2 so 1.0

m1 1001.80c 1.0
m1 1001.80c 1.0
tr1 2.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
*tr2 2.0 0.0 0.0 0.0 90.0 90.0 90.0 0.0 90.0 90.0 90.0 0.0
""")
model = mcnp_str_to_model(mcnp_str)
geometry = model.geometry
Expand Down