Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charged particles with a LAW=5 and LIDP=1, because -1**0 = -1 and (-1)**0 = 1 #138

Closed
whaeck opened this issue Oct 31, 2019 · 2 comments
Closed
Assignees
Labels

Comments

@whaeck
Copy link
Member

whaeck commented Oct 31, 2019

A problem was detected when running acer to produce an incident charged particle ace file: NaN values were appearing in the ACE file for a specific case where the incident charged particle and the target where the same type, with a spin s = 0. I'll add an example input file and corresponding example evaluation later.

For charged particle elastic scattering in the ENDF file, we can use MF6 LAW=5. Whenever we do this for identical particles (LIDP=1) such as proton on proton, deuteron on deuteron, triton on triton, etc., we need to calculate the coulomb scattering cross section using formula 6.10:

\sigma_{ci} = \frac{2\eta^2}{k^2 (1-\mu^2)} \left[ \frac{1+\mu^2}{1-\mu^2} + \frac{(-1)^{2s}}{2s+1} cos( \eta \ln( \frac{1 + \mu}{1 - \mu} ) ) \right]

In the case where mu = 0, this reduces to:

\sigma_{ci} ~ \left[ 1 + \frac{(-1)^{2s}}{2s+1} \right]

or when the spin s = 0 as well:

\sigma_{ci} ~ 1 + (-1)^0 ~ 2

In acer, this formula is implemented in acefc.f90, on line 6428:

               if (lidp.eq.1) sigc=((2*eta**2/wn**2)&
                 /(1-amuu**2))*((1+amuu**2)/(1-amuu**2)&
                 +(-1**i2s)*cos(eta*log((1+amuu)/(1-amuu)))&
                 /(2*spi+1))

For mu = 0, this becomes equivalent to:

\sigma_{ci} ~ \left[ 1 + \frac{-1^{2s}}{2s+1} \right]

or when the spin s = 0 as well:

\sigma_{ci} ~ 1 + -1^0 = 0

Later on (line 6439), this value would be used as the denominator in a division, thus leading to the NaN values in the resulting ACE file. Adding the missing parentheses in the coding solves the issue.

Half integer spins do not have the issue. For integer spins different from 0 (s=1,2, etc.) there still is the same issue, but it will not lead to NaN values (because of the 2s + 1 term in the denominator).

@whaeck whaeck self-assigned this Oct 31, 2019
@whaeck whaeck added the bug label Oct 31, 2019
whaeck added a commit that referenced this issue Oct 31, 2019
@whaeck
Copy link
Member Author

whaeck commented Oct 31, 2019

The issue appears in GROUPR as well. The branch fix/cpt fixes this both in ACER and GROUPR.

These appear to be the only instances of a problem like this in the entire NJOY2016 source.

@whaeck whaeck mentioned this issue Nov 1, 2019
@whaeck
Copy link
Member Author

whaeck commented Nov 1, 2019

The following input illustrates the issue using ENDF/B-VIII.0 alpha+alpha:
input.txt
a-002_He_004-ENDF8.0.endf.txt

@whaeck whaeck closed this as completed in d0675af Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant