ECP-WarpX/WarpX

Single precision particles with DSMC

Closed this issue · 3 comments

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

Originally posted by @archermarx in #4938 (comment)

Currently DSMC collisions do not produce expected results with single precision particles.
This might be due to the relativistic calculation of the collision energy not resolving low energy collisions.

I think a very reasonable thing to do would be, as suggested by @ax3l in the PR, to promote the required calculations to double precision for intermediate results that need it . In my applications at least, I expect to not run DSMC very often so I don't think the performance hit will be massive.

@roelof-groenewald is there a test that shows the expected results not being produced with SP particles? If so, I can try monkeying around with this.

Thanks @archermarx, that would be appreciated. The CI test for the DSMC routine itself works to show single precision currently not working (see https://github.com/ECP-WarpX/WarpX/blob/development/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_1d.py). Note the example should be run without the --test flag to run it long enough for the issue to be seen. Currently, in single precision all ion density is lost from the simulation since the required ion scattering does not occur. Also remember to add the --dsmc flag when running the example.