2D Particle-in-cell solver
I've added only a simple interface to BeamIonElement and to TransverseSpaceCharge to use PIC as an option. However, for space charge, it might be beneficial to introduce another class, TransverseSpaceChargePIC2p5D or something like that. With a separate class, it's easier to define the grid and to choose if we want the grid to be updated every turn. I've added unit tests for PIC solver dependent implementations of space-charge and beam-ion instability.
Below is a benchmark done in jupyter notebook between Basetti-Erksine and PIC-based implementation of electromagnetic field calculation. There's a small difference that could be due to the interpolation.
Speed comparison. For tracking 5000 electrons per bunch with 416 bunches for 100 turns, we have
- ~7 minutes with Basetti-Erskine formula
- ~1.5 hours with PIC if the grid is updated every turn
- ~20 minutes if the grid is updated, only if the beam size has increased by a factor of 2 during tracking -> to be further optimised
Overall, one can expect that the PIC-based tracking will be 3-4 times slower, which should still be acceptable. Moreover, when I do a simple test I do not see a difference in performance at all. Only for full tracking there's a slowdown.
! At the moment PIC assumes that all ions have the same charge. I need to slightly modify and recompile fortran code to make it more general.
Merge request reports
Activity
changed milestone to %version 0.9.0
added feature label
requested review from @GAMELIN
assigned to @GUBAIDULIN
added 2 commits
added 53 commits
-
dc12c68d...305623ea - 50 commits from branch
develop
- 69475570 - Merged develop branch
- b504682b - Merge branch 'feature-particle-in-cell' of...
- 97f44b1b - Added fortran compilation instruction script
Toggle commit list-
dc12c68d...305623ea - 50 commits from branch
added 2 commits
added 1 commit
- 2a3a5645 - [bug] fixed particle indexing for alive/dead case
- Resolved by Alexis GAMELIN