From f184f2a9e9b34d043d05de26748e82f6f57b9255 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Wed, 11 May 2016 14:27:33 -0400 Subject: [PATCH] Added warning messages to Library for the correction and legendre_order properties --- openmc/mgxs/library.py | 14 ++++++++++++++ openmc/mgxs/mgxs.py | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index f2a5c7569b..ea856d735c 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -297,12 +297,26 @@ class Library(object): @correction.setter def correction(self, correction): cv.check_value('correction', correction, ('P0', None)) + + if correction == 'P0' and self.legendre_order > 0: + msg = 'The P0 correction will be ignored since the scattering ' \ + 'order {} is greater than zero'.format(self.legendre_order) + warnings.warn(msg) + self._correction = correction @legendre_order.setter def legendre_order(self, legendre_order): cv.check_type('legendre_order', legendre_order, Integral) cv.check_greater_than('legendre_order', legendre_order, 0, equality=True) + cv.check_less_than('legendre_order', legendre_order, 10, equality=True) + + if self.correction == 'P0' and legendre_order > 0: + msg = 'The P0 correction will be ignored since the scattering ' \ + 'order {} is greater than zero'.format(self.legendre_order) + warnings.warn(msg, RuntimeWarning) + self.correction = None + self._legendre_order = legendre_order @tally_trigger.setter diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index dc3d0d127b..830b6d7666 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -2034,11 +2034,15 @@ class ScatterMatrixXS(MGXS): subdomains='all', nuclides='all', moment='all', xs_type='macro', order_groups='increasing', row_column='inout', value='mean', **kwargs): - """Returns an array of multi-group cross sections. + r"""Returns an array of multi-group cross sections. This method constructs a 2D NumPy array for the requested scattering matrix data data for one or more energy groups and subdomains. + NOTE: The scattering moments are not multiplied by the :math:`(2l+1)/2` + prefactor in the expansion of the scattering source into Legendre + moments in the neutron transport equation. + Parameters ---------- in_groups : Iterable of Integral or 'all'