Skip to content
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

Ensure compilation with double precision particles for DSMC collisions #4938

Merged
merged 2 commits into from
May 20, 2024

Conversation

aveksler1
Copy link
Contributor

DSMC collisions are not properly captured with single precision for typical plasma collision cross sections. This adds an assert to ensure compilation with double precision.

I could imagine a scenario where a user might still want to use single precision for some cross sections that would be captured, so this could we a warning too rather than an assert.

@archermarx
Copy link
Contributor

Is there some way we can scale the cross sections to make them work numerically with single-precision particles?

@roelof-groenewald
Copy link
Member

Is there some way we can scale the cross sections to make them work numerically with single-precision particles?

@archermarx we should be able to make single precision work for the collisions. I expect the problem is more likely in the calculation of the collision energy than the cross-sections themselves since I'm fairly certain the MCC routine works for single precision (which uses similar cross-sections). We can open an issue to remind us to sort out this issue in the future since I won't have time this week to look into this deeper.

@ax3l ax3l added the component: collisions Anything related to particle collisions label May 20, 2024
@ax3l
Copy link
Member

ax3l commented May 20, 2024

LGTM - note: if you do need SP runs of WarpX where DSMC is just a small part, you could promote the DSMC logic to be all double until you have found a way to renormalize.

This would be a bigger change, so erroring out at runtime is fine for me. Please double check the constructor where this is placed does not throw when DSMC is not used.

Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com>
Copy link
Member

@roelof-groenewald roelof-groenewald left a comment

Choose a reason for hiding this comment

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

Thanks!

@roelof-groenewald roelof-groenewald enabled auto-merge (squash) May 20, 2024 21:28
@aveksler1
Copy link
Contributor Author

LGTM - note: if you do need SP runs of WarpX where DSMC is just a small part, you could promote the DSMC logic to be all double until you have found a way to renormalize.

This would be a bigger change, so erroring out at runtime is fine for me. Please double check the constructor where this is placed does not throw when DSMC is not used.

Just double checked, it's working as intended.

@roelof-groenewald roelof-groenewald merged commit 30a8c3e into ECP-WarpX:development May 20, 2024
45 checks passed
Haavaan pushed a commit to Haavaan/WarpX that referenced this pull request Jun 5, 2024
ECP-WarpX#4938)

* ensure double precision particle with DSMC collisions

* Check ParticleReal precision is double

Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com>

---------

Co-authored-by: Avigdor Veksler <aveksler@TAE7750-MLAP.local>
Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants