picongpu icon indicating copy to clipboard operation
picongpu copied to clipboard

Update binary collisions, dynamic Coulomb log

Open pordyna opened this issue 3 years ago • 2 comments

Update to the binary collisions

This PR introduces a dynamic calculation of the Coulomb logarithm for binary collisions. It also includes some fixes for the existing implementation. These changes continue to follow the implementation from smilei. @ComputationalRadiationPhysics/picongpu-maintainers @psychocoderHPC @HighIander

Dynamic Coulomb logarithm

The newly introduced automatic Coulomb log calculation is based on the 2012 paper from Perez link. The calculation uses a Debye length that is calculated on every time step from all charged particles (the list of included species is set in collision.param) for all simulation cells. These values are made available to the colliders via a FieldTmp. The collision functor has now two implementations: one for a constant and one for a dynamic Coulomb logarithm. More details are in the updated documentation.

Other updates

  • A factor of two difference in the s-parameter between the inter- and intra-collisions was removed. Originally, this difference comes from the 2020 Higginson paper link, but it seems to be a typo. This factor two is not present in smilei.
  • The sampling of the cosine of the cumulative scattering angle was updated to follow the new fit recently introduced in smilei.
  • A debug output was introduced. It can write average values (averaged over the simulation) for the coulomb log, the s-paramer (proportional to the collision frequency) per collider and species pair. It is also possible to write an average value of the precalculated Debye length. It would be probably useful to be able to write these value per cell, but, for now, the averaging over the simulation is good enough for the homogenous test cases.

Tests

The existing collision tests setups were extended to include the new automatic coulomb logarithm. They were also run for a longer time and include now a direct comparison with smilei values and some statistical analysis. Also, the tests use now only field output, so they run faster. A python tool for generating the comparison plots was also included for both tests.

The test results show in general quite good agreement with smilei but there still seems to be some difference in the dynamic debye length and the coulomb log, for example in this beam relaxation set-up:

beam relaxation example set-up

beam_relaxation_SetupNr0_dynamic beam_relaxation_SetupNr0_dynamic_debug or this thermalization test:

thermalization example set-up

thermalisation_1to1_all_dynamic thermalisation_1to1_all_dynamic_debug

All the other combinations of particle weighting ratios, and coulomb logarithms are included in the updated docs.

pordyna avatar Sep 16 '22 13:09 pordyna

The CI is not happy with your formation.

psychocoderHPC avatar Sep 20 '22 12:09 psychocoderHPC

@psychocoderHPC as discussed offline, we should still try to investigate the difference in Debye length calculation. In the thermalization test the contributions from electrons and ions are similar, while in the beam relaxation test the ion contribution gets bigger overtime while ions gain energy. So, I think that the problem could be in ion contribution, but I don't know why yet.

pordyna avatar Sep 22 '22 07:09 pordyna

@psychocoderHPC: fixed the missing absolute value, fixed the CI errors, updated the documentation with the new plots

pordyna avatar Oct 05 '22 13:10 pordyna

@pordyna Could it be that you missed updating the plots in the first post of this PR? We should update those too to reflect the current state of the PR.

psychocoderHPC avatar Oct 07 '22 12:10 psychocoderHPC

@psychocoderHPC I updated the first post

pordyna avatar Oct 13 '22 09:10 pordyna

@psychocoderHPC If the CI passes, this PR is ready for review. I will rerun all tests once we are done with the review / introducing new changes.

pordyna avatar Oct 17 '22 13:10 pordyna

@pordyna Why is in TH_debug_7.png the right plot for PIConGPU and smile differently?

psychocoderHPC avatar Oct 20 '22 09:10 psychocoderHPC

CI has passed, I will rerun the tests

pordyna avatar Oct 27 '22 09:10 pordyna

@psychocoderHPC tests results didn't change

pordyna avatar Nov 01 '22 11:11 pordyna