Skip to content

binary collision energy conservation, sort by weight#6825

Merged
dpgrote merged 7 commits intoBLAST-WarpX:developmentfrom
dpgrote:collision_energy_conservation_sort_by_weight
May 1, 2026
Merged

binary collision energy conservation, sort by weight#6825
dpgrote merged 7 commits intoBLAST-WarpX:developmentfrom
dpgrote:collision_energy_conservation_sort_by_weight

Conversation

@dpgrote
Copy link
Copy Markdown
Member

@dpgrote dpgrote commented Apr 29, 2026

In the binary collisions when moment conservation is turned on, this PR adds code to sort the particles by weight before applying the energy conservation correction. This sorting shifts more of the correction to the heavier particles - the correction will have a smaller effect on their momenta. Also, since the heavier particles can absorb or give off more energy, this sorting will typically require adjusting fewer particles to apply the correction.

A quick timing test shows that with the sorting, the simulation time is a few percent faster, presumably because of the fewer particles being required for the correction versus the extra time for the sorting.

@dpgrote dpgrote requested a review from JustinRayAngus April 29, 2026 18:39
@dpgrote dpgrote added the component: collisions Anything related to particle collisions label Apr 29, 2026
Comment thread Source/Particles/Collision/BinaryCollision/BinaryCollision.H Outdated
@JustinRayAngus
Copy link
Copy Markdown
Contributor

This looks good Dave, but I think we want sorting to be an option. It can be expensive for large number of particles, and it's not always needed. For example, you may only have different weights for different species. In that case there is no need to sort.

Copy link
Copy Markdown
Contributor

@JustinRayAngus JustinRayAngus left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@dpgrote dpgrote merged commit 6433ca6 into BLAST-WarpX:development May 1, 2026
47 of 48 checks passed
@dpgrote dpgrote deleted the collision_energy_conservation_sort_by_weight branch May 1, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: collisions Anything related to particle collisions KISMET

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants