Maximum Legendre order

Hello,

I am still using version 0.10.0 (the last stable one). I wanted to tally scattering terms up to P17, but the code says that the maximum allowable order is up to 10. I have some questions to this:

  1. When OpenMC reads the coefficients to reconstruct the angular distributions from MF=4 (or even MF=6, perhaps), in order to sample outgoing directions in the normal continuous energy MC calculation, does it consider a maximum P10 term? (Maybe I just asked something stupid but well, I just want to understand why up to P10).

  2. If I want to tally either flux-moments or scattering matrices higher than P10, could I modify the _MAX_LEGENDRE constant inside the code? Or, is this worthless since perhaps the data to reconstruct angular distributions don’t go as high as that? Or, is this perhaps a code version thing? Meaning, if I install the newest version, could I go higher in moments if I like to?

Thanks a lot for your attention!

Kind regards,

Augusto

Good morning Augusto,

Good questions. I’ll answer in the order you asked:

  1. These Legendre representations from MF=4/MF=6 are not present in the data that OpenMC is using to actually perform the particle tracking. When creating the HDF5 files with the libraries, NJOY is used to convert these formats to a non-Legendre based (tabular, I think) representation which is equivalent to within a tolerance. So the _MAX_LEGENDRE constant in OpenMC has no bearing on the data processing itself.

  2. The reason for the maximum legendre order of 10 was that the Fortran implementation (in OpenMC v0.10.0) had the Legendre polynomials programmed directly, and without usage of the Legendre recursion relationship. At the time we wrote that code we didn’t expect any one to need more than P10 so explicitly adding higher orders or adopting the recursion relationship didn’t seem worth it. So even modifying _MAX_LEGENDRE would not yield the results you wish. If you really want to stick with that version, then you could modify _MAX_LEGENDRE, and add additional Legendre terms to https://github.com/openmc-dev/openmc/blob/v0.10.0/src/math.F90. Though I would recommend against that as that Fortran code is now deprecated as we have switched to C++ in v0.11.

In v0.11, the Legendre polynomial order is no longer limited as we have implemented the recursion relationship (https://github.com/openmc-dev/openmc/blob/v0.11.0/src/math_functions.cpp). Finally, I want to add on that, if you are going to extend your current analysis to include spherical harmonic tallies, those are still limited to the 10th-order in the C++ version.

Thanks, and I hope this was helpful!
Adam