A high-order accurate Particle-In-Cell method for Vlasov ......2016/11/10 · A high-order accurate...
Transcript of A high-order accurate Particle-In-Cell method for Vlasov ......2016/11/10 · A high-order accurate...
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time integrations
Andrew Myers [email protected] Applied Numerical Algorithms Group, Computational Research Division with Phillip Colella, Brian Van Straalen, Bei Wang, Boris Lo, Victor Minden
Advanced Modeling Seminar Series NASA Ames Research Center November10th, 2016
https://arxiv.org/abs/1602.00747
• Background and motivation
• Description of our numerical method
• Implementation using the Chombo framework
• Numerical results
• Summary and future research directions
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
2
Talk Outline
• Background and motivation
• Description of our numerical method
• Implementation using the Chombo framework
• Numerical results
• Summary and future research directions
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
3
Talk Outline
@f
@t+ v · @f
@x�E · @f
@v= 0
r2� = �⇢ E = �r�
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
The Vlasov-Poisson Equations4
• The Vlasov-Poisson equations describe the evolution of a charged,
collisionless fluid in phase space.
• The electric field is obtained by solving Poisson’s equation.
• Applicable as a simplified model to plasma physics (space plasmas,
accelerator modeling, controlled fusion) and to cosmology.
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Eulerian Methods5
• Nonlinear advection equation in a high-dimensional space, can be
solved by Eulerian techniques.
• Advantages:
– Strong body of theory on finite volume methods
– Do not suffer from “noise”
– High order methods exist (Vogman + 2014)
• Disadvantages:
– High cost of grids in high-dimensional (4D, 5D, or 6D) spaces
• Discretize system with set of Lagrangian interpolating points,
• Reduces problem to system of ODEs for particle trajectories:
P
(x p(t), vp(t))
f(x , v , tini) ⇡X
p2Pqp�
�x � x
ip
���v � v
ip
�
dqpdt
= 0
dx p
dt= vp
dvp
dt= �Ep
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
6
Particle Methods
• Can reconstruct distribution at later times from
vp
Ep
x p(t)
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Particle Methods7
• Variety of methods - mainly differ in how the force is computed
• PIC methods, in which the force solve is performed on an intermediate
grid, are particularly popular.
• Advantages:
– Mathematically simpler. Reduces a PDE to a set of coupled
ODEs.
– Naturally adaptive - the particles go where more resolution is
needed.
– Usually lower computational cost
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Disadvantages of Particle Methods8
• Less
mathematical
guidance
• Particle noise
prevents
convergence
• Usually limited
to 2nd order
accuracy
Wang+2011
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
The goal of this talk9
• Describe a particle method (PIC) that attempts to address these
downsides.
• Show how to all the PIC stages at 4th-order
– Heart of this is really the interpolation kernels.
• Describe a high-order remapping procedure to ameliorate particle
noise while maintaining 4th order accuracy
• Background and motivation
• Description of our numerical method
• Implementation using the Chombo framework
• Numerical results
• Summary and future research directions
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
10
Talk Outline
• Field solve: force is computed on the mesh by e.g.
solving Poisson’s Equation w/ 2nd order finite
differences.
• Interpolation: Force is interpolated back to particle
positions using same kernel.
• Particle Push: Particle positions and velocities are
updated. 2nd-order leapfrog.
• Deposition: Particle charges are deposited onto mesh:
⇢
n+1i
=X
p
⇣qp
�x
⌘W
x i � x
n+1p
�x
!
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
11
Overview of a Particle-in-Cell time step
2nd order: Piecewise linear, Cloud-in-Cell interpolation
Start
Deposition
Field Solve
Interpolation
Particle Push
• Given solution at a set of points,
reconstruct in between
• Functions W(x) need to be even,
normalized, have compact support
⇢(x) ⇡X
j
W
✓xj � x
�x
◆⇢j
⇢0⇢1
x0 x1 ...
...
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
High-order in space (interpolation kernels)12
M2(x) =
⇢1� |x|, 0 |x| 1,
0 otherwise.
M3(x) =
8<
:
34 � |x|2, 0 |x| 1/2,
12
�32 � |x|
�2, 1/2 |x| 3/2,
0 otherwise.
M1(x) =
⇢1, 0 |x| 1/2,
0 otherwise.
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
High-order in space (interpolation kernels)13
• Commonly taken to be one of the B-spline functions. Limited to 2nd Order.
NGP CIC TSC
• Error analysis involves looking at the Fourier transform of ,
• Can show that must have a zero of order n at AND must
have zeros of order n at to be O(n).
• For the Basis spline of order n,
• Fulfills the second requirement, but zero at k = 0 is only order 2.
• Hence, all the basis splines interpolate with at best 2nd order accuracy
• They do, however, have increasing degrees of smoothness which may be
desirable when the particles are highly disordered.
• See Schoenberg 1975, Monaghan 1985 for more details.
W (k)� 1
W (k)
k = 2⇡, 4⇡, ...
k = 0
W (k) =
✓sin (k/2)
k/2
◆n
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
High-order in space (interpolation kernels)14
W (x)
W (k)
W (x)
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
High-order in space (interpolation kernels)15
• However, it is possible to design a polynomial with the appropriate zeros in
Fourier space and transform back into real space to obtain a with the
desired properties.
• For details, see Lo, Minden, and Colella 2016.
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
16
B a0 = 1
˜Wq
(k)
Wq
(x) =
q/2�1X
p=0
a2p
(�1)
pM (2p)q
(x),
B[�q/2, q/2]
Wq
q = 4, 6
W4(x) =
8><
>:
|x|32 � |x|2 � |x|
2 + 1, |x| 2 [0, 1],
� |x|36 + |x|2 � 11|x|
6 + 1, |x| 2 [1, 2],
0,
W6(x) =
8>>>><
>>>>:
� |x|512 +
|x|44 +
5|x|312 � 5|x|2
4 � |x|3 + 1, |x| 2 [0, 1],
|x|524 � 3|x|4
8 +
25|x|324 � 5|x|2
8 � 13|x|12 + 1, |x| 2 [1, 2],
� |x|5120 +
|x|48 � 17|x|3
24 +
15|x|28 � 137|x|
60 + 1, |x| 2 [2, 3],
0,
kk = 4
[�q/2, q/2]
• 4-point stencil
• Reproduces cubic
functions exactly
• Continuous with
discontinuous first
derivative
High-order in space (interpolation kernels)
�DX
d=1
��i+2ed + 16�i+ed � 30�i + 16�i�ed � �i+2ed
12�x
2 = ⇢i
Edi = ���i+2ed + 8�i+ed � 8�i�ed + �i+2ed
12�x
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
17
High-order in space (field solve)
• Replace 2nd-order finite difference approximation with 4th-order, centered
differences:
r2� = �⇢
• Resulting system can be solved with a variety of methods (we used
geometric multigrid).
E = �r�
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
18
High-order in time (RK4)
1 The Method
The goal is to solve the following system of equations for the particle posi-
tions and velocities x and v given the force F :
x = v
v = F (t, x). (1)
The standard, fourth-order Runge-Kutta method applied to this system
gives, for the special case of a force that does not depend on v:
x
n+1= x
n+ v
n�t +
1
6
(k1 + 2k2) �t
2
v
n+1= v
n+
1
6
(k
n1 + 4k2 + k3) �t, (2)
where
k1 = F (t
n, x
n)
k2 = F
✓t
n+
1
2
�t, x
n+
1
2
v
n�t +
1
8
k1�t
2
◆
k3 = F
✓t
n+ �t, x
n+ v
n�t +
1
2
k2�t
2
◆. (3)
Note the sequential nature of this algorithm; k1 must be computed before
k2, which must be computed before k3. An alternative is to extrapolate the
forces from the previous time step. For example, the forces at the stages
corresponding to times t
n � �t, t
n � 12�t, and t
nwere k
n1 , k
n2 , and k
n3 .
Defining
⌧ =
t� (t
n ��t)
�t
, (4)
a 2nd order interpolating polynomial that passes through the required points
is
˜
f(⌧) = (2k
n1 � 4k
n2 + 2k
n3 ) ⌧
2+ (�3k
n1 + 4k
n2 � k
n3 ) ⌧ + k
n1 . (5)
For ⌧ = 0, 1/2, and 1, we recover k
n1 , k
n2 , and k
n3 , respectively. Extrapolated
forward to ⌧ = 1, 3/2, and 2 (t = t
n, t
n+ 1/2�t, and t
n+ �t), we find:
˜
f(1) = k
n3
˜
f
✓3
2
◆= k
n1 � 3k
n2 + 3k
n3
˜
f(2) = 3k
n1 � 8k
n2 + 6k
n3 . (6)
1
1 The Method
The goal is to solve the following system of equations for the particle posi-
tions and velocities x and v given the force F :
x = v
v = F (t, x). (1)
The standard, fourth-order Runge-Kutta method applied to this system
gives, for the special case of a force that does not depend on v:
x
n+1= x
n+ v
n�t +
1
6
(k1 + 2k2) �t
2
v
n+1= v
n+
1
6
(k
n1 + 4k2 + k3) �t, (2)
where
k1 = F (t
n, x
n)
k2 = F
✓t
n+
1
2
�t, x
n+
1
2
v
n�t +
1
8
k1�t
2
◆
k3 = F
✓t
n+ �t, x
n+ v
n�t +
1
2
k2�t
2
◆. (3)
Note the sequential nature of this algorithm; k1 must be computed before
k2, which must be computed before k3. An alternative is to extrapolate the
forces from the previous time step. For example, the forces at the stages
corresponding to times t
n � �t, t
n � 12�t, and t
nwere k
n1 , k
n2 , and k
n3 .
Defining
⌧ =
t� (t
n ��t)
�t
, (4)
a 2nd order interpolating polynomial that passes through the required points
is
˜
f(⌧) = (2k
n1 � 4k
n2 + 2k
n3 ) ⌧
2+ (�3k
n1 + 4k
n2 � k
n3 ) ⌧ + k
n1 . (5)
For ⌧ = 0, 1/2, and 1, we recover k
n1 , k
n2 , and k
n3 , respectively. Extrapolated
forward to ⌧ = 1, 3/2, and 2 (t = t
n, t
n+ 1/2�t, and t
n+ �t), we find:
˜
f(1) = k
n3
˜
f
✓3
2
◆= k
n1 � 3k
n2 + 3k
n3
˜
f(2) = 3k
n1 � 8k
n2 + 6k
n3 . (6)
1
• Replace leapfrog with 4th-Order Runge-Kutta method
• Requires 3 force solves per time step (velocity independent force), instead of 1
• Self-starting. Gives up on symplectic property.
eE(x , t) / exp (at)
19
Particle Remapping
• In PIC convergence theory, stability error for field contains
exponential term:
• Periodically restart problem with new particles
with interpolated weights
(Wang+2011)
Before remap After remap
Particles with tiny
masses are discarded
20
Particle Remapping
B a0 = 1
˜Wq
(k)
Wq
(x) =
q/2�1X
p=0
a2p
(�1)
pM (2p)q
(x),
B[�q/2, q/2]
Wq
q = 4, 6
W4(x) =
8><
>:
|x|32 � |x|2 � |x|
2 + 1, |x| 2 [0, 1],
� |x|36 + |x|2 � 11|x|
6 + 1, |x| 2 [1, 2],
0,
W6(x) =
8>>>><
>>>>:
� |x|512 +
|x|44 +
5|x|312 � 5|x|2
4 � |x|3 + 1, |x| 2 [0, 1],
|x|524 � 3|x|4
8 +
25|x|324 � 5|x|2
8 � 13|x|12 + 1, |x| 2 [1, 2],
� |x|5120 +
|x|48 � 17|x|3
24 +
15|x|28 � 137|x|
60 + 1, |x| 2 [2, 3],
0,
kk = 4
[�q/2, q/2]
• One order of accuracy is
lost during the remap step
• High-order deposition
• 6-point, 6th-order stencil
q⇤p
=X
p
qp
W 6
✓x
i
� x
p
hx
◆W 6
✓v
j
� v
p
hv
◆
21
Particle Remapping
• Particles are laid on at the cell centers of a (possibly AMR) Cartesian
grid in phase space. The new weights are then computed as:
• Particles with small weights are discarded.
• Can be applied every few time steps, or just a few times per calculation
• Can be thought of as Semi-Lagrangian
• Compare the Forward Semi-Lagrangian technique (Crouseilles+2008)
Z
RD
(x� y)`W (x� y)dy
22
Particle Remapping
• Higher order interpolation functions
are not positivity preserving
• Can show that the 2nd moment of the
interpolating function must vanish for
the kernel to have better than 2nd
order accuracy.
Positivity not guaranteed
Z
RD
(x� y)`W (x� y)dy
23
Particle Remapping
• Higher order interpolation functions
are not positivity preserving
• Use a redistribution procedure to
maintain positivity of the distribution
function
Positivity not guaranteed
�fi = min(0, fni )
⇠i+l = max(0, fni+l )
fn+1
i+l = fni+l +
⇠i+lPneighbors
k 6=0
⇠i+k
�fi
l
Redistribution procedure24
• 2 or 3 iterations is usually sufficient
neighboring cells
25
Particle Remapping AMR example
• Example distribution
function from a remapping
stage, using 4 AMR levels
• Cosmological dark matter
test problem (Myers+2015)
Remapping on Cosmology Calculation26
Remapped Not remapped
http://adsabs.harvard.edu/abs/2016ApJ...816...56M
• Background and motivation
• Description of our numerical method
• Implementation using the Chombo framework
• Numerical results
• Summary and future research directions
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
27
Talk Outline
• Chombo - A set of tools for numerically solving PDEs • Especially useful for AMR applications • Mixture of C++ and FORTRAN • Uses a Box-based, SPMD approach to parallelism • Provides distributed data containers, including (in the next release)
for particle data • Our method was implemented using these tools, running NERSC’s
Edison machine + my laptop. • Code, tests, and analysis scripts are all here:
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
28
Implementation
https://bitbucket.org/atmyers/4thorderpic
• Background and motivation
• Description of our numerical method
• Implementation using the Chombo framework
• Numerical results
• Summary and future research directions
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
29
Talk Outline
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Linear Landau Damping
• Exponentially damped oscillation of a space charge wave • Wave-particle interactions cause the electric field wave to lose
energy to the particles, damping its amplitude • Very commonly used test problem for PIC codes
– Analytic solution for the decay rate – Long-time evolution is challenging for classical PIC methods
30
• Gaussian velocity distribution
• Small (linear) perturbation to the charge density (physical space)
• Track the electric field as a function of time
f(x, v, t = 0) =
1p2⇡
exp
��v
2
/2
�(1 + ↵ cos (kx))
(x, v) = [0, L = 2⇡/k]⇥ [�v
max
, v
max
]
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Linear Landau Damping (initial conditions)31
k = 0.5
↵ = 0.01
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Linear Landau Damping (movie)32
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Linear Landau Damping (results)33
• Black shows simulation result, red shows damping rate expected from linear theory.
• Remapping is needed to track the analytical damping rate for late times.
• Recurrence effect seen in all simulations past t = 80, a consequence of finite cell spacing in the velocity dimension
• All discrete elements of the problem, including , reduced by factor of 2.
• Ratio of remains fixed. �x/h
x
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
34
Convergence studies for PIC simulations
�t
• We then use Richardson extrapolation to compute the error. • The error in the electric field is then defined as:
eh = |Eh �E2h|
q = log2
✓||e2h||||eh||
◆
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
35
Convergence studies for PIC simulations
• And the order is computed as:
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Linear Landau Damping (convergence results)36
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Linear Landau Damping (results)37
Remapping every 5 steps gives the best results, but even every 100 helps
f(x, v, t = 0) =
1p2⇡
exp
��v
2
/2
�(1 + ↵ cos (kx))
(x, v) = [0, L = 2⇡/k]⇥ [�v
max
, v
max
]
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Nonlinear Landau Damping (initial conditions)38
k = 0.5↵ = 0.5
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Nonlinear Landau Damping (movie)39
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Nonlinear Landau Damping (results)40
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Nonlinear Landau Damping (convergence)41
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Nonlinear Landau Damping (Phase Diagrams)42
• Initial distribution function corresponds to two particle streams with opposing velocities:
f(x, v, t = 0) =
1p2⇡
v
2
exp
��v
2
/2
�(1 + ↵ cos (kx))
(x, v) = [0, L = 2⇡/k]⇥ [�v
max
, v
max
]
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Two-Stream Instability43
↵ = 0.01k = 0.5
“Inverse” of Landau Damping
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Two-Stream Instability44
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Two-Stream Instability45
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Two-Stream Instability46
Remapping 10 times (out of ~1000)
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Two-Stream Instability (convergence results)47
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Two-Stream Instability48
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
49
http://yt-project.org/
• Background and motivation
• Description of our numerical method
• Implementation using the Chombo framework
• Numerical results
• Summary and future research directions
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
50
Talk Outline
A high-order accurate Particle-In-Cell method for Vlasov-Poisson problems over long time
Summary and Future Research
• High-order method is more accurate in regions where the flow is smooth
• Not more necessarily more accurate for thin or unresolved phase-space features in the nonlinear regime.
• Remapping is necessary to control particle noise over long time evolutions
• Involves some degree of retreat from pure Lagrangian. AMR helps to an extent.Trade-offs need to be explored.
• Future research involves performing the remap selectively rather than globally.
• Coupled with high-order Maxwell solver for electromagnetic PIC (Sven Chilton)
51
Thanks for listening!
Andrew Myers [email protected] Applied Numerical Algorithms Group, Computational Research Division with Phillip Colella, Brian Van Straalen, Bei Wang, Boris Lo, Victor Minden
Advanced Modeling Seminar Series NASA Ames Research Center November 10th, 2016
https://arxiv.org/abs/1602.00747