Compile-time Symbolic Solver for the Gyrokinetic-MHD Hybrid Code GMEC
ORAL
Abstract
In magnetic confinement fusion plasmas, many instabilities have a flute mode character. The field-aligned coordinates bring the benefit of efficient resolution of parallel mode structure along the magnetic field direction. The shifted metric method [B. Scott 2001 POP] is used to eliminate the boundary numerical instability. However, the curvilinear coordinates make equations and codes more complex especially in high order PDE.
The Compile-time Symbolic Solver (CSS) is developed to generate finite difference code from vector equations directly. CSS is a C++20 template metaprogramming code. It expands vector equations into components form at compile-time, and it supports numerical differentiations of any order. It supports numerical grid systems of arbitrary dimension together with parallelization. CSS employs hybrid TBB and MPI parallelization. CSS supports both explicit and implicit equations with arbitrary boundary conditions.
We use CSS to generate the MHD part of the Gyrokinetic-MHD Hybrid Code GMEC which uses field-align coordinates with the shifted metric, and then use it to simulate ideal ballooning modes for both an analytical circular equilibrium and a VMEC equilibrium. The simulation results agree well with those of the eigenvalue code MAS. The n=20 case costs only 40 seconds using 224 cores. We have also used CSS to implement the fluid equations for ITG modes and simulated ITG successfully. Details of CSS and numerical results will be presented.
The Compile-time Symbolic Solver (CSS) is developed to generate finite difference code from vector equations directly. CSS is a C++20 template metaprogramming code. It expands vector equations into components form at compile-time, and it supports numerical differentiations of any order. It supports numerical grid systems of arbitrary dimension together with parallelization. CSS employs hybrid TBB and MPI parallelization. CSS supports both explicit and implicit equations with arbitrary boundary conditions.
We use CSS to generate the MHD part of the Gyrokinetic-MHD Hybrid Code GMEC which uses field-align coordinates with the shifted metric, and then use it to simulate ideal ballooning modes for both an analytical circular equilibrium and a VMEC equilibrium. The simulation results agree well with those of the eigenvalue code MAS. The n=20 case costs only 40 seconds using 224 cores. We have also used CSS to implement the fluid equations for ITG modes and simulated ITG successfully. Details of CSS and numerical results will be presented.
–
Publication: G.Y.Fu et al. "Development of the Gyrokinetic-MHD Hybrid Code GMEC", this meeting.<br>To be published:<br>CSS: Compile-time symbolic solver for finite difference method<br>FP3D: A code for calculating 3D magnetic field and particle motion
Presenters
-
Peiyou Jiang
IFTS of Zhejiang University
Authors
-
Peiyou Jiang
IFTS of Zhejiang University
-
Guoyong Fu
Zhejiang Univ, Zhejiang University, IFTS of Zhejiang University