Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/268206299

Charge conservation methods for computing current densities in


electromagnetic particle-in-cell simulations

Article · January 2005

CITATIONS READS

4 678

3 authors, including:

Yoshiharu Omura
Kyoto University
390 PUBLICATIONS 9,336 CITATIONS

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Spacecraft-plasma interaction View project

Waves in Space Plasmas View project

All content following this page was uploaded by Yoshiharu Omura on 30 July 2015.

The user has requested enhancement of the downloaded file.


Proceedings of ISSS-7, 26-31 March, 2005

Charge conservation methods for computing current densities in


electromagnetic particle-in-cell simulations
Takayuki Umeda1 , Yoshiharu Omura2 , and Hiroshi Matsumoto2

1 Institute of Geophysical and Planetary Physics, University of California, Los Angels, California 90095-1567, USA
2 Research Institute for Sustainable Humanosphere, Kyoto University, Uji, Kyoto 611-0011, Japan

We give a tutrial of charge conservation methods for computing current densities in electromagnetic Particle-
In-Cell (PIC) simulations. The charge conservation method, which allows us to avoid solving Poisson’s equation
at every time step, is an important numerical technique for performing electromagnetic PIC simulations efficiently.
We present first- and second-order schemes of the recent charge conservation methods.

1. Introduction 2. Charge conservation method


Electromagnetic particle-in-cell (PIC) codes are widely 2.1 Assignment of charge flux
used for studies of nonlinear wave-particle interactions in Let us think of a particle with a charge moving form
plasmas. In electromagnetic PIC codes, Maxwell’s equa- (x1 , y1 ) to (x2 , y2 ) in a two-dimensional system. We assume
tions (1)-(4) and the equations of charged particle motion are that the particle does not move more than grid spacings ∆x,
solved in self-consistent manner. ∆y for one time step ∆t, namely, vx ∆t < ∆x, vy ∆t < ∆y.
We assume that the particle moves in the territory of (i1 +
1 ∂E 1 1
∇ × B = µ0 J + (1) 2 , j1 + 2 ) during its movement, i.e., i1 ∆x ≤ x1 , x2 ≤
c2 ∂t (i1 + 1)∆x, j1 ∆y ≤ y1 , y2 ≤ (j1 + 1)∆y. By using the
∂B procedure described by Eastwood [1991], a charge flux of a
∇×E = − (2)
∂t particle can be computed from the start point (x1 , y1 ) and
ρ end point (x2 , y2 ) of the particle movement. In the first-
∇·E = (3)
²0 order charge conservation scheme, charge fluxes of a particle
∇·B = 0 (4) assigned to each grid point are given by
(1) (1)
Eqs.(1) and (2) are solved to advance electromagnetic fields Jx (i1 + 21 , j1 ) = 1
∆x∆y Fx Wj1 ,
in space and time. On the other hand, Eqs.(3) and (4) (1) (1)
Jx (i1 + 21 , j1 + 1) = 1
∆x∆y Fx Wj1 +1 ,
are solved for initialization of electric and magnetic fields. (1) (1) (6)
Jy (i1 , j1 + 21 ) = 1
∆x∆y Fy Wi1 ,
These two equations are satisfied automatically, if Eq.(1) is (1) (1)
solved correctly based on the current density satisfying the Jy (i1 + 1, j1 + 21 ) = 1
∆x∆y Fy Wi1 +1 ,
continuity equation for charge,
where (Fx , Fy ) ≡ F represents a charge flux given by
∂ρ (1) (1)
∇·J + = 0. (5) Fx = q x2∆t
−x1
, Fy = q y2∆t
−y1
, (7)
∂t
and W represents the first-order shape factor corresponding
The current density J and charge density ρ at each grid
to the linear weighting function defined at the midpoint be-
point are computed from velocities and positions of charged
tween the start point (x1 , y1 ) and the end point (x2 , y2 )
particles. It is well known that the current densities obtained
by the simple area-weighting scheme do not satisfy the con- (1) (1)
Wi1 ≡ i1 + 1 − x2∆x
1 +x2
, Wi1 +1 ≡ x1 +x2
2∆x − i1 ,
tinuity equation for charge exactly. In this case we have to (1) y1 +y2 (1) y1 +y2 (8)
Wj1 ≡ j1 + 1 − 2∆y , Wj1 +1 ≡ 2∆y − j1 .
solve Poisson’s equation for correction of electric fields [e.g.,
Birdsall and Langdon, 1985]. There exist several numeri- Here, the indeces i1 and j1 correspond to the largest integers
cal schemes for computing the current density satisfying the not greater than ∆xx1
and ∆xy1
, respectively, which are given
continuity equation for charge, which are called “charge con- by the “aint” or “floor” function in FORTRAN, i.e., i1 =
servation methods”. Recently multi-dimensional schemes x1
aint( ∆x y1
), j1 = aint( ∆y ).
based on a straight-line particle trajectory [Villasenor and In the second-order charge conservation scheme, charge
Buneman, 1992; Eastwood, 1991], charge density decompo- fluxes of a particle assigned to each grid point are given by
sition [Esirkepov, 2001], and a zigzag-line particle trajectory
(2) (2)
[Umeda et al., 2003], were proposed. Jx (i1 − 21 , j) = 1
∆x∆y Fx1 Wj ,
Basic concept of the charge conservation method is de- (2) (2)
Jx (i1 + 12 , j) = 1
∆x∆y Fx2 Wj ,
scribed, and first- and second-order versions of straight-line (2) (2) (9)
scheme, density decomposition, and zigzag-line scheme are Jy (i, j1 − 21 ) = 1
∆x∆y Fy1 Wi ,
(2) (2)
presented. Jy (i, j1 + 12 ) = 1
∆x∆y Fy2 Wi ,
View publication stats

for i = i1 − 1, i1 , i1 + 1, j = j1 − 1, j1 , j1 + 1, where When i1 6= i2 and j1 6= j2 , the particle moves across


two cell meshes. In the straight-line scheme, the movement
(2) (1) (2) (1)
Fx1 = qvx ( 12 − Wi1 +1 ), Fy1 = qvy ( 12 − Wj1 +1 ), of the particle from (x1 , y1 ) to (x2 , y2 ) is decomposed into
(2) (1) (2) (1) (10)
Fx2 = qvx ( 21 + Wi1 +1 ), Fy2 = qvy ( 12 + Wj1 +1 ), three segments along the straight line. Therefore we need
two relay points. The number of charge flux segments varies
are charge fluxes, and form 1 to 3 depending on the trajectory of particle move-
(2) (1) (2) (1)
ment. To compute the coordinates of relay points we have to
Wi−1 = 12 ( 12 − Wi+1 )2 , Wj−1 = 12 ( 12 − Wj+1 )2 , use several “IF” statements [Villasenor and Buneman, 1992].
(2) (1) (2) (1)
Wi = 34 − (Wi+1 )2 , Wj = 34 − (Wj+1 )2 , (11) Therefore, the computing algorithm becomes complex.
(2) (1) (2) (1)
Wi+1 = 12 ( 12 + Wi+1 )2 , Wj+1 = 12 ( 12 + Wj+1 )2 , In the zigzag-line scheme, the movement of the particle
is decomposed into two segments even when i1 6= i2 and
are second-order (triangular-shaped) assignment factors. j1 6= j2 . The relay point is located on the boundary between
Here, the indices i1 and j1 correspond to the integers the territories of (i1 , j1 ) and (i2 , j2 ). By assuming that the
x1 y1
nearest ∆x and ∆x , respectively, which are given by the particle trajectory is such a zigzag line, the cross-point of the
x1
“anint” function in FORTRAN, i.e., i1 = anint( ∆x ), j1 = particle trajectory and cell meshes can be determined inde-
y1
anint( ∆y ). pendently of the positions of the particle at t and t + ∆t.
The numerical procedures of the first-, second-, and third- Since we do not need to compute two cross-points of the
order two-dimensional charge conservation schemes are de- particle trajectory and cell meshes, computing algorithm be-
scribed by Eastwood [1991]. comes easier and faster. In the two-dimensional first-order
2.2 Decomposition of charge flux zigzag-line scheme, the coordinates of relay point for differ-
Let us think of a particle moving across a cell mesh. Here ent cases are easily obtained by [Umeda et al., 2003]
we assume that i1 6= i2 and j1 = j2 , where ½ x1 +x2
2 , if i1 = i2 ,
xr =
i1 ≡ floor(x1 /∆x), j1 ≡ floor(y1 /∆y), max(i
½ y1 +y2 1 ∆x, i2 ∆x), if i1 6= i2 ,
(12) (16)
i2 ≡ floor(x2 /∆x), j2 ≡ floor(y2 /∆y). , if j1 = j2 ,
yr = 2
max(j1 ∆y, j2 ∆y), if j1 6= j2 ,
In this case, the particle moves to one of the adjacent cells
in the x direction. We assume that the movement of the and those of the second-order scheme are obtained by,
particle is described as movements of two particles. That is, (
one particle moves from (x1 , y1 ) to (xr , yr ) with a velocity (x1 +x2 )
2 , if i1 = i2 ,
v 1 , and another particle moves from (xr , yr ) to (x2 , y2 ) xr = (i1 +i 2 )∆x
, if i1 6= i2 ,
with a velocity v 2 during the time from t to t + ∆t. Here, ( 2
(17)
(y1 +y2 )
, if j1 = j2 ,
v 1 + v 2 = v ≡ (x2 ,y2 )−(x
∆t
1 ,y1 )
, and (xr , yr ) is a relay point 2
yr = (j1 +j2 )∆y
which is located on the boundary between the territories of 2 , if j1 6= j2 ,
(i1 + 21 , j1 ) and (i2 + 12 , j1 ).
The location of relay point (xr , yr ) is determined from In the density decomposition scheme proposed by Esirke-
the particle trajectory between the start point (x1 , y1 ) and pov, [2001], a particle movement is decomposed into 8 seg-
the end point (x2 , y2 ). In the first-order scheme, the x- ments. Since each segment is parallel to either the x or y
coordinate of relay point is given at the cross-point between axis, computing algorithm for assignment of charge fluxes
the particle trajectory and cell meshes, i.e., become easy. Computation of charge flux for different cases
is also realized without “IF” statement. Therefore, com-
xr = max(i1 ∆x, i2 ∆x). (13) puting speed becomes faster than that of the straight-line
scheme.
The particle can take an arbitrary trajectory as long as the
direction of charge flux vector does not change. In this References
case the y-coordinate of relay point takes an arbitrary value Birdsall, C. K., and A. B. Langdon, Plasma Physics via Computer Simula-
between y1 and y2 . In the straight-line particle trajectory tion, McGraw-Hill, New York, 1985.
Eastwood, J. W., The virtual particle electromagnetic particle-mesh method,
scheme [Villasenor and Buneman, 1992; Eastwood, 1991], Comput. Phys. Commun., 64, 252–266, 1991.
the relay point is located on the straight line. Therefore we Esirkepov, T. Z., Exact charge conservation scheme for particle-in-cell sim-
obtain the location of relay point as ulation with an arbitrary form-factor, Comput. Phys. Commun., 135,
144–153, 2001.
y 2 − y1 Omura Y. and H. Matsumoto, KEMPO1: Technical guide to one-
yr = (xr − x1 ) + y1 . (14) dimensional electromagnetic particle code, in Computer Space Plasma
x2 − x1 Physics, Edited by H. Matsumoto and Y. Omura, 21–65, Terra Scientific,
Tokyo, 1993.
In the zigzag-line particle trajectory scheme the location of
Umeda, T., Y. Omura, T. Tominaga, and H. Matsumoto, A new charge
relay point is simply given by [Umeda et al., 2003], conservation method in electromagnetic particle simulations, Comput.
Phys. Commun., 156, 73–85, 2003.
y1 + y 2 Villasenor, J., and O, Buneman, Rigorous charge conservation for local
yr = . (15)
2 electromagnetic field solvers, Comput. Phys. Commun., 69, 306–316,
1992.
Therefore, the particle trajectory becomes a zigzag line.

You might also like