5.8 Evaluation of particle number density

Set up uniform grid-points in x-direction: xj = jΔ for j = 0,1,2,,N, as is shown in Fig. 3. Use the first b-spline (flat-top function) with a support Δp = Δ as the shape function of markers. It is obvious that we can use the following procedures to obtain the number of physical particles in each cell. For a particle marker labeled by k whose position is x = r, we can find which two grids the particle lies between. Suppose that r is between xj and xj+1, then the particle number nj and nj+1 is evaluated as follows

nj → nj + wk ⋅ xj+1-− r-,nj+1 → nj+1 +wk ⋅ r-−-xj,
                Δ                       Δ
(99)

where wk is the weight of the marker. Performing the same procedures for each marker in turn allows us to build up nj at all the grid points (all nj are set to zero before these procedures).

The particle number at the boundary grid-points j = 0 and j = N needs special treatment. The above treatment do not include the contribution to n0 from the left cell of the j = 0. Since we use periodic boundary condition, the contribution to n0 from the left cell of the j = 0 grid is identical to the contribution to nN from the left cell of the j = N grid. The latter has already been calculated in the above, which can be added to n0 obtained above to get the final n0. The same situation applies for nN. After these treatment, we have n0 = nN.

Dividing the particle number nj by the cell size Δ gives the number density.