Skip to content
Snippets Groups Projects

2D Particle-in-cell solver

Open GUBAIDULIN requested to merge feature-particle-in-cell into develop

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. image image image

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.

Edited by GUBAIDULIN

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading