1 / 32

A Particle Simulation With Accelerated Gyrokinetic Electron and Fully-kinetic Ion (GeFi) Code

A Particle Simulation With Accelerated Gyrokinetic Electron and Fully-kinetic Ion (GeFi) Code. Speaker:Wei Kong ( 孔伟 ) Nankai university Xueyi Wang 1 , Yu Lin 1 , Liu Chen 2 , Huasheng Xie 2 and Peng Wang 3 1: Auburn university 2: Zhejiang university 3: NVIDIA. Hangzhou, April 2012.

dympna
Download Presentation

A Particle Simulation With Accelerated Gyrokinetic Electron and Fully-kinetic Ion (GeFi) Code

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Particle Simulation With Accelerated Gyrokinetic Electron and Fully-kinetic Ion (GeFi) Code Speaker:Wei Kong (孔伟) Nankai university Xueyi Wang1, Yu Lin1, Liu Chen2 , Huasheng Xie2 and Peng Wang3 1: Auburn university 2: Zhejiang university 3: NVIDIA Hangzhou, April 2012

  2. Contents • Introduction to GeFi • Accelerated GeFi with CUDA • electron beam instability in the center of Harris current sheet

  3. Introduction to GeFi Motivation • Important physics of kinetic process involves both electron and ion scales. (collisionless magnetic reconnection ranges from short electron scale to global Alfven scale). • Fully particle simulation often employ artificial mass ratio in order to accommodate limited computing resources. also suffers the numerically unstable due to rather more steps. • Hybrid simulation based on fully-ion & fluid-electron mainly solve problems related with only ion dynamics. Hybrid simulation based on fully-ion and drift kinetic-electron has a salient drawback that drops the important electron gyro-radius & polarization effects. • GeFi particle simulation aims at including both electron and ion kinetics, meantime computing efficiently. (First published by Yu Lin, Xueyi Wang, Zhihong Lin and Liu Chen at 2005)

  4. Introduction to GeFi Advantages of GeFi simulation • Orders of magnitude improvements in time step and grid space are achieved by removing the rapid cyclotron electron-motion with Larmor radius retained, such that the super-computer can be greatly utilized to study a global problem such as collisionless magnetic reconnection. • Problems with disparate temporal and spatial scales (modes ranging from magnetohydrodynamic wave to kinetic wave) can be solved at an equal footing. What GeFi could resolve: • Frequency with due to the gyro-averaging of electron motion. • Wave number with due to eliminate the high-frequency Langmuir oscillation along magnetic field.

  5. Introduction to GeFi GeFi kernals —— ion equations of motion To keep symmetry in driving ions and particles: then have where and is the background magnetic field, is the perturbed scalar potential, and is the perturbed vector potential.

  6. Introduction to GeFi GeFi kernals —— electron equations of motion Employ gyro-kinetic ordering for electrons where and <…> indicates the gyro-averaging.

  7. Introduction to GeFi GeFi kernals —— potential equations (1) • generalized Poisson’s equation • Ampere’s law • electron force balance equation and were intentionally placed at left-hand side or right-hand side to calculate conveniently.

  8. Introduction to GeFi GeFi kernals —— potential equations (2)

  9. Accelerated GeFi with CUDA • GeFi & CUDA A typical simulation with 256x64 grids, 100 particles per cell and 4000 time steps (call 32 cores) will cost about 3 hours . For the 3D global simulation, much more longer. Is there a way to run faster? Yes, with CUDA! • Get to know CUDA CUDA refers to a parallel computing architecture, which mainly includes ISA instruction set(PTX) and hardware for graphics and computing(NVIDIA GPU). Through “the most-intensive computing” in GPU.

  10. Accelerated GeFi with CUDA (1) Diagnose to find which should be optimized: ……………….

  11. Accelerated GeFi with CUDA (2) Redefine variables and functions in .cu file, as soon as possible avoid calling the outer __forceinline__ __device__ void A_CROSS_B(float *A, float *B, float *C, float &ABSC…) { C[0]=A[1]*B[2]-A[2]*B[1]; C[1]=A[2]*B[0]-A[0]*B[2]; C[2]=A[0]*B[1]-A[1]*B[0]; ABSC = sqrt(powf(C[0],2)+powf(C[1],2)+powf(C[2],2)); } __global__ void acce_gpu_loop_kernel(float *QVE, float *QVE0, float *VGCE, int NE, float XMIN, float YMIN, float ZMIN) Just copy source code!! ……

  12. Accelerated GeFi with CUDA (3) At last wrapper the kernal to run at GPU,then transfer back to CPU extern "C" { void acce_gpu_loop_(float *QVE, float *QVE0, float *VGCE, int *NE, float *XMIN, float *YMIN, float *ZMIN, float *DX, float *DY, float *DZ, int *I0A, int *J0A, int *K0A, …….. } souce code … CALL acce_gpu_loop( QVE, QVE0, VGCE, NE, XMIN, YMIN, ZMIN, DX, DY, DZ, I0A, J0A, K0A, I1A, J1A, K1A, NX, NY, NZ, BTOT_ALL, B_TOT_BAR …….) source code …

  13. Accelerated GeFi with CUDA • Performance of upgraded GeFi • Initial port of acce: ~ 30x • (NXT,NYT,NZT)=(1,65,257) • CPU acce time: 14 sec/step (PGI Fortran compiler, -O2) • GPU acce time: 0.47 sec/step (kernel: 0.15 sec) optimizated by Dr. P. Wang (NVIDIA) • Second port of accp: ~ up to 45x • (NXT,NYT,NZT)=(1,65,257) • CPU acce time: 14 sec/step (PGI Fortran compiler, -O2) • GPU acce time: 0.30 sec/step

  14. Electron beam plasma • Beam instability Exists in the laboratory and space plasma, may contributes to the fast magnetic reconnection. Variations: cold and warm , weak and strong, isotropic and anisotropic, linear and nonlinear… We more concerns about the ion beam plasma due to an instability localized at the center of Harris current sheet.(Wang PoP et al., 2008).

  15. Electron beam plasma • For benchmark, we begin with an electron beam plasma: Cold dispersion relation(cold ion and cold electron beam, Verdon et al., PoP, 2011): While our GeFi simulation includes the ion and electron thermal effects.

  16. Electron beam plasma • Design the simulation: • Y B beam X wave

  17. Electron beam plasma • Electron beam FK theory(line) & cold theory(line) & GeFi simulation(contour) GeFi simulation(circle)

  18. Electron beam plasma • Weak electron beam • Consistent with higher- ranch • zero frequency branch, not grows. (up to 10 )

  19. Electron beam plasma • Strong electron beam • Forward propagating • Lower growth rate Resonance with ion- Cyclotron motion?

  20. Electron beam plasma • More strong electron beam (Verdon et al. PoP, 2011 ) For such a distribution, Thermal nearly not play effects?

  21. Electron beam plasma • GeFi simulation (nonlinear)

  22. Electron beam plasma • Analyze(1): By , Bz, fluctuates at the same level. Ex >>Ey and Ez Note: the main magnetic field is designed to Y direction.

  23. Electron beam plasma • Analyze(2): EM or ES?

  24. Electron beam plasma • Analyze(3): Resonance? Which gives , so A large gap between and , even considers the width of electron velocity distribution (300 162) Anyway ,next we show the phase condition of electrons and ions(in the frame of moving wave with ).

  25. Electron beam plasma • Analyze(4): eles phase condition(at the linear stage)

  26. Electron beam plasma • Analyze(5): eles phase condition(at the nonlineaer stage)

  27. Electron beam plasma • Analyze(6): Ions phase condition(at the linear stage)

  28. Electron beam plasma • Analyze(7): Ions phase condition(at the nonlineaer stage)

  29. Seed :strong electron beams(with thermal effects) (check the polarization) generates perturbed Ex(dominant) acclerates ion (Vx) resonance with wave along x

  30. Conclusions • A CUDA-version GeFi pic code was given. • We studied the weak and strong electron beam plasma with GeFi simulation, and compared with the cold beam theory. One typical nonlinear case with considering particles thermal effects and strong electron beam was analyzed briefly. • Basically, Our GeFi simulation shows that the thermal effects of the electron beam plays an important influence on the plasma instability. • To be continued…

  31. Thanks!

  32. To be continued • andV. S. • Background effects • Tp/Te effects • Beta effects • Anisotropic effects • Saturation level • Boundary effects • To benchmark the weak-beam nonlinear behavior with the results of Kainer et al. (S. Kainer, J. Dawson, R. Shanny and T. Coffey, Phys. Fluids 15 (1972) 493.). • Ion beam plasma • Beam plasma in Harris current sheet.

More Related