diff --git a/openmc/filter_expansion.py b/openmc/filter_expansion.py index e46bf7be16..872eaac9f5 100644 --- a/openmc/filter_expansion.py +++ b/openmc/filter_expansion.py @@ -318,15 +318,15 @@ class ZernikeFilter(ExpansionFilter): This filter allows scores to be multiplied by Zernike polynomials of the particle's position normalized to a given unit circle, up to a - user-specified order. The Zernike polynomials are defined as + user-specified order. The Zernike polynomials follow the definition by `Noll + `_ and are defined as .. math:: - Z_n^m(\rho, \theta) = R_n^m(\rho) \cos (m\theta) + Z_n^m(\rho, \theta) = \sqrt{2n + 2} R_n^m(\rho) \cos (m\theta), \quad m > 0 - and + Z_n^{m}(\rho, \theta) = \sqrt{2n + 2} R_n^{m}(\rho) \sin (m\theta), \quad m < 0 - .. math:: - Z_n^{-m}(\rho, \theta) = R_n^{-m}(\rho) \sin (m\theta) + Z_n^{m}(\rho, \theta) = \sqrt{n + 1} R_n^{m}(\rho), \quad m = 0 where the radial polynomials are @@ -334,6 +334,9 @@ class ZernikeFilter(ExpansionFilter): 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}. + With this definition, the integral of :math:`(Z_n^m)^2` over the unit disk + is exactly :math:`\pi` for each polynomial. + 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 diff --git a/src/math.F90 b/src/math.F90 index 35855c6148..ee8cd0530b 100644 --- a/src/math.F90 +++ b/src/math.F90 @@ -575,8 +575,10 @@ contains end function calc_rn !=============================================================================== -! CALC_ZN calculates the n-th order Zernike polynomial moment for a given angle -! (rho, theta) location in the unit disk. +! CALC_ZN calculates the n-th order modified Zernike polynomial moment for a +! given angle (rho, theta) location in the unit disk. The normlization of the +! polynomials is such that the integral of Z_pq*Z_pq over the unit disk is +! exactly pi !=============================================================================== subroutine calc_zn(n, rho, phi, zn)