Diagnostics
This page describes possible outputs from hPIC2.
Moments of distribution functions
For a distribution \(f\), define
as the generalized moment corresponding to the multiindex \((i,j,k)\), where \(m\) is the mass of the species. Note that a number of macroscopic physical quantities can be written in terms of generalized moments, such as the mass density
the momentum density
and the total energy density for species with no internal degrees of freedom
Similarly, with \(\vec{w} = \vec{v} - \vec{u}\) as the peculiar velocity, define the rest-frame moments as
Again, many typical macroscopic physical quantities can be written in terms of rest-frame moments, such as the scalar pressure
It is sometimes useful to compute the flux of a moment through a surface defined by some unit normal. In this case, define
as the lab-frame and rest-frame directional moments, respectively.
hPIC2 is capable of computing the element averages of these moments; that is, for each element \(T\) in the mesh, hPIC2 calculates
where \(V\) is the volume of element \(T\), and similarly for the other types of moments.
These moments are computed differently for each species. The sections below describe their computation.
PIC moments
The distribution for a PIC species comprising \(N\) particles is assumed to be
where \(\vec{x}_\alpha = \vec{x}_\alpha(t)\) and \(\vec{v}_\alpha = \vec{v}_\alpha(t)\) are the position and velocity of particle \(\alpha\) at time \(t\), respectively, and \(W_\alpha\) is the weight of particle \(\alpha\). Hence
Similarly,
Boltzmann electron moments
The distribution for Boltzmann electrons is given by
where \(n_0\) is the reference density described in the section on Boltzmann electrons. Using the fact that
we can deduce
Note that the temperature \(T\) and potential \(\phi\) are both space-dependent. The integral over the element is computed differently depending on whether the field solver uses the finite difference method or the finite element method. In the FDM case, the integral is taken to be the sum of the value at the nodes times the node covolumes. In the FEM case, the integral is approximated using the same quadrature rule as in the field solver.
Since the Boltzmann electrons have zero bulk velocity, the rest-frame moments are identical to the lab-frame moments, so that
Directional moments have not yet been implemented, although they can be expressed analytically with great difficulty.
Euler fluid moments
When deriving the Euler equations, we are careful not to assume too much about the distribution. However, to compute the moments, we must make some assumption. It is safe to assume that the fluid distribution is a drifting Maxwellian,
since that is the minimum-entropy distribution that satisfies the Euler fluid hypotheses.
Using the fact that
where \(H_p\) is the physicists’ Hermite polynomial of degree \(p\), we can write
where the integral is approximated with quadrature. For rest-frame moments, we can substitute \(\vec{u} = \vec{0}\), so that
Directional moments have not yet been implemented, although they can be expressed analytically with great difficulty.
Uniform background moments
The distribution is
where the temperature and density are uniform in space. From analysis from the previous sections, this means that
Directional moments have not yet been implemented, although they can be expressed analytically with great difficulty.
Energy-angle at boundaries
Point-like probes
Fields at points in the domain can be interpolated and output. The interpolation algorithm is dependent on whether the solver uses the finite difference method or the finite element method. In the FDM case, fields are linearly (bilinearly) interpolated from the two (four) nearest nodes in 1D (2D). In the FEM case, the finite element solution is simply evaluated at the point. For example, the potential at a point \(\vec{x}\) can be evaluated as
for an \(N\)-dimensional finite element space \(V_h\) with basis \(\{ \psi_1, \ldots, \psi_N \}\). Similarly, the electric field can be evaluated as
Fields output
The instantaneous state of the fields can be output. The nature of the output depends on whether the solver uses the finite difference or finite element method. In the FDM case, the value of the fields at every node is output. In the FEM case, the finite element solution, along with a description of the finite element space, is output in a format that can be read by ParaView.
Particle output
For particle-based species, we can simply write all information about each particle at some instant to disk. Particle information includes positions, velocities, indices of the elements containing the particles, charge numbers, etc. Since simulations may have many particles, this is extremely slow, and should not be done often.