-
Notifications
You must be signed in to change notification settings - Fork 228
Correct and test fusion module in RZ geometry #3255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
for more information, see https://pre-commit.ci
|
This pull request introduces 1 alert when merging e85d2c5 into afda3a4 - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging f1994ea into 47eef0b - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 422586b into 47eef0b - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 337b2ed into 3bf1a33 - view on LGTM.com new alerts:
|
| check_isotropy(data, relative_tolerance = 3.e-2) | ||
| def specific_check1(data, dt): | ||
| if not is_RZ: | ||
| check_isotropy(data, relative_tolerance = 3.e-2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't check for isotropy in the RZ case, since the distribution of momentum for the products is not yet correct.
|
This pull request introduces 1 alert when merging 70a864e into 6e75516 - view on LGTM.com new alerts:
|
EZoni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR, Remi! Looks good to me, I just left a couple of minor comments.
| ## Checks whether this is the 2D or the 3D test | ||
| is_RZ = "RZ" in sys.argv[1] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other way to do this (which I personally find a little more robust, because it does not rely on the test's name) is to parse the output file warpx_used_inputs and determine the geometry from there:
warpx_used_inputs = open('./warpx_used_inputs', 'r').read()
if re.search('geometry.dims = 2', warpx_used_inputs):
is_RZ = False
elif re.search('geometry.dims = RZ', warpx_used_inputs):
is_RZ = True
Regression/WarpX-tests.ini
Outdated
| useMPI = 1 | ||
| numprocs = 2 | ||
| useOMP = 1 | ||
| numthreads = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be maximum 1 if numprocs = 2:
| numthreads = 2 | |
| numthreads = 1 |
|
This pull request introduces 1 alert when merging 65b43eb into 5e17906 - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging d399ac2 into 5e17906 - view on LGTM.com new alerts:
|
* Add particle rotation in NuclearFusionFunc.H * Minor * indent * initial work * fixed bugs and added species * update documentation * delete unused file * Add properties for neutron, hydrogen isotopes, helium isotopes * Update code to be more consistent * Correct typo * Parse deuterium-tritium fusion * Start putting in place the files for deuterium-tritium * Update documentation * Prepare structures for deuterium tritium * Fix typo * Fix compilation * Add neutron * Add correct formula for the cross-section * Correct compilation error * Fix nuclear fusion * Reset benchmarks * Prepare creation functor for 2-product fusion * First implementation of momentum initialization * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use utility function for fusion * Minor modification of variable names * Fix GPU compilation * Fix single precision compilation * Update types * Use util function in P-B fusion * Correct compilation errors * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Correct errors * Update values of mass and charge * Correct compilation error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Correct compilation error * Correct compilation error * Correct compilation error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Reset benchmark * Use helium particle in proton-boron, to avoid resetting benchmark * Fixed proton-boron test * Revert "Fixed proton-boron test" This reverts commit 73c8d9d. * Incorporate Neil's recommendations * Reset benchmarks * Correct compilation errors * Add new deuterium tritium automated test * Correct formula of cross-section * Correct cross-section * Improve analysis script * Add test of energy conservation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add test of conservation of momentum * Progress in analysis script * Fix error in the initial energy of the deuterium particles * Add check of isotropy * Clean up the test script * Rewrite p_sq formula in a way to avoids machine-precision negative numbers * Add checksum * Clean up code * Add test for fusion in RZ geometry * Update code to take into account actual timestep * Update RZ test * Update RZ test * Increase number of particles * Impart radial memory on DT particles * Correct RZ momenta * Remove unused file * Update test * Fix definition of theta * Add new test * Add checksum * Update test * Update tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix Python analysis script * Remove CPU and ID from new benchmark Co-authored-by: Yinjian Zhao <[email protected]> Co-authored-by: Luca Fedeli <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
In RZ geometry, particles need to be temporarily rotated before/after the two-particle fusion event, in order to reflect the cylindrical symmetry of the distribution function for the plasma. (This is similar to what was implemented for the Coulomb collisions: #2510.)
In this PR we implement this rotation, but only for the incident particles (i.e. not yet for the products of the reaction, which will be done in a follow-up PR). As a result the reaction rates and number of particles created will be correct (because the incident have been properly rotated), but the exact momentum distribution of the product species will not. (At least, not before we implement the rotation of the product, in the follow-up PR.)
This PR also adds an RZ test, where particles are initialized with an azimuthal velocity. The test does not check for isotropy in the momentum distribution of the products, because of the above-mentioned limitation for the momentum distribution of the products.