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

Adding chain pathways to target #2883

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

Conversation

shimwell
Copy link
Member

Description

This PR proposes a method of getting the reaction pathways from a openmc.chain object. We have a few other get methods in the chain class so I wonder if more methods are welcome or if this is unessecary bloat. Naturally I find it useful to be able to find the reaction pathways to a specific target nuclide.

For example here is the user code that gets the reaction pathways for making stable Gold which surely everyone would want to know.

example usage

import os
import openmc
import openmc.deplete
chain_file = os.environ['OPENMC_CHAIN_FILE']
chain = openmc.deplete.Chain.from_xml(chain_file)
pathways = chain.get_reaction_pathways_to_target()
pathways['Au197']
>>> [('Hg197', '(n,p)'), ('Hg197_m1', '(n,p)'), ('Hg198', '(n,np)'), ('Hg198', '(n,d)')]

In addition to the chain reactions this method also accounts for secondaries so that the pathways for producing helium or hydrogen isotopes can also be found like this tritium_pathways=pathways['H3']

I've added some simple tests that check the types and contents on the returned dictionary

Fixes # (issue)

Checklist

  • I have performed a self-review of my own code
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

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.

None yet

1 participant