Skip to content

More accurately simulate the neutron flux profile#3653

Draft
OceanNuclear wants to merge 114 commits intomainfrom
neutronics
Draft

More accurately simulate the neutron flux profile#3653
OceanNuclear wants to merge 114 commits intomainfrom
neutronics

Conversation

@OceanNuclear
Copy link
Contributor

@OceanNuclear OceanNuclear commented May 2, 2025

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
Copy link

codecov-commenter commented May 2, 2025

Codecov Report

❌ Patch coverage is 59.37904% with 314 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.33%. Comparing base (633a49e) to head (9a9064d).
⚠️ Report is 97 commits behind head on main.

Files with missing lines Patch % Lines
process/neutronics_data.py 48.75% 164 Missing ⚠️
process/neutronics.py 66.88% 150 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3653      +/-   ##
==========================================
+ Coverage   45.98%   46.33%   +0.35%     
==========================================
  Files         123      125       +2     
  Lines       28550    29323     +773     
==========================================
+ Hits        13129    13588     +459     
- Misses      15421    15735     +314     

☔ View full report in Codecov by Sentry.
📢 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
…nded_boundary, to be self-populating dictionaries (populated by solve_group_n).
@OceanNuclear
Copy link
Contributor Author

OceanNuclear commented Nov 24, 2025

Snapshot of where I'm at before taking a break for 3 weeks:

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 not yet tested
  • Need to incorporate real data (The correct incident neutron flux from the plasma, and download the 1-group/multi-group cross-sections for various materials & then collapse them into the correct group structure.)
  • Need to test the downloading and collapsing of cross-section.
  • Plotting is already available, example 1-group 2-layer model:
current flux heating
  • I have no idea how to test plotting TBH.

…each NeutronFluxProfile.coefficient[:, n] will contain self.n_groups coefficients rather than n coefficients.
…'s coefficients (i.e. coefficients used to cancel the flux shapes contributed by other groups).
… coefficient length = total number of groups rather than the current group number.
…the programmer won't have to write them out explicitly every time.
…us layer can be written as an affine transformation in linear algebra (y = Ax+b). The method _get_propagation_matrix_and_offset_vec returns A and b. num_coef_pairs is no longer needed so is deleted.
… is recorded as a vector of Kronecka delta(n,g) * flux, where g is the group index matching the incident neutron energy.
…thand to some summations (see _summation_shorthand) for ease of maintenance.
… multi-group multi-layer model. I suspect this has to do with the negative fluxes experienced by some models.
…r message, leaving the instructions on how to perform iteration calculations in the comments.
… created without knowing the nuclear data first, *and then* knowing what isotopes' nculear data needs to be get, populate_from_nuclear_data_library() can then help backfill these values, long after the instantiation of these materials.
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.

3 participants