Skip to content

added get_reaction_pathways_to_target#49

Open
shimwell wants to merge 2 commits intodevelopfrom
adding_chain_pathways_to_target
Open

added get_reaction_pathways_to_target#49
shimwell wants to merge 2 commits intodevelopfrom
adding_chain_pathways_to_target

Conversation

@shimwell
Copy link
Owner

@shimwell shimwell commented Feb 26, 2024

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.

1 participant