Skip to content

Add chain parameter to Material.get_activity for half-life data#3957

Open
EdenRochmanSharabi wants to merge 7 commits into
openmc-dev:developfrom
EdenRochmanSharabi:feature/get-activity-chain-halflife
Open

Add chain parameter to Material.get_activity for half-life data#3957
EdenRochmanSharabi wants to merge 7 commits into
openmc-dev:developfrom
EdenRochmanSharabi:feature/get-activity-chain-halflife

Conversation

@EdenRochmanSharabi

@EdenRochmanSharabi EdenRochmanSharabi commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add optional chain parameter to Material.get_activity() and Results.get_activity() that accepts a depletion chain (object or path to XML)
  • When provided, half-life values from the chain are preferred over the default ENDF/B-VIII.0 values
  • Nuclides not found in the chain fall back to the default openmc.data.decay_constant()

Test plan

  • Verify get_activity() without chain parameter produces identical results to current behavior
  • Verify get_activity(chain=chain) uses chain half-life values
  • Verify fallback to default values for nuclides not in the chain
  • Verify Results.get_activity(chain=...) passes the parameter through correctly

Closes #3529

When a depletion chain is provided, half-life values from the chain
are preferred over the default ENDF/B-VIII.0 values. This allows
users to compute activity using chain-specific nuclear data. For
nuclides not found in the chain, the default values are used as a
fallback. The same parameter is also added to Results.get_activity.

Closes openmc-dev#3529

@paulromano paulromano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR @EdenRochmanSharabi! I ended up doing a bit of refactoring here, namely extending half_life and decay_constant to take the chain_file arguments to make things more explicitly. I've also introduced the following convention:

  • chain_file=False means "use ENDF data"
  • chain_file=None means "use the default in openmc.config['chain_file']
  • chain_file=x means use the chain from path or Chain object x

For half_life and decay_constant, the default is chain_file=False to preserve the existing behavior. For Material and Results, the get_activity methods default to chain_file=None to use whatever chain file is configured.

@shimwell I'd appreciate a second opinion on my design here. Does it seem reasonable to you?

@shimwell shimwell self-assigned this Jul 8, 2026
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.

openmc.deplete.Results.get_activity() with default half life values from ENDF/B-VIII.0

3 participants