Skip to content

Enable residual calculation during irradiation and evaluation#48

Open
LukeSeifert wants to merge 104 commits intoarfc:mainfrom
LukeSeifert:residual-modification
Open

Enable residual calculation during irradiation and evaluation#48
LukeSeifert wants to merge 104 commits intoarfc:mainfrom
LukeSeifert:residual-modification

Conversation

@LukeSeifert
Copy link
Copy Markdown
Collaborator

@LukeSeifert LukeSeifert commented Mar 2, 2026

Summary of changes

This PR enables users to include calculation of the residual during irradiation, which differs from existing methodologies which only allow for calculation of residuals post-irradiation.
This PR also includes a point reactor kinetics solver in the phd_results example, such that comparisons can be made between results calculated using different methodologies to evaluate their impact on simplified reactor transients.
Also in this PR is a small change to the code such that a minimum timestep can be set for OpenMC. This allows the user to use a smaller timestep while maintaining the same in-core and ex-core residence times.
Finally, this PR also includes the debug DNP functionality, such that users may manually define a DNP for testing purposes.

Many of the line changes are due to changes in the integration test files. These changed because I have added the count rate at time 0 for easier debugging and to mitigate bugs in time offsets.

The main components I would like reviewed closely are the actual MoSDeN code changes (changes to the examples and tests are less critical; most of the test changes just cover testing the new functionality and adjustments based on restructured output files)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Associated Issues and PRs

PRs:

#46 must be merged before this PR

Issues:

Associated Developers

  • Dev: @

Checklist for Reviewers

Reviewers should use this link to get to the
Review Checklist before they begin their review.

@LukeSeifert LukeSeifert self-assigned this Mar 2, 2026
Copy link
Copy Markdown
Contributor

@ZoeRichter ZoeRichter left a comment

Choose a reason for hiding this comment

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

Looks good overall - I have some small changes and questions. A general comment is that while the whitespace looks right at a glance, you have some lines that are beyond the PEP8 character limit that need to be split over multiple lines. I

Comment thread examples/four_dnps/input.json Outdated
"hls": [55.89897, 22.72614, 6.24457, 2.30281, 0.60802, 0.23028]
},
"saturation (12 Group)": {
"description": "Calculated using ENDFB71 data, post-irrad, (0.00001,0) 0.00001 second irradiation, 100 decay times, 600 decay seconds",
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.

do users (currently, you) enter this data by hand? If it isn't automated, I think you should consider scripting this bit somehow.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good suggestion! Created Issue #56 for this. There should be an option for manual data entry, but generally users should be able to just pass in the path to where their mosden output files live.

Comment thread mosden/utils/defaults.py
@@ -24,7 +24,8 @@
"processed_data_dir": f"{current_dir}/",
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.

Are these defaults you could incorporate into your classes? Maybe add a 'simulation' class or something similar?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I could, but I have found it useful to have this separate defaults file. When I want to look through my default arguments, it is very convenient to have a single script that contains all those arguments.

Comment thread mosden/base.py
The processed data for the fissile nuclide.

"""
data_path = os.path.join(self.processed_data_dir, f'{data_type}.csv')
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.

If you're already using os.path, another tip is that os.path has an "expand" function that converts paths using the ~/ shorthand into the full path for you.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For this use case it might not be necessary (since processed_data_dir is defined relative to the input file path), but I'll have to think about if that might be useful to have elsewhere

Comment thread mosden/concentrations.py Outdated
@LukeSeifert LukeSeifert requested a review from ZoeRichter April 13, 2026 18:48
@LukeSeifert
Copy link
Copy Markdown
Collaborator Author

Thanks for the feedback @ZoeRichter! Let me know if there are any other changes you think should be made in this PR, otherwise feel free to merge if everything looks good.

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.

2 participants