Files
sps-chapter/theory.tex
T

141 lines
14 KiB
TeX

\section{Theoretical background of Particle-in-Cell simulations}
\label{sec:theory}
\input{intro}
\subsection{Mathematical description}
The definition of a plasma as a quasi-neutral gas with collective behavior covers a wide range of very different physical scenarios. The number of mathematical and numerical descriptions is accordingly very large. An important parameter that determines plasma behavior is the collisionality: In the limit of very high collision frequencies the plasma is mostly described as fluid. The opposite limit of no collisions at all is the kinetic regime. The adequate description for this regime is a single particle description. The collisionality depends on a number of other physical parameters, in particular density, temperature, composition and degree of ionization. At lower densities collisions are less common and long range electromagnetic forces between charged particles play a (comparatively) larger role. At high temperature particles have larger relative velocities and spend less time close to each other which reduced the influence of collisions. This can be seen from the $v^{-3}$ dependence of the Coulomb cross-section. A low degree of ionization will make collisions with the abundant neutrals common and important where a highly ionized plasma with the same density of charged particles but without the neutrals may very well be effectively collisionless. There is a (possibly exceedingly tiny) fraction of charged particles in any gas of finite temperature. As the temperature increases to the point where the average energy per particle crosses the ionization threshold charged particles become much more abundant. In most cases that are studied with Particle-in-Cell simulations the degree of ionization (either due to high temperatures or other ionizing mechanisms) that neutrals will be completely ignored. But in principle the fraction of ionized particles is going to vary between zero and unity, without attaining either limited and without a first-order phase transition. As such the often employed ``plasma as the fourth state of matter'' is technically not correct. But in the following we will not concern ourselves with such disputes of theoretical purity and will instead consider a plasma with abundant charged particles, sufficient temperature and negligible collisions, similar to the choice in Chapter~4 on Gyrokinetics. If collisions (that are in some sense weak) are of interest they can be accommodated by e.g. the algorithms described by \cite{Takizuka_1977} or \cite{Miller_1994}.
A kinetic plasma could be described by taking all plasma particles and their pairwise forces into account (this would equal an N-body code). This approach is however neither feasible nor sensible: The number of particles $N$ is extremely large and the runtime is $\mathcal{O}(N^2)$ at worst or $\mathcal{O}(N \log N)$ at best.
The Particle-in-Cell (PiC) approach avoids the use of particle-particle forces and their inherent computational need. Instead the interaction of particles with the electromagnetic field generated by the moving charges is considered. %Also not single particles, but particle bunches are used.
Additionally particles are not tracked individually, but bunches of particles are combined into a single computational macro particle.
The description of particle bunches generating fields and interacting with them is somewhat na\"ive. From a mathematical viewpoint the PiC algorithm uses phase space sampling to solve the Vlasov equation (or the Maxwell-Vlasov system).
The Vlasov equation can be derived easily from a set of particles through the Klimontovich equation. Starting with the microscopic distribution of a species $\alpha$ in the six-dimensional phase space
\begin{align}
N_\alpha(\vec x, \vec v, t) = \sum_{k=1}^{N_0} \delta\left(\vec x - \vec{x}_k(t) \right) \delta\left(\vec{v}- \vec{v}_k(t)\right)
\label{eq:theory:phasespace}
\end{align}
Here each particle $k$ of the $N_0$ particles of species $\alpha$ have discrete positions $\vec{x}_k(t)$ and velocities $\vec{v}_k(t)$ in phase space. The particles with charge $q_\alpha$ and $m_\alpha$ are affected by electromagnetic fields and their motion is governed (in the non-relativistic limit) by the set of differential equations (in CGS)
\begin{align}
\dv{\vec{x}_k(t)}{t} &= \vec{v}_k(t), \
\dv{\vec{v}_k(t)}{t} &= \frac{q_\alpha}{m_\alpha} \left( \vec{E}^m(\vec{x}_k(t),t)+\vec{v}_k(t) \times \vec{B}^m(\vec{x}_k(t),t) \right) \label{eq:theory:dv}
\end{align}
The Klimontovich equation can then be derived by taking the time derivative of Eq.~\ref{eq:theory:phasespace} and using Eqs.~\ref{eq:theory:dv}.
\begin{align}
\pdv{N_\alpha(\vec x, \vec v, t)}{t} &=& \pdv{}{t} \sum_{k=1}^{N_0} \delta\left(\vec x - \vec{x}_k(t) \right) \delta\left(\vec{v}- \vec{v}_k(t)\right)\\
&=& -\vec v \cdot\pdv{N_\alpha(\vec x, \vec v, t)}{\vec x}\nonumber\\ & & - \frac{q_\alpha}{m_\alpha}\left( \vec{E}^m(\vec{x}(t),t)+\vec{v}(t) \times \vec{B}^m(\vec{x}(t),t) \right) \cdot\pdv{N_\alpha(\vec x, \vec v, t)}{\vec v}
\end{align}
This can be rewritten as
%\begin{align}
% \pdv{N_\alpha(\vec x, \vec v, t)}{t}+ \vec{v}\cdot \pdv{N_\alpha(\vec x, \vec v, t)}{\vec x} & & \nonumber \\+ \frac{q_\alpha}{m_\alpha}\left( \vec{E}^m(\vec{x}(t),t)+\vec{v}(t) \times \vec{B}^m(\vec{x}(t),t) \right) \cdot\pdv{N_\alpha(\vec x, \vec v, t)}{\vec v} & = & 0 \label{eq:theory:klimontovich}
%\end{align}
\begin{align}
\pdv{N_\alpha}{t}+ \vec{v}\cdot \pdv{N_\alpha}{\vec x} + \frac{q_\alpha}{m_\alpha}\left( \vec{E}^m+\vec{v} \times \vec{B}^m \right) \cdot\pdv{N_\alpha}{\vec v} = 0 \label{eq:theory:klimontovich}
\end{align}
This is the Klimontovich equation that describes the microphysical distribution function. In conjunction with the Maxwell equations this equation describes a collisionless plasma completely. Given that $N$ is large, the Klimontovich equation is unusable for any practical purpose.
A better description is achieved by going to the ensemble average, which includes all physical identical realizations of the plasma. The phase space density of the ensemble average is given by
\begin{align}
f_\alpha(\vec x, \vec v, t) = \langle N_\alpha(\vec x, \vec v, t) \rangle \label{eq:theory:fdef}
\end{align}
The microscopic quantities of $N_\alpha$, $\vec{B}^m$ and $\vec{E}^m$ can be written as a sum of ensemble average and perturbation.
\begin{align}
N_\alpha(\vec x, \vec v, t) &= f_\alpha(\vec x, \vec v, t) + \delta N_\alpha(\vec x, \vec v, t) \label{eq:theory:Nadef} \\
\vec{E}^m (\vec x, \vec v, t) &= \vec E(\vec x, \vec v, t) +\delta \vec{E}^m (\vec x, \vec v, t) \label{eq:theory:Emdef}\\
\vec{B}^m (\vec x, \vec v, t) &= \vec B(\vec x, \vec v, t) +\delta \vec{B}^m (\vec x, \vec v, t) \label{eq:teory:Bmdef}
\end{align}
%Now the ensemble average of Eq. \ref{eq:theory:klimontovich} can be calculated
%\begin{align}
% \left\langle \pdv{N_\alpha(\vec x, \vec v, t)}{t}+ \vec{v}\cdot \pdv{N_\alpha(\vec x, \vec v, t)}{\vec x} \right. & & \nonumber \\ \left.+ \frac{q_\alpha}{m_\alpha}\left( \vec{E}^m(\vec{x}(t),t)+\vec{v}(t) \times \vec{B}^m(\vec{x}(t),t) \right) \cdot\pdv{N_\alpha(\vec x, \vec v, t)}{\vec v} \right\rangle & = & 0
%\end{align}
%The ensemble average can now be taken for each term separately
We can substitute the definitions in Eqs.~\eqref{eq:theory:Nadef}-\eqref{eq:teory:Bmdef} into Eq.~\eqref{eq:theory:klimontovich} and take the ensemble average. Making use of the linearity of the averaging to split the equation into terms that can be averaged individually and applying definition \eqref{eq:theory:fdef} we obtain:
\begin{align}
\pdv{f_\alpha(\vec x, \vec v, t)}{t}+ \vec{v}\cdot \pdv{f_\alpha(\vec x, \vec v, t)}{\vec x} + \nonumber \\ + \frac{q_\alpha}{m_\alpha}\left( \vec{E}(\vec{x}(t),t)+\vec{v}(t) \times \vec{B}(\vec{x}(t),t) \right) \cdot\pdv{f_\alpha(\vec x, \vec v, t)}{\vec v} =\nonumber\\ = - \frac{q_\alpha}{m_\alpha}\left\langle
\left( \delta \vec{E}^m(\vec{x}(t),t)+\vec{v}(t) \times \delta\vec{B}^m(\vec{x}(t),t) \right)
\cdot\pdv{\delta N_\alpha(\vec x, \vec v, t)}{t}
\right\rangle
\end{align}
The term on the RHS is the ensemble average of a second-order product of perturbations in different realizations of a plasma state. This quantity is negligibly small. The LHS of the equation then yields the Vlasov equation
% \begin{align}
% \pdv{f_\alpha(\vec x, \vec v, t)}{t}+ \vec{v}\cdot \pdv{f_\alpha(\vec x, \vec v, t)}{\vec x} +\nonumber\\ \frac{q_\alpha}{m_\alpha}\left( \vec{E}(\vec{x}(t),t)+\vec{v}(t) \times \vec{B}(\vec{x}(t),t) \right) \cdot\pdv{f_\alpha(\vec x, \vec v, t)}{\vec v} = 0 \label{eq:theory:vlasov}
% \end{align}
\begin{align}
\pdv{f_\alpha}{t}+ \vec{v}\cdot \pdv{f_\alpha}{\vec x} + \frac{q_\alpha}{m_\alpha}\left( \vec{E} + \vec{v} \times \vec{B} \right) \cdot\pdv{f_\alpha}{\vec v} = 0 \label{eq:theory:vlasov} \quad .
\end{align}
%Vlasov Gleichung als Gleichung für die Ensemblemittel
From the viewpoint of physics the Vlasov equation is the representation of the time evolution of the phase space distribution ensemble average (in combination with Maxwell's equations). Mathematically the Vlasov equation is a hyperbolic conservation equation (which corresponds to the fact that the phase space volume is conserved). %%TODO Referenz grünes Buch
%Vlasov lösen ist doof
Formally a large set of methods exist to solve a set of hyperbolic conservation laws (even for the six-dimensional phase space) and a number of solutions for lower dimensional systems has been implemented. %%TODO Zitate Vlasov mit Fluidmethoden
Direct numerical simulation is severely limited: In first place it requires a solution on a six-dimensional grid, on the other hand the requirement to have constantly positive phase-space density leads to strong diffusion. These two problems together cause a massive computational overhead that only very special cases justifies the use of Vlasov methods. One such case is when low numerical noise is needed. %with no clear advantage in the solution of the Vlasov equation.
%Sampling des Phasenraums
Rather than solving the Vlasov equation for the full distribution function, samples of the phase space can be used. As Liouville's theorem states that the volume of these phase space samples is constant. The motion of the phase space volumes can be traced as single particles. However the phase space samples do not represent individual physical particles, but rather a bunch of $w_p$ physical particles with (nearly) identical position and velocity that stay together during time evolution. This number $w_p$ is also known as the statistical weight of the phase space sample or the macrofactor.
%%Hier nochmal auf Euler vs Lagrange eingehen
The distinction made here is between the Euler and Lagrange picture: The Vlasov equation as hyperbolic conservation law can be treated from the viewpoint of the change of the distribution function at fixed points (i.e., on a fixed grid of the phase space) or by following the motion of single phase space points. The latter is the so-called Lagrangian picture, while the other is the Eulerian picture. This distinction is not limited to the Vlasov equation or the phase space. It is a common concept used also in hydrodynamics, where fluid elements or the fluid velocities on a grid could be traced.
There are still different possibilities for the implementation of a Lagrangian picture: As discussed above there is PiC and N-body codes. The N-body method is a particle-particle method, where the particles are treated in a Lagrangian way and the inter-particle forces are calculated directly. The PiC method on the other hand is a particle-mesh (PM) method, where particles are Lagrangian, but their inter-particle forces are calculated via a grid, which stores fields.
%Wir folgen den Phasenraumelementen -> Lagrangebild. Was macht Mehdi anders?
%PiC ist eine Lösung der Vlasovgleichung, welchen Teil des Plasmas beschreibt das?
Following the phase space samples using the PiC algorithm is obviously a solution to the Vlasov equation. As a numerical solution for phase space samples it is obviously not an exact solution of the Vlasov equation. But besides unavoidable problems of numerical methods (e.g., limited accuracy) the PiC method has two distinct problems: Noise from phase space sampling and discretization errors from the limited resolution of the grid.
% Not sure if that is true. Grid heating and NCI come from discreteness
%As will be described later the core problem in the grid discretization is not so much the coarseness of the grid but rather the finiteness of the grid.
%Was folgt daraus, daß wir das numerisch diskretisieren bzw. den Phasenraum sampeln?
The mathematical viewpoint is clear: PiC is a method, where the phase space distribution is sampled and forces are calculated using a particle-to-mesh method. This in turn yields solutions, which are solutions to the Vlasov equation, i.e., collisionless plasmas. There are no further restrictions which kind of plasma may be described using the PiC method, but for practical purposes only small scale simulations are possible.
%PiC kann alle stoßfreien Plasmen
%Ist aber nur gut auf kleinen Skalen, weil sonst zu teuer
%Poissonverteilung
%Gitterauflösung?
%Teilchenbahnen?
%Numerische Kollisionen?
%Kinetische Plasmen können über verschiedene Methoden beschrieben werden.
%Die Haupteigenschaft des kinetischen Plasmas ist der Mangel an Stößen.
%Eine völlig korrekte Beschreibung ist die direkte Wechselwirkung aller Teilchen miteinander
%Geht, ist korrekt, heißt Molekulardynamik und ist O(N^2), wenn man mit Tree-Codes spielt O(N log N)
%So nicht: Sprich lieber von N-Body und davon, daß das nur sinnvoll bei langreichweitigen (keine Abschirmung) Feldern ist. Also bei Gravitation
%Der Übergang zu Teilchen in Feldern liegt nahe.
%Is' nett, aber so einfach geht das auch wieder nicht: Viel zu viele Teilchen
%Beschreibung des Teilchenkontinuums durch die Vlasov-Gleichug
%Exkurs: Wo kommt die Gleichung her?
%Lösung der Vlasov-Gleichung ist ein 6D-Problem!
%Aber wir können Samples des Phasenraums im Lagrangebild anschauen
%Lese-TODO:
%- Wieso geht der Übergang MD->PiC nicht trivial?
%- Herleitung Vlasov-Gleichung
%- Lagrange-Bild