Skip to content

Commit

Permalink
Add support for TRC macrobody (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano authored Oct 23, 2024
1 parent 253776e commit b29bf62
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Some geometry features are not currently supported:

- Periodic boundary conditions
- `X`, `Y`, and `Z` surfaces with 1 or 3 coordinate pairs
- `RHP`, `REC`, `TRC`, `ELL`, `WED`, and `ARB` macrobodies
- `RHP`, `REC`, `ELL`, `WED`, and `ARB` macrobodies
- Hexagonal lattices
- One-dimensional lattices
- Two-dimensional lattices with basis other than x-y
Expand Down
12 changes: 12 additions & 0 deletions src/openmc_mcnp_adapter/openmc_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
RightCircularCylinder as RCC,
RectangularParallelepiped as RPP,
OrthogonalBox as BOX,
ConicalFrustum as TRC,
)
from openmc.model import surface_composite

Expand Down Expand Up @@ -45,6 +46,11 @@
4: ('ymin', False),
5: ('zmax', True),
6: ('zmin', False)
},
TRC: {
1: ('cone', False),
2: ('plane_top', False),
3: ('plane_bottom', True),
}
}

Expand Down Expand Up @@ -356,6 +362,12 @@ def flip_sense(surf):
surf = BOX(v, a1, a2, a3)
else:
surf = BOX(v, a1, a2)
elif s['mnemonic'] == 'trc':
v = coeffs[:3]
h = coeffs[3:6]
r1 = coeffs[6]
r2 = coeffs[7]
surf = TRC(v, h, r1, r2)
else:
raise NotImplementedError('Surface type "{}" not supported'
.format(s['mnemonic']))
Expand Down

0 comments on commit b29bf62

Please sign in to comment.