Repository navigation
Neutronics use mpmath at increasing precision, without using scipy. - #4706
Open
OceanNuclear wants to merge 190 commits into
Open
OceanNuclear wants to merge 190 commits into
OceanNuclear wants to merge 190 commits into
Conversation
…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.
…have to import openmc.
…for ease of maintenace; added tests.
…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.
…t bin = highest energy/lowest lethargy.
… 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.
… to prep for its import
…ntly and has less complexity.
…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.
…g the summation inside the same block.
… 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.
… as the optimization abscissa.
…to evaluate the termination condition
…r having found it. It doesn't work so well afterall. A couple of TODOs were added in relation to the mp.findroot, but looks like mp.findroot is a dead end.
OceanNuclear
force-pushed
the
neutronics-mpmath
branch
from
October 23, 2026 13:44
4fd88d0 to
46ee175
Compare
… Now this is fixed by using mp.mpf.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Checklist
I confirm that I have completed the following checks: