A Parallel Algorithm for a Semi-Implicit Particle-In-Cell Method with Energy and Charge Conservation
摘要
The article is devoted to the construction of a parallel algorithm for calculating plasma dynamics by a particle-in-cell method using a semi-implicit scheme that conserves energy and charge. This is a two-stage predictor–corrector scheme. At the prediction stage a semi-implicit Lapenta-type method is used in which an energy-conserving linear current does not satisfy the local Gauss law. At the correction stage the currents, electromagnetic fields, and particle velocities are corrected so that difference laws of energy and charge conservation are satisfied exactly. This approach turns out to be efficient in modeling of multi-scale phenomena with a sufficiently large time step. However, the method is computer time-consuming, since it requires not only solving two systems of linear equations per step, but also reconstructing the entire matrix of the system. The authors have developed a matrix-operator software implementation algorithm for this scheme, which allows efficient paralleling of the calculations and using the various available libraries for work with matrices and solvers for systems of linear equations. To construct the matrix, a row-by-row storage algorithm is used with search for the elements via a hash table, which reduces the memory capacity required, the number of thread synchronizations, and can significantly speed up the calculations. This algorithm has been successfully applied in a computer code, Beren3D.