Sei sulla pagina 1di 13

Computer Physics Communications 156 (2003) 7385

www.elsevier.com/locate/cpc
A new charge conservation method in electromagnetic
particle-in-cell simulations
T. Umeda

, Y. Omura, T. Tominaga, H. Matsumoto


Radio Science Center for Space and Atmosphere, Kyoto University, Uji, Kyoto 611-0011, Japan
Received 5 June 2003; accepted 11 August 2003
Abstract
We developed a fast algorithm for solving the current density satisfying the continuity equation of charge in electromagnetic
particle-in-cell (PIC) simulations. In PIC simulations of the charge conservation, a particle trajectory over one time step is
conventionally assumed to be a straight line. In the present new scheme we assume that a particle trajectory is a zigzag line.
Compared with the VillasenorBuneman method and Esirkepovs method, the present scheme has an advantage in computation
speed without any substantial distortion of physics.
2003 Elsevier B.V. All rights reserved.
PACS: 52.65.R
Keywords: Charge conservation; Continuity equation; EM PIC code
1. Introduction
Electromagnetic particle-in-cell (PIC) codes are widely used for studies of nonlinear wave-particle interactions
in plasmas. In electromagnetic PIC codes, Maxwells equations and the equations of motion are solved in self-
consistent manner. Electric and magnetic elds, current and charge densities are dened at spatial grid points, while
charged particles can take arbitrary positions. Electromagnetic elds at a position of a particle are interpolated from
those at adjacent grid points. On the other hand, the current density J and charge density at each grid point are
computed from velocities and positions of charged particles. That is, a charge q and a charge ux of a particle
qv q(v
x
, v
y
, v
z
) are assigned to the surrounding grid points with an area-weighting [1,2]. For example, with the
rst-order shape-factor (form-factor)
(1) S
i
() =
_
1 | i| for | i| 1,
0 for | i| > 1
*
Corresponding author.
E-mail addresses: umeda@kurasc.kyoto-u.ac.jp (T. Umeda), omura@kurasc.kyoto-u.ac.jp (Y. Omura).
0010-4655/$ see front matter 2003 Elsevier B.V. All rights reserved.
doi:10.1016/S0010-4655(03)00437-5
74 T. Umeda et al. / Computer Physics Communications 156 (2003) 7385
spatial proles of the charge density in three dimensions are given by the superposition of a charge contributed by
each particle,
(2) (i, j, k) =
1
xyz
N
p

n=1
q
n
S
i
_
x
n
x
_
S
j
_
y
n
y
_
S
k
_
z
n
z
_
,
where N
p
, x, y, z respectively represent the number of particles, grid spacing in the x, y and z directions, and
the subscript n represents the nth particle. While the charge density is dened at full-integer grid points (i, j, k),
the current densities J
x
, J
y
and J
z
are respectively dened at (i +
1
2
, j, k), (i, j +
1
2
, k) and (i, j, k +
1
2
) from the
difference form of the continuity equation for charge
0 =

t +t
(i, j, k)
t
(i, j, k)
t
+
J
t +t /2
x
(i +
1
2
, j, k) J
t +t /2
x
(i
1
2
, j, k)
x
+
J
t +t /2
y
(i, j +
1
2
, k) J
t +t /2
y
(i, j
1
2
, k)
y
(3) +
J
t +t /2
z
(i, j, k +
1
2
) J
t +t /2
z
(i, j, k
1
2
)
z
.
The current densities J
x
, J
y
and J
z
at each grid point are computed with different shape-factors, because they are
dened at different spatial grid points. They are computed by the superposition of a charge ux contributed by each
particle,
(4) J
x
_
i +
1
2
, j, k
_
=
1
xyz
N
p

n=1
q
n
v
xn
S
i+1/2
_
x
n
x
_
S
j
_
y
n
y
_
S
k
_
z
n
z
_
,
(5) J
y
_
i, j +
1
2
, k
_
=
1
xyz
N
p

n=1
q
n
v
yn
S
i
_
x
n
x
_
S
j+1/2
_
y
n
y
_
S
k
_
z
n
z
_
,
(6) J
z
_
i, j, k +
1
2
_
=
1
xyz
N
p

n=1
q
n
v
zn
S
i
_
x
n
x
_
S
j
_
y
n
y
_
S
k+1/2
_
z
n
z
_
.
It is well known that the current densities obtained by the simple area-weighting scheme (4)(6) do not satisfy the
continuity equation for charge exactly. In this case we have to solve Poissons equation for correction of electric
elds [13].
There are several numerical techniques for solving the continuity equation locally [48], which allows us to
avoid solving Poissons equation at every time step. They are called charge conservation methods. As described
by Eastwood [5], a charge ux of a particle can be computed fromthe start and end points of the particle movement,
when both start and end points are located in the same cell. When a particle moves across the cell meshes, the
particle movement is assigned to separate motions in each cell by the cell meshes. From superposition of charge
ux, charge conservation can be realized for any particle trajectories made up of straight line segments between
any start and end points.
In the VillasenorBuneman method [7], a particle trajectory over one time step is assumed to be a straight line.
Therefore all start and end points of the particle trajectory segments are located along the straight line as shown
in Fig. 1. Especially in the case of Fig. 1, the original particle movement is described with movements of three
particles. The algorithm of the VillasenorBuneman method is complex, because the computation of cross-points
of a particle trajectory and cell meshes is realized with several IF statements.
T. Umeda et al. / Computer Physics Communications 156 (2003) 7385 75
Fig. 1. Decomposition of a charge ux by the VillasenorBuneman method in a two-dimensional system. (a) The original particle trajectory.
(b) The charge ux is decomposed into segments F
1
, F
2
and F
3
at the sides of the cell square, where qv =F
1
+F
2
+F
3
. The dashed lines
represent cell meshes. The number of segments is determined by the number of cross-points of a particle trajectory and cell meshes.
Fig. 2. Decomposition of a charge ux by Esirkepovs method. (a) In two dimensions a charge ux is decomposed into four segments along the
x and y axes. (b) In three dimensions a charge ux is decomposed into twelve segments along the x, y and z axes. Each segment has its own
weight as specied in the gure.
In Esirkepovs method [8], a charge ux is decomposed into movements of four particles along the x and y
axes in two dimensions as shown in Fig. 2(a). In three dimensions, a charge ux is decomposed into movements of
twelve particles along the x, y and z axes as shown in Fig. 2(b). Each segment has its own weight as specied in
Fig. 2, because the sum of charge ux segments is equal to qv. Since each particle moves only in one dimension,
algorithm of Esirkepovs method becomes easier and is realized without any IF statements. The computation
speed also becomes faster than that of the VillasenorBuneman method. Another advantage of Esirkepovs method
is that it is easy to apply to higher-order shape-factors.
In charge conservation methods, a particle trajectory over one time step is conventionally assumed to be a
straight line. However, when a particle moves from (x, y, z) to (x + v
x
t , y + v
y
t , z + v
z
t ) for one time
step, the particle can take an arbitrary trajectory as long as it does not move more than one grid spacing,
x > v
x
t , y > v
y
t , z > v
z
t . In other words, a particle trajectory needs not to be a straight line. We
developed a new charge conservation method assuming that a particle trajectory is a zigzag line. In this paper,
we describe the new scheme and check its validity by comparing it with the VillasenorBuneman method and
Esirkepovs method in test simulations.
76 T. Umeda et al. / Computer Physics Communications 156 (2003) 7385
2. Zigzag scheme in two-dimensional systems
In two dimensions the difference form of the continuity equation is written as
J
t +t /2
x
(i +
1
2
, j) J
t +t /2
x
(i
1
2
, j)
x
+
J
t +
t
2
y
(i, j +
1
2
) J
t +t /2
y
(i, j
1
2
)
y
(7) =

t
(i, j)
t +t
(i, j)
t
.
Let us think of a particle with a charge q moving from (x
t
, y
t
) to (x
t +t
, y
t +t
). We dene
(8)
x
1
x
t
, x
2
x
t +t
=x
t
+v
t +t /2
x
t ,
y
1
y
t
, y
2
y
t +t
=y
t
+v
t +t /2
y
t ,
and
(9)
i
1
oor(x
1
/x), i
2
oor(x
2
/x),
j
1
oor(y
1
/y), j
2
oor(y
2
/y),
where i and j are the largest integer values not greater than x/x and y/y respectively, which are given by the
oor function. We also assume that the particle does not move more than grid spacings x and y for one time
step t , namely, v
x
t < x, v
y
t < y.
When a particle remains in the same cell square during its movement, a charge ux of a particle can be computed
from the start point (x
1
, y
1
) and end point (x
2
, y
2
) of the particle movement. Charge conservation of the assigned
current densities is realized with the procedure described by Eastwood [5],
(10)
J
x
_
i
1
+
1
2
, j
1
_
=
1
xy
F
x
(1 W
y
), J
x
_
i
1
+
1
2
, j
1
+1
_
=
1
xy
F
x
W
y
,
J
y
_
i
1
, j
1
+
1
2
_
=
1
xy
F
y
(1 W
x
), J
y
_
i
1
+1, j
1
+
1
2
_
=
1
xy
F
y
W
x
,
where (F
x
, F
y
) F represents charge ux given by
(11) F
x
=q
x
2
x
1
t
, F
y
=q
y
2
y
1
t
,
and W represents the rst-order shape-factor corresponding to the linear weighting function dened at the midpoint
between the start point (x
1
, y
1
) and the end point (x
2
, y
2
)
(12) W
x
=
x
1
+x
2
2x
i
1
, W
y
=
y
1
+y
2
2y
j
1
.
When a particle moves across cell meshes, we decompose the particle movement with a special assignment pattern
as shown in Figs. 3 and 4. We have to think of the following four cases depending on positions of the particle at
time t and t + t : (a) i
1
= i
2
and j
1
= j
2
, (b) i
1
= i
2
and j
1
= j
2
, (c) i
1
= i
2
and j
1
= j
2
, and (d) i
1
= i
2
and
j
1
=j
2
.
(a) When i
1
=i
2
and j
1
=j
2
, the particle moves across two cell meshes. As shown in Fig. 3, we assume that
the movement of the particle from (x
1
, y
1
) to (x
2
, y
2
) is described as movements of two particles. One particle
moves from (x
1
, y
1
) to ((i
1
+1)x, (j
1
+1)y) =(i
2
x, j
2
y), and another particle moves from (i
2
x, j
2
y)
to (x
2
, y
2
) during the time from t to t +t . Therefore the particle trajectory becomes a zigzag line. If the particle
trajectory is assumed to be a straight line, the particle movement is decomposed into three segments (see Fig. 1).
By assuming that the particle trajectory is such a zigzag line in Fig. 3, the cross-point of the particle trajectory
T. Umeda et al. / Computer Physics Communications 156 (2003) 7385 77
Fig. 3. Particle trajectory of the two-dimensional zigzag scheme for i
1
= i
2
and j
1
= j
2
(case (a)). One particle moves from (x
1
, y
1
) to
((i
1
+1)x, (j
1
+1)y) =(i
2
x, j
2
y), and another particle moves from (i
2
x, j
2
y) to (x
2
, y
2
) during the time from t to t +t . The
solid arrows represent particle trajectories. The dashed lines represent cell meshes.
Fig. 4. Particle trajectory of the two-dimensional zigzag scheme for i
1
= i
2
, j
1
= j
2
(case (b)). One particle moves from (x
1
, y
1
) to
((i
1
+1)x,
y
1
+y
2
2
) = (i
2
x,
y
1
+y
2
2
), and another particle moves from (i
2
x,
y
1
+y
2
2
) to (x
2
, y
2
) during the time from t to t +t . Here
i
1
+1 =i
2
. The solid arrows represent particle trajectories. The dashed lines represent cell meshes. By interchanging x and y, the case (b) is
transformed to the case (c).
and cell meshes can be determined independently of the positions of the particle at t and t +t . Since we do not
need to compute two cross-points of the particle trajectory and cell meshes, computation becomes much easier and
faster.
(b) When i
1
= i
2
and j
1
= j
2
, the particle moves to one of the adjacent cells in the x direction. In this
case one particle moves from (x
1
, y
1
) to ((i
1
+1)x,
y
1
+y
2
2
) = (i
2
x,
y
1
+y
2
2
), and another particle moves from
(i
2
x,
y
1
+y
2
2
) to (x
2
, y
2
) during the time from t to t +t . The particle trajectory also becomes a zigzag line as
shown in Fig. 4.
(c) When i
1
=i
2
and j
1
=j
2
, the particle moves to one of the adjacent cells in the y direction. We assume that
one particle moves from (x
1
, y
1
) to (
x
1
+x
2
2
, (j
1
+1)x) = (
x
1
+x
2
2
, j
2
x), and that another particle moves from
(
x
1
+x
2
2
, j
2
x) to (x
2
, y
2
) during the time from t to t +t . Thus the particle trajectory becomes very similar to
that in case (b).
In both cases (b) and (c), the number of segments is two, and is same as that of the case of a straight line path.
However, since we do not need to compute one cross-point of the particle trajectory and a cell mesh, computation
becomes easier.
(d) When i
1
= i
2
and j
1
= j
2
, the particle remains in the same cell square during its movement. In this case
we do not need to decompose the particle movement into two segments, and we can directly apply the procedure
in Eq. (10) for computation of charge ux at each grid point. However, we formally assume that the movement of
a particle from (x
1
, y
1
) to (x
2
, y
2
) is described as movements of two particles. That is, one particle moves from
(x
1
, y
1
) to (
x
1
+x
2
2
,
y
1
+y
2
2
), and another particle moves from (
x
1
+x
2
2
,
y
1
+y
2
2
) to (x
2
, y
2
) during the time from t to
t +t .
Algorithm. To reduce the four cases listed above, we introduce a relay point of particle movement (x
r
, y
r
) and the
charge uxes F
1
and F
2
. That is, one particle moves from (x
1
, y
1
) to (x
r
, y
r
) and another moves from (x
r
, y
r
) to
78 T. Umeda et al. / Computer Physics Communications 156 (2003) 7385
(x
2
, y
2
) during the time from t to t +t . In a simple one-dimensional case, the relay point x
r
is given by
(13) x
r
=
_
x
1
+x
2
2
, for i
1
=i
2
,
max(i
1
x, i
2
x), for i
1
=i
2
.
In this paper we propose the following algorithmfor computing the relay point (x
r
, y
r
) without any IF statement,
(14)
x
r
=min
_
min(i
1
x, i
2
x) +x, max
_
max(i
1
x, i
2
x),
x
1
+x
2
2
__
,
y
r
=min
_
min(j
1
y, j
2
y) +y, max
_
max(j
1
y, j
2
y),
y
1
+y
2
2
__
.
It is noted that computation speeds of the above two algorithms depend on CPU and compiler. In general,
computation of an algorithm with IF statements takes much time. However, the algorithm in Eq. (13) is also
useful on a computer system in which computation speed of an IF statement is very fast.
By using (x
r
, y
r
), a charge ux qv = q(v
x
, v
y
) is decomposed into F
1
= (F
x1
, F
y1
) and F
2
= (F
x2
, F
y2
) as
follows:
(15)
F
x1
=q
x
r
x
1
t
, F
y1
=q
y
r
y
1
t
,
F
x2
=q
x
2
x
r
t
=qv
x
F
x1
, F
y2
=q
y
2
y
r
t
=qv
y
F
y1
.
We next apply the algorithm in Eq. (10) for computation of charge ux at each grid point. That is, we apply the
shape-factors dened at the midpoints between (x
1
, y
1
) and (x
r
, y
r
), and (x
r
, y
r
) and (x
2
, y
2
), respectively, to
assign the segments F
1
and F
2
to the adjacent grid points. This is because the particles exist at the midpoints at
time t +
t
2
[5,7]. The rst-order shape-factors at the midpoints are dened by
(16)
W
x1
=
x
1
+x
r
2x
i
1
, W
y1
=
y
1
+y
r
2y
j
1
,
W
x2
=
x
r
+x
2
2x
i
2
, W
y2
=
y
r
+y
2
2y
j
2
.
The segments of the charge ux assigned to 8 grid points are obtained by the following procedure.
(17)
J
x
_
i
1
+
1
2
, j
1
_
=
1
xy
F
x1
(1 W
y1
), J
x
_
i
1
+
1
2
, j
1
+1
_
=
1
xy
F
x1
W
y1
,
J
y
_
i
1
, j
1
+
1
2
_
=
1
xy
F
y1
(1 W
x1
), J
y
_
i
1
+1, j
1
+
1
2
_
=
1
xy
F
y1
W
x1
,
J
x
_
i
2
+
1
2
, j
2
_
=
1
xy
F
x2
(1 W
y2
), J
x
_
i
2
+
1
2
, j
2
+1
_
=
1
xy
F
x2
W
y2
,
J
y
_
i
2
, j
2
+
1
2
_
=
1
xy
F
y2
(1 W
x2
), J
y
_
i
2
+1, j
2
+
1
2
_
=
1
xy
F
y2
W
x2
.
Finally we superpose the charge uxes contributed by each particle to obtain the total current densities. We note
that we can apply the simple area-weighting scheme (2) for computation of J
z
component in two dimensions,
because J
z
is free from the charge continuity equation (7).
3. Extension to three dimensions
In three dimensions we have to think of eight cases depending on a particle movement whether a particle moves
across cell meshes or not. The eight cases can be reduced to four cases as listed in Table 1. It is very easy to extend
T. Umeda et al. / Computer Physics Communications 156 (2003) 7385 79
Table 1
Different cases of the particle positions at times t and t +t in the three-dimensional
zigzag scheme
i
1
=i
2
j
1
=j
2
k
1
=k
2
Case (a)
i
1
=i
2
j
1
=j
2
k
1
=k
2
Case (b)
i
1
=i
2
j
1
=j
2
k
1
=k
2
i
1
=i
2
j
1
=j
2
k
1
=k
2
i
1
=i
2
j
1
=j
2
k
1
=k
2
Case (c)
i
1
=i
2
j
1
=j
2
k
1
=k
2
i
1
=i
2
j
1
=j
2
k
1
=k
2
i
1
=i
2
j
1
=j
2
k
1
=k
2
Case (d)
Fig. 5. Particle trajectories for the three-dimensional zigzag scheme. The solid arrows represent particle trajectories. The dashed lines
represent cell meshes. (a) For i
1
= i
2
and j
1
= j
2
and k
1
= k
2
, one particle moves from (x
1
, y
1
, z
1
) to ((i
1
+ 1)x, (j
1
+ 1)y,
(k
1
+1)z) = (i
2
x, j
2
y, k
2
z), and the other moves from (i
2
x, j
2
y, k
2
z) to (x
2
, y
2
, z
2
) during the time from t to t +t . (b) For
i
1
=i
2
, j
1
=j
2
, k
1
=k
2
, one particle moves from (x
1
, y
1
, z
1
) to ((i
1
+1)x, (j
1
+1)y,
z
1
+z
2
2
). The other moves from(i
2
x, j
2
y,
z
1
+z
2
2
)
to (x
2
, y
2
, z
2
). (c) For i
1
=i
2
, j
1
=j
2
, k
1
=k
2
, one particle moves from (x
1
, y
1
, z
1
) to ((i
1
+1)x,
y
1
+y
2
2
,
z
1
+z
2
2
). The other moves from
(i
2
x,
y
1
+y
2
2
,
z
1
+z
2
2
) to (x
2
, y
2
, z
2
). (d) For i
1
=i
2
and j
1
=j
2
and k
1
=k
2
, a particle moves from (x
1
, y
1
, z
1
) to (x
2
, y
2
, z
2
).
the two-dimensional zigzag scheme to the three-dimensional one. Using the same procedure of the two-dimensional
case described in Section 2, we can illustrate particle trajectories for four cases in Fig. 5. If the particle trajectory
between the start point (x
1
, y
1
, z
1
) and end point (x
2
, y
2
, z
2
) is a straight line, the number of segments varies 14
depending on the locations of the start and end points. By using the zigzag paths, the number of segments is reduced
to 2.
In all cases a charge ux is also decomposed into two segments: F
1
(F
x1
, F
y1
, F
z1
) and F
2
(F
x2
, F
y2
, F
z2
).
By using a relay point (x
r
, y
r
, z
r
) given by the algorithm in Eq. (14) or Eq. (13) each segment of the charge ux is
given by
(18)
F
x1
=q
x
r
x
1
t
, F
y1
=q
y
r
y
1
t
, F
z1
=q
z
r
z
1
t
,
F
x2
=q
x
2
x
r
t
=qv
x
F
x1
, F
y2
=q
y
2
y
r
t
=qv
y
F
y1
,
F
z2
=q
z
2
z
r
t
=qv
z
F
z1
.
80 T. Umeda et al. / Computer Physics Communications 156 (2003) 7385
We assign each segment of the charge ux to the adjacent grid points using the following rst-order shape-factors
dened at the midpoints
(x
r
,y
r
,z
r
)+(x
1
,y
1
,z
1
)
2
and
(x
2
,y
2
,z
2
)+(x
r
,y
r
,z
r
)
2
,
(19)
W
x1
=
x
1
+x
r
2
i
1
, W
y1
=
y
1
+y
r
2
j
1
, W
z1
=
z
1
+z
r
2
k
1
,
W
x2
=
x
r
+x
2
2
i
2
, W
y2
=
y
r
+y
2
2
j
2
, W
z2
=
z
r
+z
2
2
k
2
.
The charge uxes F
1
and F
2
are assigned to 24 grid points as written in the following procedure.
For l =1, 2
(20)
J
x
_
i
l
+
1
2
, j
l
, k
l
_
=
1
xyz
F
xl
(1 W
yl
)(1 W
zl
),
J
x
_
i
l
+
1
2
, j
l
+1, k
l
_
=
1
xyz
F
xl
W
yl
(1 W
zl
),
J
x
_
i
l
+
1
2
, j
l
, k
l
+1
_
=
1
xyz
F
xl
(1 W
yl
)W
zl
,
J
x
_
i
l
+
1
2
, j
l
+1, k
l
+1
_
=
1
xyz
F
xl
W
yl
W
zl
,
J
y
_
i
l
, j
l
+
1
2
, k
l
_
=
1
xyz
F
yl
(1 W
xl
)(1 W
zl
),
J
y
_
i
l
+1, j
l
+
1
2
, k
l
_
=
1
xyz
F
yl
W
xl
(1 W
zl
),
J
y
_
i
l
, j
l
+
1
2
, k
l
+1
_
=
1
xyz
F
yl
(1 W
xl
)W
zl
,
J
y
_
i
l
+1, j
l
+
1
2
, k
l
+1
_
=
1
xyz
F
yl
W
xl
W
zl
,
J
z
_
i
l
, j
l
, k
l
+
1
2
_
=
1
xyz
F
zl
(1 W
xl
)(1 W
yl
),
J
z
_
i
l
+1, j
l
, k
l
+
1
2
_
=
1
xyz
F
zl
W
xl
(1 W
yl
),
J
z
_
i
l
, j
l
+1, k
l
+
1
2
_
=
1
xyz
F
zl
(1 W
xl
)W
yl
,
J
z
_
i
l
+1, j
l
+1, k
l
+
1
2
_
=
1
xyz
F
zl
W
xl
W
yl
.
Total current densities are obtained by superposition of the charge ux contributed by each particle.
4. Test simulations
We performed test simulations using new two- and three-dimensional electromagnetic PIC codes based on
Kyoto university ElectroMagnetic Particle cOde (KEMPO) [9]. The simulation source codes were compiled with
Intel Fortran Complier 5.0, and the test runs were performed on a single Pentium III 1.0 GHz processor.
We rst performed simulations of an electron two-stream instability for testing electrostatic elds. We set the
external static magnetic eld in the x direction. The electron cyclotron frequency is equal to the total electron
T. Umeda et al. / Computer Physics Communications 156 (2003) 7385 81
Fig. 6. Average CPU time used for the computation of current density for one time step. The experimental data of the present zigzag scheme,
Esirkepovs method and the VillasenorBuneman method are respectively plotted as square, circle and x-marks.
plasma frequency
ce
=
pe
=1.0. We assumed two electron beams with the equal density and the equal thermal
velocity v
t
= 1.0. One electron beam drifts against the other electron beam with drift velocity v
d
= 4.0v
t
along
the magnetic eld. Ions are assumed to be immobile background, and we used a reduced speed of light c =20v
t
.
We set that time step is
pe
t =0.025, and that grid spacing is x =y =z =1.0
D
, where
D
=v
t
/
pe
is
Debye length. We varied number of superparticles per cell for both electron beams, n
e1
and n
e2
, as a parameter
for different simulation runs. Two-dimensional simulation runs were performed on 256 256 grid points with
n
e1
=n
e2
=2
2
, 4
2
, 6
2
, 8
2
. Three-dimensional simulation runs were performed on 64 64 64 grid points with
n
e1
=n
e2
=1
3
, 2
3
, 3
3
.
We measured average CPU time used for the computation of current density for one time step. As shown in
Fig. 6, in both two- and three-dimensional runs the present zigzag scheme works faster than both Esirkepovs
method and VillasenorBuneman method. We also plotted the total energy history for the VillasenorBuneman
method, Esirkepovs method and the present zigzag scheme in Fig. 7. We found little difference between the three
methods. In all methods, total energy increases as time elapses because of stochastic numerical heating due to
enhanced thermal uctuations. However, using many superparticles per cell, we can reduce the enhanced thermal
uctuations substantially.
To analyze electrostatic elds, we plotted spatial proles of electrostatic potentials for the two-dimensional runs
with n
e1
= n
e2
= 8
2
in Fig. 8. The proles of electrostatic potentials are given by solving Poissons equation.
In all runs we started with the same initial condition. At the saturation stage (
pe
t = 64: time step = 2560),
all runs give the same spatial proles of the electrostatic potentials. At
pe
t = 128 (time step = 5120), there is
still little difference of the spatial proles of electrostatic potentials between the three methods. At
pe
t = 256
(time step = 10240), on the other hand, the difference of electrostatic potentials between the three methods
becomes apparent. This difference is due to the accumulation of numerical error. When we used fewer number
of superparticles per cell, the difference of electrostatic potentials between the three methods appears in an earlier
stage. However, in both two- and three-dimensional runs, the present zigzag scheme gives the same spatial proles
of electrostatic potentials as those obtained by Esirkepovs method and the VillasenorBuneman method, when the
numerical error is suppressed by using a large number of superparticles per cell.
Next we analyzed electromagnetic elds by performing simple two- and three-dimensional test runs. We loaded
both electron and ion species with Maxwellian velocity distribution functions uniformly in the simulation box. We
set the external static magnetic eld in the x direction. The electron cyclotron frequency is equal to the electron
plasma frequency
ce
=
pe
= 1.0. We set that grid spacing is x = y = z = 2.0
D
. Ions are assumed to
have a reduced mass ratio 100, and the temperature ratio T
e
/T
i
is equal to 1.0. We used a reduced speed of
light c = 6v
t
. To compute spectrum of the enhanced thermal uctuations, we performed Fourier transformation
of B
z
simulation data in both time and space. In Fig. 9 we show the result of the three-dimensional runs with
n
e
= n
i
= 1, in which the enhanced thermal uctuations are the most intense. Fig. 9 corresponds to spectral
82 T. Umeda et al. / Computer Physics Communications 156 (2003) 7385
Fig. 7. Total energy history for (top) the VillasenorBuneman method, (middle) Esirkepovs method and (bottom) the present zigzag scheme.
The number of superparticle per cell is varied for different simulation runs. Total energy is normalized by the initial total energy.
wave energy densities |cB
z
(, k
x
, 0, 0)|
2
and |cB
z
(, 0, k
y
, 0)|
2
normalized by the thermal energy density of the
electrons n
e
m
e
V
2
t e
= (m
e

pe
V
t e
/e)
2
. In all k
x
spectra, we can nd enhancement of R mode, L mode and
whistler mode waves. In all k
y
spectra, we can nd enhancement of X mode and harmonic electron cyclotron
waves. Even with one particle per cell, we found little difference in the spectra of normal modes between the three
methods. The present test simulation runs show that both electrostatic and electromagnetic elds obtained by the
present zigzag scheme are the same as those obtained by the conventional charge conservation methods.
The numerical error between the three methods arises when a particle trajectory crosses the cell meshes. When
we consider the current density computed from a motion of only one particle, the obtained value at each grid point
is very different from each other. This is because a segment of the charge ux is assigned with different weighting
functions. However, when we take average of J
x
, J
y
and J
z
at adjacent grid points, the results respectively become
qv
x
, qv
y
and qv
z
, i.e. the same for the three methods. In other words, when distribution and motion of particles
in adjacent cells are almost uniform, the numerical error between the three methods becomes almost zero. A wave
mode with the minimum wave length is supported by two grid spacings. Such a mode with a short wavelength
is subject to the numerical error. However, since wavelengths of electromagnetic modes are commonly much
longer than two grid spacings, they are not affected by the numerical error. By superposing a large number of
particle motions, distribution and motion of particles in adjacent cells can be regarded as uniform, and therefore
the numerical error of one particle does not become effective. The trajectory of each particle does not affect the
simulation result as conrmed by the present test simulations.
T. Umeda et al. / Computer Physics Communications 156 (2003) 7385 83
Fig. 8. Spatial proles of electrostatic potentials in the two-dimensional runs with n
e1
=n
e2
=8
2
, for (a) the VillasenorBuneman method, (b)
Esirkepovs method and (c) the present zigzag scheme.
5. Conclusion
The procedures of the present zigzag scheme are itemized below.
(1) Compute the relay point (x
r
, y
r
, z
r
) by
x
r
=min
_
min(i
1
x, i
2
x) +x, max
_
max(i
1
x, i
2
x),
x
1
+x
2
2
__
,
(21) y
r
=min
_
min(j
1
y, j
2
y) +y, max
_
max(j
1
y, j
2
y),
y
1
+y
2
2
__
,
z
r
=min
_
min(k
1
z, k
2
z) +z, max
_
max(k
1
z, k
2
z),
z
1
+z
2
2
__
.
(2) Compute charge uxes F
1
and F
2
by
(22)
F
1
=q
_
(x
r
, y
r
, z
r
) (x
1
, y
1
, z
1
)
_
/t ,
F
2
=q
_
(x
2
, y
2
, z
2
) (x
r
, y
r
, z
r
)
_
/t =qv F
1
.
(3) Assign F
1
and F
2
to the adjacent grid points with the shape-factors dened at {(x
r
, y
r
, z
r
) +(x
1
, y
1
, z
1
)}/2
and {(x
2
, y
2
, z
2
) +(x
r
, y
r
, z
r
)}/2, respectively.
The advantage of the present zigzag scheme is that the computation speed becomes faster because computations
for different particle trajectories are realized without any IF statements, while accuracy of the three methods
are the same. The numerical error between the three methods arises when a particle trajectory crosses the cell
meshes. However, the three methods give the same spatial proles of both electromagnetic and electrostatic waves
84 T. Umeda et al. / Computer Physics Communications 156 (2003) 7385
Fig. 9. Spectral wave energy densities |cB
z
(, k
x
, 0, 0)|
2
and |cB
z
(, 0, k
y
, 0)|
2
in the runs with n
e
=n
i
=1, for (top) the VillasenorBuneman
method, (middle) Esirkepovs method and (bottom) the present zigzag scheme. The intensity is normalized by the thermal energy density of the
electrons n
e
m
e
V
2
t e
=(m
e

pe
V
t e
/e)
2
.
when the thermal noises are suppressed by using many particles per cell. Thus the present scheme is useful for
electromagnetic PIC simulations.
In this paper we used the rst-order shape-factor which corresponds to the linear interpolation. It is known that
higher-order shape-factor reduces the numerical noises substantially in PIC simulations. We expect that we can
apply the higher-order algorithms described by Eastwood [5] to the zigzag scheme straightforward. Generalization
of charge conservation method to curvilinear meshes was implemented by Eastwood et al. [6]. Applications of the
zigzag scheme to higher-order algorithms and arbitrary coordinate systems are left as future studies.
Acknowledgements
We thank H. Usui for useful discussions. The computer simulations were performed in part on the KDK
computer system at Radio Science Center for Space and Atmosphere, Kyoto University. This work was supported
T. Umeda et al. / Computer Physics Communications 156 (2003) 7385 85
by Ministry of Education, Culture, Sports, Science and Technology, Grant-in-Aid for JSPS Research Fellows,
03821.
References
[1] R.W. Hockney, J.W. Eastwood, Computer Simulation Using Particles, McGraw-Hill, New York, 1981.
[2] C.K. Birdsall, A.B. Langdon, Plasma Physics via Computer Simulation, McGraw-Hill, New York, 1985.
[3] P.J. Mardahl, J.P. Verboncoeur, Comput. Phys. Comm. 106 (1997) 219.
[4] R.L. Morse, C.W. Nielson, Phys. Fluids 14 (1971) 830.
[5] J.W. Eastwood, Comput. Phys. Comm. 64 (1991) 252.
[6] J.W. Eastwood, W. Arter, N.J. Brealey, R.W. Hockney, Comput. Phys. Comm. 87 (1995) 155.
[7] J. Villasenor, O. Buneman, Comput. Phys. Comm. 69 (1992) 306.
[8] T.Z. Esirkepov, Comput. Phys. Comm. 135 (2001) 144.
[9] Y. Omura, H. Matsumoto, in: H. Matsumoto, Y. Omura (Eds.), Computer Space Plasma Physics, Terra Science, Tokyo, 1993, p. 21.

Potrebbero piacerti anche