Lecture 1: Course motivation and the plasma approximation

Lecture 1: Course motivation and the plasma
approximation
Presenter: Mark Eric Dieckmann
Department of Science and Technology (ITN), Link¨
oping University, Sweden
July 17, 2014
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Motivation
◮
Analytic solutions of the plasma equations are limited to the linear
regime or to isolated and idealized non-linear plasma structures.
◮
The now available computer performance allows us to solve the
non-linear plasma equations on large spatial domains.
⇒ It is, in fact, even possible to model interesting non-linear plasma
processes on a regular laptop.
◮
PIC simulations can thus be performed for educational purposes and
to support analytic or experimental work.
◮
The code should be easy to use, it should make efficient use of the
available computer resources and cost nothing.
◮
The purpose of this course is to familiarize you with Epoch, a
widely used, scalable and free-of-charge particle-in-cell (PIC)
simulation code.
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Structure of lectures
◮
The lectures will teach three aspects:
(1) Code theory (2) plasma physics and (3) how to use the code.
◮
The code theory part addresses qualitatively the numerical methods,
which are involved in solving the plasma equations.
◮
We select the simplest set of equations that illustrate the method or
a numerical problem (see also Chptr. 20 in Numerical recipes by
WH Press, SA Teukolsky, WT Vetterling and BP Flannery).
We examine the issue with Epoch after we understood the problem.
◮
This approach provides us with experience with using the code, with
its numerical constraints and with problems to look at.
◮
Further reading: Plasma physics via computer simulation by CK
Birdsall and AB Langdon.
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
The plasma approximation
◮
Plasma: Ensemble of charged particles (ions, electrons and
positrons).
◮
Consider the electrons 1-5. They interact through binary forces
(black arrows). This is an N-body problem with complexity N 2 .
3
4
1
2
5
◮
Red arrow: Collective force excerted by all electrons on electron 1.
◮
The dynamics of particle 1 is sometimes dominated by collective
forces, which reduces the complexity. When is this the case?
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
The plasma approximation
◮
Question: Over what scale are
binary forces negligible?
Place a negative charge into a
fluid with an initial positive
charge density ρ(x, y ) = 1.
3
2.5
ρ
◮
2
1.5
1
0.2
0.2
0
◮
The fluid moves towards the
charge. The potential changes.
◮
The potential ∝ 1/r changes
into one ∝ exp (−r )/r with
weaker far-field forces.
−0.2
y−position
0
−0.2
x−position
0
Collective forces dominate on
scales much larger than the
characteristic shielding distance.
Presenter: Mark Eric Dieckmann
Force modulus
◮
10
Coulomb
−2
10
−4
10
Shielded
−1
−0.5
0
Distance
0.5
1
Lecture 1: Course motivation and the plasma approximation
The thermal speed
◮
A charged fluid replaces individual charged particles by a smooth
charge density distribution ρ(x, t) = q · n(x, t). q : particle charge.
This is justified if many particles are present.
◮
A fluid plasma is characterized by its number density n(x, t) and by
a temperature T (x, t) that can vary in space x and time t.
T (x, t) 6= 0 implies a thermal spread of the particle velocities.
◮
If many collisions of ’equal strength’ take place during the time
scales of interest, then the velocity distribution at a given position x
becomes a Maxwellian (kB , m: Boltzmann const and particle mass):
fv (vx , vy , vz ) =
◮
m
2πkB T
3/2
m
exp −
[vx2 + vy2 + vz2 ]
2kB T
A charged fluid has one temperature value at any given x and t. We
1/2
can define a thermal speed vth = (kB T /m) .
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
The plasma frequency
Consider cold ion and electron clouds in 1D with the density n0 = 1.
Number density
1
Electrons
Ions
Both are
at rest.
No E.
Position
E
E
Electrons
are displaced
Electrons
move
Ions are
at rest.
No E−field
Ions move
Position
Position
Left case: Both clouds overlap and don’t move. No electric field develops
because the net charge is zero.
Middle case: We displace the electrons and ions. An electric field grows that
tries to restore charge-neutrality.
Right case: Charge-neutrality is restored, but both clouds move relative to
each other ⇒ the plasma oscillates.
1/2
A cold plasma oscillates at the plasma frequency ωp,e = (n0 e 2 /me ǫ0 )
if the ion motion is neglected.
(e, me , ǫ0 : elementary charge, electron mass and dielectric constant).
Presenter: Mark Eric Dieckmann
,
Lecture 1: Course motivation and the plasma approximation
The shielding distance
◮
A fluid plasma is characterized by a number density n(x, t) and a
temperature T (x, t).
The density gives us a characteristic plasma oscillation frequency:
The electron plasma frequency ωp,e .
The temperature gives us a characteristic electron speed: The
electron thermal speed vth,e .
◮
The ratio λD,e = vth,e /ωp,e corresponds to a length: The electron
Debye length.
◮
The shielding length in a nonrelativistic electron plasma with a
Maxwellian velocity distribution is about λD,e .
◮
Binary (Coulomb) collisions between charged particles can be
neglected if we go to spatial scales beyond λD,e .
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Going from a fluid- to a Vlasov description
◮
The particle collision frequency in most space- and astrophysical
plasmas is much lower than the plasma frequency.
⇒ Non-thermal particle populations will not thermalize through
binary collisions on electron time-scales.
An approximation by n(x, t) and T (x, t) is not appropriate.
◮
We define a more general distribution function f (x, v, t):
n(x, t) =
R
f (x, v, t) dv.
Space and velocity coordinates are independent variables.
◮
The phase space density distribution function f (x, v, t) describes a
phase space fluid.
It gives the probability with which we find particles at a given
position x and velocity v = (vx , vy , vz ).
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
The Vlasov equation
◮
Consider the simplest phase space distribution, where the number of
particles in the system is conserved.
⇒ Liouville’s theorem states that the phase space fluid is
d
d
incompressible with dt
f (x, v, t) = 0 ( dt
≡ total differential).
◮
The total derivative of f (x, v, t) corresponds to:
∂
f (x, v, t) + v∇x f (x, v, t) + a∇v f (x, v, t) = 0.
∂t
◮
Acceleration in collision-less plasma is provided exclusively by
electric and magnetic fields. a = mq (E + v × B).
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
The Vlasov equation
◮
So far we have considered only one plasma species.
Generalization to more than one species is straightforward:
Let fe (x, v, t) and fi (x, v, t) be the electron- and ion distributions.
◮
Both species do not interact directly, since there are no collisions.
Their time-evolution decouples.
e
∂
(E + v × B) ∇v fe (x, v, t) = 0.
fe (x, v, t) + v∇x fe (x, v, t) −
∂t
me
∂
Ze
(E + v × B) ∇v fi (x, v, t) = 0.
fi (x, v, t) + v∇x fi (x, v, t) +
∂t
mi
The ion charge is Z , the electron- and ion masses are me and mi .
◮
The electrons and ions react only to the collective electric and
magnetic field distributions.
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Plasma feedback to the electromagnetic fields
◮
The Vlasov equation couples the plasma to the fields. How can we
feed back the plasma response to the electromagnetic fields?
◮
We compute the total charge and current densities for all species j:


Z X
X
X Z
ρT =
ρj =
qj fj (x, v, t)dv = 
qj fj (x, v, t) dv.
j
JT =
X
j
◮
Jj =
j
X
j
qj
j
Z
fj (x, v, t) v dv =
Z


X

qj fj (x, v, t) v dv.
j
The total charge density ρT (x, t) and the total current density
JT (x, t) change the electromagnetic fields via Maxwell’s equations.
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
The Vlasov-Maxwell set of equations
The Vlasov-Maxwell set of equations is (for a plasma species n):
qn
∂
(E + v × B) ∇v fn (x, v, t) = 0,
fn (x, v, t) + v∇x fn (x, v, t) −
∂t
mn
∂
E(x, t) = ∇ × B(x, t) − µ0 JT (x, t) (Amperes law),
∂t
∂
B(x, t) = −∇ × E(x, t) (Faradays law),
∂t
1
∇ · B(x, t) = 0,
∇ · E(x, t) = ρT (x, t),
ǫ0
#
#
Z "X
Z "X
qn fn (x, v, t) v dv.
qn fn (x, v, t) dv , JT (x, t) =
ρT (x, t) =
µ0 ǫ 0
n
n
This is a closed system of equations: No equation of state is needed.
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Normalizing the Vlasov-Maxwell equations
It is useful to normalize the Vlasov-Maxwell system of equations.
Advantage: The same solution can be scaled to many problems.
Quantities: n0 : electron number density, ωpe : electron plasma frequency,
e, me : elementary charge and electron mass, c: light speed.
1/2
ωpi = (n0,i Z 2 e 2 /mi ǫ0 ) : ion plasma frequency for ion mass mi , charge
state Z , ion density n0,i = n0 /Z .
We normalize the quantities in SI units (subscript SI ) as follows:
E(x, t) = eESI (x, t)/me cωpe
J(x, t) = JSI (x, t)/ecn0
qn = qn,SI /e
v = vSI /c
1 ∂
∂
=
∂t
ωpe ∂t (SI )
Presenter: Mark Eric Dieckmann
B(x, t) = eBSI (x, t)/me ωpe
ρ(x, t) = ρSI (x, t)/en0
mn = mn,SI /me
x = ωpe xSI /c
c ∂
∂
∂x = ωpe ∂x (SI )
Lecture 1: Course motivation and the plasma approximation
The normalized Vlasov-Maxwell equations
The normalized Vlasov-Maxwell set of equations is:
qn
∂
(E + v × B) ∇v fn (x, v, t) = 0,
fn (x, v, t) + v∇x fn (x, v, t) −
∂t
mn
∂
E(x, t) = ∇ × B(x, t) − J(x, t) (Amperes law),
∂t
∂
B(x, t) = −∇ × E(x, t) (Faradays law),
∂t
∇ · E(x, t) = ρT (x, t),
∇ · B(x, t) = 0,
"
#
#
Z "X
Z X
qn fn (x, v, t) v dv.
qn fn (x, v, t) dv , JT (x, t) =
ρT (x, t) =
n
n
This works if fn (x, t) is normalized to (n0 /c).
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Scaling from lab plasmas to astrophysical plasmas
◮
We can solve the Vlasov-Maxwell system of equations in normalized
units and scale the result to real plasma.
◮
It is interesting to know what scales can be covered by a simulation
in various plasmas.
The key parameters are the electron number density n0 and the
electron temperature T . They yield the Debye length λD,e and the
electron plasma frequency ωp,e .
◮
We state typical combinations of n0 and Te for two plasmas.
Plasma
Solar wind, ISM
Laser plasma
n0
6
Te
5 × 10 m
1021 m−3
−3
4
5 × 10 K
107 K
λD,e
1/ωp,e
n0 λ3D,e
7m
7µm
10 s
10−12 s
2 × 109
3 × 105
−5
The large value of the plasma parameter n0 λ3D indicates that the
approximation of particles by f (x, v, t) is reasonable.
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Application areas: Earth’s magnetosphere
The interaction between the solar wind and the Earth’s magnetic field
provides free energy, which drives collisionless plasma processes at the:
Bow shock: mainly the
(quasi-)perpendicular bow shock.
Magnetic cusp: beam instabilities,
loss cone instabilities, double layers.
Neutral sheet: magnetic
reconnection.
The PIC simulation work benefits from a wide range of in-situ
measurements of the plasma processes.
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Application areas: Supernova remnant shocks
SNR shock: ion thermalization,
its internal structure, electron
acceleration efficiency.
Beam instabilities: ion beam
instabilities and their
thermalization.
Magnetic amplification: cosmic
ray-driven instabilities, Weibel-type
instabilities.
Fermi acceleration: generation of
non-thermal particle populations by
SNR shocks.
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Application areas: Relativistic outflows
Shocks: electron-positron and
electron-ion shocks.
Beam instabilities: plasma
thermalization and magnetic field
generation by relativistic beam
instabilities.
Fermi acceleration: particle
acceleration by relativistic shocks.
Simulations address pulsar winds, gamma ray bursts, the jets of active
galactic nuclei and microquasars.
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Practicals 1: Getting the code (Linux)
◮
Go to the web page http : //ccpforge.cse.rl.ac.uk/gf /
◮
You register for an account or you log in in the upper right part of
the web page.
◮
You click on the Projects-icon on the top of the page.
◮
You search for the project EPOCH:Extendable PIC Open
Collaboration. You click on that button.
◮
Click on the button Releases on the left hand side of the page.
Download the file epoch4.3.7.tar.gz.
◮
Type gunzip epoch4.3.7.tar.gz followed by tar -xvf epoch4.3.7.tar
◮
A new directory with the name epoch-4.3.7 has been generated.
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Practicals 2: Directory structure
Go into the directory epoch-4.3.7 by typing cd epoch-4.3.7.
You find 5 subdirectories when you type ls.
epoch1d : The 1-D version of the code. We will work here with this version.
The compiling of the 2D and 3D codes works in the same way.
The source code is in the directory src. You find in IDL some IDL program files.
epoch2d : The 2-D version of the code.
epoch3d : The 3-D version of the code.
Matlab : The files, which are needed to load the data files into Matlab. The
files do not work for the Matlab-clone GNU Octave.
VisIt : A directory, which contains some code needed by the 3D visualization
tool VisIt. We will not use VisIt in this workshop.
The VisIt-directory has two important files in the subdirectory SDF/utilities.
These are sdf2ascii.c and sdffilter.c. You need these if you don’t have Matlab.
Compile the executables by typing ./build in this subdirectory. You may
have to install sudo apt-get install python-numpy python-scipy
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Practicals 3: MPI and code compilation
◮
The code is parallelized using the message-passing interface MPI.
Several implementations of this interface exist. If you run Linux on
your laptop or on your PC then you can use the free mpich.
mpich is available through the Ubuntu Software Center (under
Ubuntu 14.04 LTS)
◮
You can compile the code with the help of a Makefile.
This makefile allows you to select between different Fortran
compilers.
Here we will use gfortran. You compile the code in the directory
epoch1d by typing make COMPILER=gfortran.
You find the code executable epoch1d in the directory epoch1d/bin
◮
The code can be run on X processors by the command
mpirun -n X ./epoch1d
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation
Summary
This lecture has covered the following topics
◮
The plasma approximation.
◮
Important parameters like the plasma frequency, the thermal speed
and the Debye length.
◮
We have motivated the use of a phase space density distribution
f (x, v, t) instead of the density distribution n(x, t) of a fluid.
◮
The Vlasov equation has been discussed. It is the evolution
equation for f (x, v, t).
◮
The Maxwell’s equations have been introduced. We learnt how to
couple it self-consistently to the Vlasov equation.
◮
The normalization of the Vlasov-Maxwell equations has been
discussed.
◮
We have taken our first steps with the Epoch code.
Presenter: Mark Eric Dieckmann
Lecture 1: Course motivation and the plasma approximation