diff --git a/openmc/weight_windows.py b/openmc/weight_windows.py index 0502d309f5..d52b81925a 100644 --- a/openmc/weight_windows.py +++ b/openmc/weight_windows.py @@ -513,9 +513,19 @@ def wwinp_to_wws(path: PathLike) -> list[WeightWindows]: line_arr = np.fromstring(wwinp.readline(), sep=' ') xyz2 = line_arr[:3] - # oriented polar and azimuthal vectors aren't yet supported - if np.count_nonzero(xyz1) or np.count_nonzero(xyz2): - raise NotImplementedError('Custom sphere/cylinder orientations are not supported') + # Get polar and azimuthal axes + polar_axis = xyz1 - xyz0 + azimuthal_axis = xyz2 - xyz0 + + # Check for polar axis other than (0, 0, 1) + norm = np.linalg.norm(polar_axis) + if not np.isclose(polar_axis[2]/norm, 1.0): + raise NotImplementedError('Polar axis not aligned to z-axis not supported') + + # Check for azimuthal axis other than (1, 0, 0) + norm = np.linalg.norm(azimuthal_axis) + if not np.isclose(azimuthal_axis[0]/norm, 1.0): + raise NotImplementedError('Azimuthal axis not aligned to x-axis not supported') # read geometry type nwg = int(line_arr[-1]) diff --git a/tests/regression_tests/weightwindows/ww_n_cyl.txt b/tests/regression_tests/weightwindows/ww_n_cyl.txt index 89232628fa..6f6144ca30 100644 --- a/tests/regression_tests/weightwindows/ww_n_cyl.txt +++ b/tests/regression_tests/weightwindows/ww_n_cyl.txt @@ -2,7 +2,7 @@ 1 8.0000 7.0000 8.0000 0.0000 0.0000 -9.0001 2.0000 2.0000 4.0000 0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 2.0000 +1.0000 0.0000 -9.0001 2.0000 0.0000 3.0000 3.0200 1.0000 5.0000 6.0001 1.0000 0.0000 4.0000 8.0080 1.0000 3.0000 14.002 diff --git a/tests/regression_tests/weightwindows/ww_n_sph.txt b/tests/regression_tests/weightwindows/ww_n_sph.txt index 3f9b8dab6d..a4418ceeb5 100644 --- a/tests/regression_tests/weightwindows/ww_n_sph.txt +++ b/tests/regression_tests/weightwindows/ww_n_sph.txt @@ -2,7 +2,7 @@ 1 8.0000 7.0000 8.0000 0.0000 0.0000 -9.0001 2.0000 4.0000 4.0000 0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 3.0000 +1.0000 0.0000 -9.0001 3.0000 0.0000 3.0000 3.0200 1.0000 5.0000 6.0001 1.0000 0.0000 2.0000 0.25000 1.0000 1.0000 0.50000