From b489cd628f243d3ad8fb8f53719826e534a490e7 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 14 Apr 2021 09:44:12 -0500 Subject: [PATCH] Support periodic boundaries in rectangular_prism --- openmc/model/funcs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openmc/model/funcs.py b/openmc/model/funcs.py index 00a092cc3..53f3a4b2a 100644 --- a/openmc/model/funcs.py +++ b/openmc/model/funcs.py @@ -175,10 +175,17 @@ def rectangular_prism(width, height, axis='z', origin=(0., 0.), max_x1 = plane(x1, 'maximum', width/2 + origin[0]) min_x2 = plane(x2, 'minimum', -height/2 + origin[1]) max_x2 = plane(x2, 'maximum', height/2 + origin[1]) + if boundary_type == 'periodic': + min_x1.periodic_surface = max_x1 + min_x2.periodic_surface = max_x2 prism = +min_x1 & -max_x1 & +min_x2 & -max_x2 # Handle rounded corners if given if corner_radius > 0.: + if boundary_type == 'periodic': + raise ValueError('Periodic boundary conditions not permitted when ' + 'rounded corners are used.') + args = {'R': corner_radius, 'boundary_type': boundary_type} args[x1 + '0'] = origin[0] - width/2 + corner_radius