diff --git a/openmc/filter_expansion.py b/openmc/filter_expansion.py index f6e808dd2..e46bf7be1 100644 --- a/openmc/filter_expansion.py +++ b/openmc/filter_expansion.py @@ -317,12 +317,27 @@ class ZernikeFilter(ExpansionFilter): r"""Score Zernike expansion moments in space up to specified order. This filter allows scores to be multiplied by Zernike polynomials of the - particle's position along a particular axis, normalized to a given unit - circle, up to a user-specified order. Specifying a filter with order N - tallies moments for all radial orders from 0 to N and each azimuthal order - for a given radial order. The ordering of the Zernike polynomial moments - follows the ANSI Z80.28 standard, where bin :math:`j` corresponds to the - radial index :math:`n` and the azimuthal index :math:`m` by + particle's position normalized to a given unit circle, up to a + user-specified order. The Zernike polynomials are defined as + + .. math:: + Z_n^m(\rho, \theta) = R_n^m(\rho) \cos (m\theta) + + and + + .. math:: + Z_n^{-m}(\rho, \theta) = R_n^{-m}(\rho) \sin (m\theta) + + where the radial polynomials are + + .. math:: + R_n^m(\rho) = \sum\limits_{k=0}^{(n-m)/2} \frac{(-1)^k (n-k)!}{k! ( + \frac{n+m}{2} - k)! (\frac{n-m}{2} - k)!} \rho^{n-2k}. + + Specifying a filter with order N tallies moments for all :math:`n` from 0 to + N and each value of :math:`m`. The ordering of the Zernike polynomial + moments follows the ANSI Z80.28 standard, where the one-dimensional index + :math:`j` corresponds to the :math:`n` and :math:`m` by .. math:: j = \frac{n(n + 2) + m}{2}. diff --git a/src/tallies/tally_filter_zernike.F90 b/src/tallies/tally_filter_zernike.F90 index 19b7cd980..e96a53a7f 100644 --- a/src/tallies/tally_filter_zernike.F90 +++ b/src/tallies/tally_filter_zernike.F90 @@ -76,7 +76,7 @@ contains do i = 1, this % n_bins call match % bins % push_back(i) - call match % weights % push_back(zn(i) / SQRT_PI) + call match % weights % push_back(zn(i)) end do end subroutine get_all_bins diff --git a/tests/unit_tests/test_filters.py b/tests/unit_tests/test_filters.py index 6060b55d7..488badbfa 100644 --- a/tests/unit_tests/test_filters.py +++ b/tests/unit_tests/test_filters.py @@ -145,4 +145,4 @@ def test_first_moment(run_in_tmpdir, box_model): assert first_score(leg_sptl_tally) == scatter assert first_score(sph_scat_tally) == scatter assert first_score(sph_flux_tally) == approx(flux) - assert first_score(zernike_tally)*sqrt(pi) == approx(scatter) + assert first_score(zernike_tally) == approx(scatter)