Skip to content

Neutronics mpmath - #4705

Closed
OceanNuclear wants to merge 187 commits into
neutronicsfrom
neutronics-mpmath
Closed

OceanNuclear wants to merge 187 commits into
neutronicsfrom
neutronics-mpmath

Conversation

@OceanNuclear

Copy link
Copy Markdown
Contributor

Description

Applied mpmath (module to allow arbitrarily high precision floats) to the neutronics module.

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.

@OceanNuclear
OceanNuclear requested a review from a team as a code owner October 23, 2026 11:05
@OceanNuclear
OceanNuclear added this pull request to stack #4707 October 23, 2026 13:42
…ng the strength of the macroscopic (self and other) scattering matrix.
…(...)), instead of using complex number to cover both +ve and -ve sign in the sqrt.
…esmos). Next step is to write the program for solving multi-group fluxes.
…ed classes and functions are now in neutronics_data.
…nded_boundary, to be self-populating dictionaries (populated by solve_group_n).
… into a set, allowing index i to be discarded from it at every opportunity without having to check for membership.
… total macroscopic cross-section (due to breeding)
…the transport problem is solvable without iterations.
…attering_xs, micro_n2n_xs, micro_fiss_xs, to make the code more readable.
…ot of the complexity associated with the AutoPopulatingDict/LayerSpecificGroupwiseConstants classes. Amended tests as well.
…e code complexity, and increasing backwards compatibility as preserve_whitespace was not an argument before tabulate version 0.10.0.
…arbitrary dimensions of c_va/s_val, c_int/s_int, c_diff/s_diff.
…of the summations handled with less redundancy & more automatically.
… by turning fsum back to np.sum (which is also useful in preparation for the next commit).
…sholds scaled by the total neutron flux/local neutron flux and currents for flagging nonconvergence at the end of solve_group_n, since the current scheme causes a lot of unnecessary warnings being raised when the flux is large.
…e and animate=False. Removed redundant _set_coefficient.
…, and mp.sin when the argument is scalar. This speeds up the calculation of long flux values. Also, we revert to using np.sqrt instead of mp.sqrt to obtain l from self.materials[...].l2, which somehow makes the calculation more accurate as well.
@OceanNuclear
OceanNuclear removed this pull request from stack #4707 October 23, 2026 14:15
@OceanNuclear

Copy link
Copy Markdown
Contributor Author

Cherry-picked it across instead of merging it by PR.

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