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

Implementation of ACE laws, sampling nu, and SIGMA1 doppler broadening. All codes are inspired by OpenMC. #814

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

Wenkai-Fu
Copy link

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]

  1. In Reaction class, a function called sample(self, e_in) is added to sample secondary neutron angle and energy distribution.
    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.
  2. Optimize the _get_energy_distributions function in NeutronTable class, includes:
    1. add edist.nd in law 4, 44, 61, so in sample process, code can raise AssertionError if edist.nd != 0, i.e., discrete lines presented.
      1. In law 61, take angle of secondary neutron is isotropic into account, i.e., LC = 0.

…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
@Wenkai-Fu Wenkai-Fu changed the title Add two functions two sample nu and 2nd neutron's angle and energy Add two functions to sample nu and 2nd neutron's angle and energy Feb 11, 2016
@scopatz scopatz added this to the v0.6 milestone Feb 11, 2016
@@ -25,6 +25,7 @@ from collections import OrderedDict

cimport numpy as np
import numpy as np
rand = np.random.rand
Copy link
Member

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

Copy link
Author

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.
Copy link
Member

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

@makeclean
Copy link
Contributor

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

@Wenkai-Fu Wenkai-Fu changed the title Add two functions to sample nu and 2nd neutron's angle and energy Implementation of ACE laws and SIGMA1 doppler broadening. All codes are inspired by OpenMC. May 5, 2016
@Wenkai-Fu Wenkai-Fu changed the title Implementation of ACE laws and SIGMA1 doppler broadening. All codes are inspired by OpenMC. Implementation of ACE laws, sampling nu, and SIGMA1 doppler broadening. All codes are inspired by OpenMC. May 6, 2016
@Wenkai-Fu
Copy link
Author

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)
Copy link
Member

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

@paulromano
Copy link
Member

Would be good to have a new test for the broaden() method as well

@Wenkai-Fu
Copy link
Author

Wenkai-Fu commented May 17, 2016

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.

@paulromano
Copy link
Member

@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).

@scopatz
Copy link
Member

scopatz commented May 18, 2016

Thanks for updating this @Wenkai-Fu, I'll let @paulromano keep reviewing this. I am a little overwhelmed at the moment.

@gonuke gonuke modified the milestones: v0.6, Deferred Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants