Skip to content

More accurately simulate the neutron flux profile - #3653

Open
OceanNuclear wants to merge 202 commits into
mainfrom
neutronics
Open

OceanNuclear wants to merge 202 commits into
mainfrom
neutronics

Conversation

@OceanNuclear

@OceanNuclear OceanNuclear commented May 2, 2025 •

Copy link
Copy Markdown
Contributor

Description

Calculates the neutron flux profile in the first wall and blanket, using an extremely simplified diffusion-based model of an infinite slab sandwich.

Reason for choosing this model

It's better than not having a neutronics model.
It's also very simplified, so it can be calculated on the fly, without installing any deterministic neutron transport codes as dependency.

Checklist

I confirm that I have completed the following checks:

  • My changes follow the PROCESS style guide
  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

@codecov-commenter

codecov-commenter commented May 2, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.28899% with 410 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.40%. Comparing base (0b69cfc) to head (7dfd8c0).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
process/models/neutronics/base.py 48.15% 281 Missing ⚠️
process/models/neutronics/data.py 65.22% 129 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3653      +/-   ##
==========================================
+ Coverage   50.26%   50.40%   +0.14%     
==========================================
  Files         181      184       +3     
  Lines       30629    31550     +921     
==========================================
+ Hits        15395    15904     +509     
- Misses      15234    15646     +412     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@OceanNuclear
OceanNuclear requested a review from chris-ashe May 2, 2025 21:04
@chris-ashe chris-ashe added Physics Relating to the physics models Neutronics Power Cycle and removed Physics Relating to the physics models labels May 6, 2025
@OceanNuclear
OceanNuclear force-pushed the neutronics branch 2 times, most recently from a7c3d81 to 56884d7 Compare June 4, 2025 15:47
@OceanNuclear OceanNuclear changed the title First commit - made a mockup of NeutronFluxProfile calculator. More accurately simulate the neutron flux profile, to get a more accurate estimate of the neutronics quantities. Jun 4, 2025
@OceanNuclear OceanNuclear changed the title More accurately simulate the neutron flux profile, to get a more accurate estimate of the neutronics quantities. More accurately simulate the neutron flux profile Jun 4, 2025
@OceanNuclear
OceanNuclear force-pushed the neutronics branch 3 times, most recently from 5ada3ea to 3336c23 Compare October 30, 2025 15:13
@OceanNuclear

OceanNuclear commented Nov 24, 2025 •

Copy link
Copy Markdown
Contributor Author

The current state of this branch is:

  • 1-group 2-layer model is written
  • 1-group 2-layer model is fully tested (regression & unit tests)
  • Multi-group model & >2-layer model is written
  • Multi-group model & >2-layer model is tested
  • incorporated real data
  • Wrote function that accepts collapsed cross-section data (The downloading and collapsing of nuclear data has to be done by the user using a class that inherits from ENDFRecord.)
  • Plotting is already available, example 1-group 2-layer model:
current flux heating
  • Plotting is tested

@je-cook
je-cook self-requested a review March 23, 2026 09:58
@OceanNuclear
OceanNuclear marked this pull request as ready for review March 27, 2026 13:41
@OceanNuclear
OceanNuclear requested a review from a team as a code owner March 27, 2026 13:41
@OceanNuclear

Copy link
Copy Markdown
Contributor Author

@chris-ashe In the new folder structure, would you prefer the neutronics.py and neutronics_data.py to live in model/ or core/?

@je-cook je-cook self-assigned this Apr 1, 2026

@je-cook je-cook left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure descriptors is the right way to go. Most descriptor stuff I've written I have eventually rewritten without descriptors because I found a better way.

On the atomic data is there any reason we cant use something like periodictable which we use in elsewhere.

@OceanNuclear

Copy link
Copy Markdown
Contributor Author

Happy to hear out examples of where descriptors were removed and see if I can implement anything similar. So far I'm unaware of any other ways of writing the code that wouldn't make it even more spaghetti: the @summarize_values decorator is doing a lot of heavy lifting and cutting the amount of code that I have to write down by half.

@je-cook

je-cook commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

Great, need to have a think but will let you know

@OceanNuclear

Copy link
Copy Markdown
Contributor Author

periodictable sounds good, thanks for the suggestion, I'll likely replace the atomic_data.json with it, and possibly cutting down the size of the PR as a result.

I haven't figured out yet the right way of getting the abundance values in periodictable (in the same format as written at the top of the atomic_data.json), but I'm sure I'll find it eventually.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

⚠️ improve_quality_job warning!

Files changed by this PR have introduced 7 more linting errors when compared to main

Please fix these

To check what these are, run hatch run lint:fmt_extra on your branch and on main

…inear equations out to a standalone method, to reduce the complexity of solve_group_n
…erative solve procedure to another method named _iterate_solve_group_n.
@OceanNuclear
OceanNuclear requested a review from kj5248 October 30, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants