Interpolation shortened
This commit is contained in:
+97
-66
@@ -368,7 +368,7 @@ Besides the domain of electrostatic and electromagnetic models there is another
|
|||||||
\subsection{Interpolation}
|
\subsection{Interpolation}
|
||||||
\label{sec:num:interpol}
|
\label{sec:num:interpol}
|
||||||
The previous section only discussed Eulerian quantities on the regular grid.
|
The previous section only discussed Eulerian quantities on the regular grid.
|
||||||
But the electromagnetic fields act on the Lagranian particles, which requires
|
But the electromagnetic fields act on the Lagrangian particles, which requires
|
||||||
knowledge of the field strength at the location of the particle, not just at
|
knowledge of the field strength at the location of the particle, not just at
|
||||||
the regular grid locations. This crucial switch in view point is done by means
|
the regular grid locations. This crucial switch in view point is done by means
|
||||||
of an interpolation that we will discuss next.
|
of an interpolation that we will discuss next.
|
||||||
@@ -376,17 +376,23 @@ of an interpolation that we will discuss next.
|
|||||||
\begin{figure}[h!]
|
\begin{figure}[h!]
|
||||||
\centering
|
\centering
|
||||||
\includegraphics[width=0.25\hsize]{figure/numerics/interpolation.png}
|
\includegraphics[width=0.25\hsize]{figure/numerics/interpolation.png}
|
||||||
\caption{Interpolation using the overlap between the cell and the particle, weightes by the shape function}
|
\caption{Interpolation using the overlap between the cell and the particle, weighted by the shape function}
|
||||||
\label{fig:num:interpolation}
|
\label{fig:num:interpolation}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
Fig.~\ref{fig:num:interpolation} illustrates how the interpolation from grid
|
Fig.~\ref{fig:num:interpolation} illustrates how the interpolation from grid
|
||||||
quantities (magnetic field $B_z$ in this case) to the particle location is
|
quantities (magnetic field $B_z$ in this case) to the particle location is
|
||||||
done. The computational macro-particle represents a large number of physical
|
done. As discussed in the last chapter the numerical macroparticle represents
|
||||||
particles and is thus seen as a chunk of phase space with a density
|
a sample of the phase space with finite extent..
|
||||||
distribution over a finite extend. The fraction of particle that fall in the
|
%The computational macro-particle represents a large number of physical
|
||||||
cell are used as a weigth to multiply the field strength at the center of that
|
%particles and is thus seen as a chunk of phase space with a density
|
||||||
cell. Contributions from different cells are then added up to compute the mean
|
%distribution over a finite extend.
|
||||||
|
The fraction of the phase space volume that is located in the cell is used as
|
||||||
|
a weight for the field strength contribution from that cell.
|
||||||
|
%The fraction of particle that fall in the cell are used as a weight to multiply
|
||||||
|
%the field strength at the center of that cell.
|
||||||
|
Contributions from different
|
||||||
|
cells are then added up to compute the mean
|
||||||
magnetic field strength at the particle location. In a single dimension, this calculation can be expressed by
|
magnetic field strength at the particle location. In a single dimension, this calculation can be expressed by
|
||||||
\begin{equation}
|
\begin{equation}
|
||||||
\bar{B}_z(x_p) = \sum_{i} B_z((i+1/2)\Delta{x}) \cdot \int_{i\Delta{x}}^{(i+1)\Delta{x}} S(x - x_p)\, \mathrm{d}x \quad .
|
\bar{B}_z(x_p) = \sum_{i} B_z((i+1/2)\Delta{x}) \cdot \int_{i\Delta{x}}^{(i+1)\Delta{x}} S(x - x_p)\, \mathrm{d}x \quad .
|
||||||
@@ -401,7 +407,7 @@ W(x) = \int_{-\Delta{x}/2}^{\Delta{x}/2} S(x - x'), \mathrm{d}x' \quad .
|
|||||||
Using this and suppressing the explicit location of the gridded quantity in the
|
Using this and suppressing the explicit location of the gridded quantity in the
|
||||||
cell we can write the two-dimensional interpolation as
|
cell we can write the two-dimensional interpolation as
|
||||||
\begin{equation}
|
\begin{equation}
|
||||||
\bar{B}_z(\vec{x}_p) = \sum_{i,j} B_z(i,j) \cdot W(x_p-(i+1/2)\Delta{x}) \cdot W(y_p - (j+1/2)\Delta{y}) \label{eq:num:Bzinterpol}\quad .
|
\bar{B}_z(\vec{x}_p) = \sum_{i,j} B_z(i,j) \cdot W\left(x_p-(i+1/2)\Delta{x}\right) \cdot W\left(y_p - (j+1/2)\Delta{y}\right) \label{eq:num:Bzinterpol}\quad .
|
||||||
\end{equation}
|
\end{equation}
|
||||||
|
|
||||||
Many different choices for the shape function $S$ are possible and different
|
Many different choices for the shape function $S$ are possible and different
|
||||||
@@ -412,39 +418,52 @@ $S(-x) = S(x)$. To allow efficient evaluation of
|
|||||||
Eq.~\eqref{eq:num:Bzinterpol}, the shape function should have compact support,
|
Eq.~\eqref{eq:num:Bzinterpol}, the shape function should have compact support,
|
||||||
i.e. be non-zero only up to some small $x_{max}$.
|
i.e. be non-zero only up to some small $x_{max}$.
|
||||||
|
|
||||||
In principle all these properties are satiesfied by a $\delta$-function. This
|
The \textit{Nearest Grip Point} or NGP scheme is the minimal example satisfying
|
||||||
use of $S(x) = \delta(x)$ is also refered to as \textit{Nearest Grip Point} or
|
all requirements: The shape function is the $\delta$-function $S(x) = \delta(x)$.
|
||||||
NGP scheme. Computationally it is very cheap, as no interpolation or summation
|
This choice is simple to implement and computationally cheap, but the field that
|
||||||
has to be done, we just assume that the field at the particle location is
|
particles see is non-contiguous and the current induced by particles using this
|
||||||
identical to nearest available field on a grid locaton. The downside however is
|
shape function switches from one cell to another when an interface is crossed.
|
||||||
that the field that particles see is non-contiguous and the current induced by
|
|
||||||
particles using this shape function switches from one cell to another when an
|
|
||||||
interface is crossed. This leads to a high level of numerically induced
|
|
||||||
fluctuations in the source terms and consequently the fields.
|
|
||||||
|
|
||||||
The Cloud-in-Cell efficiently the algorithm by \cite{Birdsall_1968} has a major
|
%In principle all these properties are satisfied by a $\delta$-function. This
|
||||||
step forward in the performance and usefulness of Particle-in-Cell codes. Here
|
%use of $S(x) = \delta(x)$ is also referred to as \textit{Nearest Grip Point} or
|
||||||
|
%NGP scheme. Computationally it is very cheap, as no interpolation or summation
|
||||||
|
%has to be done, we just assume that the field at the particle location is
|
||||||
|
%identical to nearest available field on a grid location. The downside however is
|
||||||
|
%that the field that particles see is non-contiguous and the current induced by
|
||||||
|
%particles using this shape function switches from one cell to another when an
|
||||||
|
%interface is crossed. This leads to a high level of numerically induced
|
||||||
|
%fluctuations in the source terms and consequently the fields.
|
||||||
|
|
||||||
|
The Cloud-in-Cell
|
||||||
|
%efficiently the
|
||||||
|
algorithm by \cite{Birdsall_1968} was a major step forward in the performance
|
||||||
|
and usefulness of Particle-in-Cell codes. Here
|
||||||
each particle is viewed as a cloud of constant density and with the same size
|
each particle is viewed as a cloud of constant density and with the same size
|
||||||
as a grid cell (but freely movable relative to the grid). The shape function
|
as a grid cell (but freely movable relative to the grid). The shape and weight function
|
||||||
that generates that view is given by
|
that generate that view are given by
|
||||||
\begin{equation}
|
\begin{equation}
|
||||||
S_{CIC}(x) = \left\{
|
S_{CIC}(x) = \left\{
|
||||||
\begin{array}{ll}
|
\begin{array}{ll}
|
||||||
1 & |x|\leq 1/2 \\
|
1 & |x|\leq 1/2 \\
|
||||||
0 & \mathrm{else}
|
0 & \mathrm{else}
|
||||||
\end{array}
|
\end{array},\quad W_{CIC}(x) = \left\{
|
||||||
\right.
|
|
||||||
\end{equation}
|
|
||||||
and illustrated in Fig.~\ref{fig:num:S_CIC}. The associated weight function $W_{CIC}$ is
|
|
||||||
straight forward to calculate and given by
|
|
||||||
\begin{equation}
|
|
||||||
W_{CIC}(x) = \left\{
|
|
||||||
\begin{array}{ll}
|
\begin{array}{ll}
|
||||||
1-|x| & |x|\leq 1 \\
|
1-|x| & |x|\leq 1 \\
|
||||||
0 & \mathrm{else}
|
0 & \mathrm{else}
|
||||||
\end{array}
|
\end{array}
|
||||||
\right.
|
\right.
|
||||||
\end{equation}
|
\end{equation}
|
||||||
|
and illustrated in Fig.~\ref{fig:num:S_CIC}.
|
||||||
|
%The associated weight function $W_{CIC}$ is
|
||||||
|
%straight forward to calculate and given by
|
||||||
|
%\begin{equation}
|
||||||
|
%W_{CIC}(x) = \left\{
|
||||||
|
%\begin{array}{ll}
|
||||||
|
%1-|x| & |x|\leq 1 \\
|
||||||
|
%0 & \mathrm{else}
|
||||||
|
%\end{array}
|
||||||
|
%\right.
|
||||||
|
%\end{equation}
|
||||||
|
|
||||||
\begin{figure}[h!]
|
\begin{figure}[h!]
|
||||||
\centering
|
\centering
|
||||||
@@ -492,45 +511,54 @@ straight forward to calculate and given by
|
|||||||
This simple shape function is not only a major step forward, but has the added
|
This simple shape function is not only a major step forward, but has the added
|
||||||
benefit of generating an entire family of shape function of increasing order,
|
benefit of generating an entire family of shape function of increasing order,
|
||||||
by using the weight function $W$ for the previous order as the shape function
|
by using the weight function $W$ for the previous order as the shape function
|
||||||
$S$ of the new, higer order. The next step after CIC in this chain is called
|
$S$ of the new, higher order. The next step after CIC in this chain is called
|
||||||
\textit{triangular shaped cloud} or TSC. This shape function has the advantage
|
\textit{triangular shaped cloud} or TSC. This shape function has the advantage
|
||||||
of being continous. This implies that the Fourier transform of it falls faster
|
of being continuous. This implies that the Fourier transform of it falls faster
|
||||||
towards higher $k$. As \cite{Langdon_1970} showed this correspondes to reduced
|
towards higher $k$.
|
||||||
aliasing of higher $k$ to low $k$ that can be represented by the Eulerian grid
|
%As \cite{Langdon_1970} showed this corresponded to reduced
|
||||||
and consequently a reduction of the finite grid instability. This numerical
|
%aliasing of higher $k$ to low $k$ that can be represented by the Eulerian grid
|
||||||
instability heats the plasma when the numerical grid does not resolve the Debye
|
%and consequently a reduction of the finite grid instability. This numerical
|
||||||
length and can outgrow the physical processes the simulation is supposed to
|
%instability heats the plasma when the numerical grid does not resolve the Debye
|
||||||
study. Using higher order shape function suppress the instability and allows
|
%length and can outgrow the physical processes the simulation is supposed to
|
||||||
the use of (slightly) larger grid cells or alternatively a better conservation
|
%study. Using higher order shape function suppress the instability and allows
|
||||||
of the plasma thermal energy at identical resolution \cite{Shadwick_2009}. A
|
%the use of (slightly) larger grid cells or alternatively a better conservation
|
||||||
similar [problem exists when the cell size does not resolve the gyro radius of
|
%of the plasma thermal energy at identical resolution \cite{Shadwick_2009}. A
|
||||||
electrons, as shown by \cite{Horky_2017}, and again higher order shape function
|
%similar problem exists when the cell size does not resolve the gyro radius of
|
||||||
can help. The downside is that the finite support of the shape function is
|
%electrons, as shown by \cite{Horky_2017}, and again higher order shape function
|
||||||
larger and more grid cells are involved in both the interpolation of the fields
|
%can help. The downside is that the finite support of the shape function is
|
||||||
to the particle location as well as the deposition.
|
%larger and more grid cells are involved in both the interpolation of the fields
|
||||||
|
%to the particle location as well as the deposition.
|
||||||
|
In \cite{Langdon_1970} it has been shown that this decreases aliasing of high $k$.
|
||||||
|
This in turn decreases the finite grid instability - a numerical artifact that occurs,
|
||||||
|
when the numerical grid does not resolve the Debye length and that artificially heats
|
||||||
|
the plasma. The use of higher order shape functions improves the conservation of
|
||||||
|
thermal energy\cite{Shadwick_2009}.
|
||||||
|
|
||||||
Higher order shape function from the same family such as \textit{Piecewise
|
Higher order shape function from the same family such as \textit{Piecewise
|
||||||
Quadratic Shape} PQS illustrated in Fig.~\ref{fig:num:S_PQS} have been used.
|
Quadratic Shape} PQS illustrated in Fig.~\ref{fig:num:S_PQS} have been used.
|
||||||
Higher order have an increasing number of continous derivatives and therefore
|
Higher order have an increasing number of continuous derivatives and therefore
|
||||||
quicker drop off in Fourier space, but at the cost of each particle interacting
|
quicker drop off in Fourier space, but at the cost of each particle interacting
|
||||||
with an increasing number of cells. The smoother fields generated by higher
|
with an increasing number of cells. The smoother fields generated by higher
|
||||||
order shape functions reduce unphysical binary forces between nearby particles
|
order shape functions reduce unphysical binary forces between nearby particles
|
||||||
and therefore numerical collisionallity (see \cite{Eastwood_1974,
|
and therefore numerical collisionallity\cite{Eastwood_1974,Matsuda_1975}.
|
||||||
Matsuda_1975}). The EPOCH code \cite{} might be the most widely used code to
|
%The EPOCH code \cite{} might be the most widely used code to
|
||||||
use high order shape function. Otherwise order beyond TSC are not used widely
|
%use high order shape function.
|
||||||
|
Otherwise order beyond TSC are not used widely
|
||||||
enough that a consensus as to their names has emerged.
|
enough that a consensus as to their names has emerged.
|
||||||
|
|
||||||
Historically another family of shape function was used, the so-called
|
%Historically another family of shape function was used, the so-called
|
||||||
subtracted dipole shapes, see \cite{Kruer_1973} for more detail. If the code
|
%subtracted dipole shapes, see \cite{Kruer_1973} for more detail. If the code
|
||||||
uses cylindrical or spherical coordinates one can either use unmodified shape
|
%uses cylindrical or spherical coordinates one can either use unmodified shape
|
||||||
function in ``index space'' that look cartician, just like the grids we discuss
|
%function in ``index space'' that look cartician, just like the grids we discuss
|
||||||
here. Or one can take into account that grid cells become smaller and
|
%here. Or one can take into account that grid cells become smaller and
|
||||||
eventually have a singularity as they approch $r=0$ and follow the approach by
|
%eventually have a singularity as they approch $r=0$ and follow the approach by
|
||||||
\cite{Ruyten_1993} to obtain a correct density representation, even at the
|
%\cite{Ruyten_1993} to obtain a correct density representation, even at the
|
||||||
symmetry axis.
|
%symmetry axis.
|
||||||
|
|
||||||
So far only interpolation in one dimension has been discussed or interpolation
|
%So far only interpolation in one dimension has been discussed or interpolation
|
||||||
that treats all dimensions the same. This construction leads to codes that
|
%that treats all dimensions the same.
|
||||||
|
So far only dimension-by-dimension interpolation has been discussed.
|
||||||
|
This construction leads to codes that
|
||||||
conserve total momentum. Alternatively it is possible to combine shape function
|
conserve total momentum. Alternatively it is possible to combine shape function
|
||||||
of different orders to obtain a code that conserves total energy
|
of different orders to obtain a code that conserves total energy
|
||||||
\cite{Sokolov_2013}. A good example of this is the VPIC code (description in
|
\cite{Sokolov_2013}. A good example of this is the VPIC code (description in
|
||||||
@@ -538,19 +566,22 @@ of different orders to obtain a code that conserves total energy
|
|||||||
components $B_i$ are interpolated using linear interpolation in the $x_i$
|
components $B_i$ are interpolated using linear interpolation in the $x_i$
|
||||||
coordinate and NGP in the other two coordinates. Electric field components
|
coordinate and NGP in the other two coordinates. Electric field components
|
||||||
$E_i$ use NGP in the $x_i$ coordinate and CIC for the other two directions.
|
$E_i$ use NGP in the $x_i$ coordinate and CIC for the other two directions.
|
||||||
The use of only six locations to obtain the local magnetic field and twelve for
|
%The use of only six locations to obtain the local magnetic field and twelve for
|
||||||
the electric field allows to handle larger numbers of particles efficiently.
|
%the electric field allows to handle larger numbers of particles efficiently.
|
||||||
The downside is of course that hundreds or thousands of particles per species
|
%The downside is of course that hundreds or thousands of particles per species
|
||||||
are required to bring down the noise level.
|
%are required to bring down the noise level.
|
||||||
|
The low-level interpolation unfortunately requires very high particle numbers
|
||||||
|
to reach acceptable noise levels.
|
||||||
|
|
||||||
Since many different choices for shape functions are possible, many
|
Since many different choices for shape functions are possible, many
|
||||||
comparisions have been made, including \cite{Abe_1986,Kilian_2013} and
|
comparisons have been made \cite{Abe_1986,Kilian_2013,Munoz_2014}. No universal
|
||||||
\cite{Munoz_2014}. No universal winner has emerged and it is advisable to test
|
winner has emerged and it is advisable to test
|
||||||
different shape function to make sure that physical results are insensitive to
|
different shape function to make sure that physical results are insensitive to
|
||||||
the choices made. A recent idea by \cite{Wu_2018} is to use adaptive width per
|
the choices made. A recent idea by \cite{Wu_2018} is to use adaptive width per
|
||||||
particle and update them during the course of the simulation to reduce overall
|
particle and update them during the course of the simulation to reduce overall
|
||||||
noise. Other schemes that pick or modify the width of the shape function to
|
noise.
|
||||||
reduce known numerical problems might follow.
|
%Other schemes that pick or modify the width of the shape function to
|
||||||
|
%reduce known numerical problems might follow.
|
||||||
|
|
||||||
\subsection{Particle Motion}
|
\subsection{Particle Motion}
|
||||||
\label{sec:num:particle}
|
\label{sec:num:particle}
|
||||||
@@ -812,7 +843,7 @@ simple binomial filter to reduce high frequency fluctuations, but it is
|
|||||||
possible to tune filters specifically to the problem at hand and get much
|
possible to tune filters specifically to the problem at hand and get much
|
||||||
better performance.
|
better performance.
|
||||||
|
|
||||||
\subsection*{Initalization and Particle Handling}
|
\subsection{Initalization and Particle Handling}
|
||||||
|
|
||||||
\label{subsec:num:init}
|
\label{subsec:num:init}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user