• No se han encontrado resultados

Hybrid codes have been employed to simulate space plasma for more than three decades [Harned, 1982; Winske, 1985; Winske and Omidi, 1996], and only re- cently have been applied to fusion plasmas [Gingell et al., 2012, 2013; Carbajal et al., 2014]. The three main types of solver include: a direct solver[Lipatov, 2002], the predictor-corrector method scheme[Colella, 1990; Saltzman, 1994], and algorithms based on the moment method [Winske and Quest, 1988; Mat- thews, 1994]. Hybrid codes similarity with PIC codes comes from the same

argument in which the phase space density is constant along the particle tra- jectories in absence of collisions. This principle

is known as Liouville’s theorem. In this collisionless case, the spatial and velocity components map forward the distribution function conserving its phase space density. The advance of particles is done by using the current advanced method (CAM) [Matthews, 1994], which is a variation of the moment method [Winske and Quest, 1988].

The magnetic field is advanced using Faraday’s law and using the elec- tric field as a source at a defined time. The spatial derivatives are approxim- ated by finite-differences in an interlaced grid[Yee, 1966]. In this grid some quantities are defined with half-integer at cell centres ( E, %c, J) and others

at cell nodes with full-integer (B), then nxx is the full-integer domain and

(nx+ 1/2)∆xis the half-integer domain representing the interlaced grid points

in one dimension, where ∆xis the cell size, andnxis the number of grid points.

The electric field can be derived from the ions velocity moments and currents, which means that E can be obtained from the ions density, ions bulk velocity/current, andB at a given time, without the need to integrate E in time. Furthermore, existing hybrid codes differ in their approach on how to solve the fields interdependence in a numerically stable and accurate way. Our work here involves the use ofHypsi, a hybrid code that uses the CAM-CL algorithm [Matthews, 1994] and the MPI libraries for domain parallelization. The numerical scheme of the algorithm is focused in its majority on the follow- ing aspects: numerical integration of particle velocities and positions solving the Vlasov equation, time integration of the magnetic fields and advance of ions moments and currents with the subsequent update of the electric field for the new currents, a more comprehensive cycle is explain in Fig. 2.9 with all the simulation steps.

It is important to note that ‘particles’ are not ions, but macroparticles, each representing a very large number of ions. Therefore, the distribution func- tion is effectively discretized into a finite number of ion clouds with centres

xs, see Fig. 2.8, where s = 1,2, ..., N and N is the total number of particles

in the simulation. The discretization of the phase space introduces noise into the moment arrays. A consequence is that there is always a noise level in the density and currents acting as a source of small perturbations. Therefore, any-

thing with physical meaning smaller than the noise is lost, unless the number of particles is very great. The statistical noise intrinsic in PIC simulations de- pends on the number of macroparticlesN present in the box and it is inversely proportional to the square root of the number of particles per cell, i.e. in a 100 particles per cell simulation we must increase the number to 400 to only half the noise, but then the total number of particles will be four times bigger, therefore decreasing the noise an order of magnitude clearly is impossible to provide in most HPC system nowadays.

Cloud shape and weighting function

For particles and field interpolation a cloud function of shape S(x, x0) and weighting functionW(x, x0) is introduced [Hockney and Eastwood, 1988]. The finite size particle distribution might be written as in Birdsall and Langdon [1975],

fc(x,v, t) = Z

f(x,v, t)S(x, x0)dx0 (2.26) The cloud shapeS(x0) of a particle with unit charge represent its charge density, and x0 measures the distance from the centre of the particle. The fraction of the charged assigned from a particle with shape S at mesh point

xp is given by the overlap of the cloud shape with the cell pas follows,

Wp(x) =

Z xp+h/2 xp−h/2

S(x0 −x)dx0 (2.27) Most common cloud shapes and weighting function are, the nearest grid point (NGP), cloud-in-cell (CIC), see Fig. 2.8, and triangular-shaped density (TSC) [Hockney and Eastwood, 1988]. The cloud and assignment functions must satisfy the charge conservation condition:

Ng X i=1 W(xix) = 1 and Z S(x0−x)dx= 1 (2.28) Also, weighting in three dimensions must take the form [Hockney and East- wood, 1988]

W(x) =W(x, y, z) =W(x)W(y)W(z) (2.29) to obtain continuity of value (first order), continuity of value and derivative

(second order), and higher order everywhere.

The effect of gridding the fields, which is assigning values to fields at grid points by weighted sum over particles, reduced the amount of computation and memory. Given,

E(xs) = X j WsjE(xEj ) (2.30) B(xs) = X j WsjB(xBj ) (2.31)

where xEj and xBj are positions of grid points in E-grid (half-integer) and B- grid (full-integer) andWsj =W(xs,xj) is the weighting function associated to

particle positions xs.

Figure 2.8: The two-dimensional CIC or area-weighting scheme. The fraction of charge assigned to the four neighbouring mesh points from a particle at position x is given by the area of overlap of its cloud shape with the cells containing those neighbouring mesh points.

Documento similar