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
Implementation of ACE laws, sampling nu, and SIGMA1 doppler broadening. All codes are inspired by OpenMC. #814
base: develop
Are you sure you want to change the base?
Conversation
…ation regions(NR!=0) is encounted in sample(); 2.discrete lines (ND!=0) in _get_energy_distribution()\nAccount isotropic mu case in law 61; Integrate sample function
…sample function for complete read ace data; write tabular_sample function for neat
@@ -25,6 +25,7 @@ from collections import OrderedDict | |||
|
|||
cimport numpy as np | |||
import numpy as np | |||
rand = np.random.rand |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is more normal to do
from numpy.random import rand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
INTERPOLATE_TAB1 interpolates a function between two points based on | ||
particular interpolation scheme. The data needs to be organized as a ENDF TAB1 | ||
type function containing the interpolation regions, break points, and | ||
tabulated x's and y's. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring content should align with quotes
Looks like CI is failing for the same reason as in my PR #826 - I will have a play to see if I can figure out what it is. I think that maybe minconda has its own gfortran version which is older than the gfortran we load at the begining of .travis.yml |
Hi @scopatz , the implementation of the ACE Laws governing neutron interactions has been written, together with the Doppler broadening of the cross section by SIGMA1 method (inspired by OpenMC). Thanks. |
# At sample stage, use nd to determine if there is | ||
# discrete lines error | ||
edist.intt.append(INTTp % 10) | ||
edist.nd.append(INTTp / 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be INTTp // 10
Would be good to have a new test for the |
Hi @paulromano , do you have any idea about verifying the broadened cross section, e.g., compare the broadened value with your OpenMC results, because I am not familiar with Fortran? Thanks. |
@Wenkai-Fu The doppler module that is in OpenMC has not been thoroughly tested and I know that others have discovered issues with it, so I wouldn't consider comparison with OpenMC to be of much value. It would be better to compare to NJOY or, better yet, Fudge (which is open source). |
Thanks for updating this @Wenkai-Fu, I'll let @paulromano keep reviewing this. I am a little overwhelmed at the moment. |
1, In NeutronTable class, a function called sample_nu(self, e_in) is added to sample outgoing nu.
Input: e_in, user-specified incident neutron energy
Outcome: [nu_total, nu_prompt, nu_delay], if no data is contained in this neutron table, return None, e.g., if only total nu data is presented, return [nu_total, None, None]
Input: e_in, user-specified incident neutron energy
Output: [mu, E_out], secondary neutron's angle and energy. In sampling E_out, the applied ace laws are: 3(Inelastic level scattering), 4(Continuous Tabular Distribution), 44(Kalbach-87 Formalism), 61(correlated_sample). Other ace laws can be implemented in the future.