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

Decay photon source functionality #2234

Merged
merged 12 commits into from
Sep 30, 2022

Conversation

paulromano
Copy link
Contributor

This PR adds the ability to calculate decay photon sources for 1) a single unstable nuclide, 2) a material, and 3) indirectly, the results of a depletion calculation. It works as follows:

  • openmc.data.decay_photon_soure(nuc) is a new function that relies on the existing Decay.sources property that was added in Add ability to get sources from Decay class #2135. It relies on getting data from the depletion chain file, which has been enhanced to store decay sources. Note that this will increase the size of our depletion chain files, but they are still manageable. For example, a full ENDF/B-VII.1 chain will be about 27 MB (currently it's about ~2 MB).
  • The Material class now has a decay_photon_source attribute that will loop over the nuclides and accumulate a photon source from the individual nuclide sources.
  • For depletion calculations, the StepResult class now has a get_material method, so to get a photon source corresponding to a depleted/activated material, you would run something like:
    results = openmc.deplete.Results('depletion_results.h5')
    last_step = results[-1]
    mat = last_step.get_material("1")
    photon_source = mat.decay_photon_source

If and when this is merged, I'll go ahead and update our existing depletion chain files available on https://openmc.org with the necessary data so that this new functionality can be used without users needing to generate their own chain files. For now, if you want to play around with an ENDF/B-VII.1 chain with sources, you can get it here.

@shimwell
Copy link
Member

Fantastic, really interesting feature. I'm looking forward to working through all of this. Thanks Paul

@paulromano paulromano linked an issue Sep 26, 2022 that may be closed by this pull request
openmc/material.py Outdated Show resolved Hide resolved
openmc/material.py Outdated Show resolved Hide resolved
@shimwell
Copy link
Member

I see decay_photon_source is in quite a few places, how do people feel about changing this to something like decay_photon_energy or decay_photon_energy_distribution before I go through and make a mess with inline suggestions everywhere 😄

My main concern is that users will assume it is an openmc.Source object due to the naming. I know this is clear in the docstring but it could be even clearer 😄

@shimwell
Copy link
Member

shimwell commented Sep 28, 2022

Made a nice spectra during the testing of this PR

result

@paulromano
Copy link
Contributor Author

@shimwell Thanks for the thorough review and suggestions. All comments should be addressed — let me know if you have further requests.

@shimwell
Copy link
Member

All looks good to me @paulromano

I can take another look just to be sure.

If you could ping me when doing that material refactoring on a future PR I would be interested in seeing how it is done

@paulromano
Copy link
Contributor Author

@shimwell will do!

Copy link
Member

@shimwell shimwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice feature. Would be great to get this merged in.

The only last thought I had was do we need to add anything to the docstrings to let the user know that the probabilities are in units of [decays per second]

@paulromano
Copy link
Contributor Author

@shimwell Good suggestion -- I've just updated that.

@shimwell
Copy link
Member

I'm already making use of this gamma energy feature over here

gamma_spec

@shimwell
Copy link
Member

Just wondering if @pshriwise wanted to take a peak before we merge this.

Copy link
Contributor

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @paulromano. Really nice feature to have for our FES work 😄 A few small thoughts from me.

openmc/data/decay.py Show resolved Hide resolved
openmc/deplete/nuclide.py Outdated Show resolved Hide resolved
openmc/material.py Show resolved Hide resolved
@shimwell shimwell merged commit 4604558 into openmc-dev:develop Sep 30, 2022
@paulromano paulromano deleted the decay-source-chain branch October 1, 2022 00:53
@cfichtlscherer
Copy link
Contributor

This is a fantastic feature!
Did you extract the decay chains from ENDVB/VII?
So there is more data given for isotopes in the ENSDF data. Maybe we can include these isotopes as well?

@shimwell
Copy link
Member

shimwell commented Oct 1, 2022

I think the plan is too follow up this PR with a PR to the Data repo which will contain the data processing script that extracts the gamma energy from the ENDF files. It would be great to get your input on that future PR @cfichtlscherer

@paulromano
Copy link
Contributor Author

@cfichtlscherer I'm curious about your comment:

there is more data given for isotopes in the ENSDF data

Can you elaborate on this a bit? Are there particular nuclides for which ENDF/B-VII.1 is lacking accurate photon spectra relative to ENSDF?

@cfichtlscherer
Copy link
Contributor

Hi Paul,

I would be happy if I could help a little bit and hope I haven't understood things wrong. I believe the ENSDF data is more comprehensive than ENDF/B-VII.1 data concerning the information of gamma emissions.

ENSDF data can be obtained via different sources. For example:

(strangely, these two sources differ for several isotopes and gamma lines.)

By comparing the chain_endfb71_with_sources.xml with the ENSDF data, many differences can be noticed. Here are some random examples that can maybe help to start a discussion on structural differences in the two data sets (I haven't written a script for checking all differences):

  • Be-7 doesn't exist in the ENDFB-VII chain file, but according to the ENSDF files, it has a half-life of around 53 days and emits 477 keV gamma particles during decay.

  • B-12 has according ENSDF the gamma lines of 3216.9keV and 4438.9keV, while the ENDFB-VII chain file gives the lines 0.277keV and 4438.030keV. (While 3216.9keV has a very small intensity, 0.277keV seems not to exist at all in the ENSDF files.)

  • Pu-239 has fewer lines in the ENDFB-VII chain file. For example the 1009.4keV line, which has a higher intensity as the existing 918.7keV line is missing.

Please don't take this as criticism. It is incredible work to dig through this data, and the ENDFB-VII chain already enables a lot and is a great new feature. It is instead to be seen as an idea and a suggestion.

@Ebiwonjumi
Copy link

As a follow up on @cfichtlscherer comment, to add, ORIGEN uses data from ENSDF for gamma source intensity and spectra calculations. It then supplements with ENDF/B data for nuclides with no ENSDF data.

Another thought on the comment on unit by @shimwell, for the decay photon source, I was wondering the unit should be in photons per second?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define Gamma Source via Isotopes
5 participants