mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Added warning messages to Library for the correction and legendre_order properties
This commit is contained in:
parent
a6fd59a622
commit
f184f2a9e9
2 changed files with 19 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue