In this work, we report the construction of an eigenvalue computer code largely in C++ language, SCELT, by using the symbolic computation technique for the first time to solve the linearized single fluid magnetohydrodynamic (MHD) eigenvalue problem in toroidal geometry. A symbolic vector analysis module is developed to function the automatic derivation of the tedious linearized full MHD equations in the magnetic flux coordinate system. Furthermore, another module is developed to implement the automatic numerical discretization. These two modules dramatically reduce the human workload and obviate the possibility of a mistake during code development. The tools provide a means of constructing matrices from differential operations and can be used for (generalized) linear problems, such as source driven and eigenvalue problems. Demo uses of both the symbolic vector analysis module and automatic numerical discretization module, such as the Poisson equation and tokamak equilibrium equation, are presented to demonstrate their advantages and potential broad applications. The full MHD eigenvalue code developed with these two modules is verified by the internal kink mode and tearing mode tests. Program summaryProgram Title: SCELT (Symbolic Computation aided Eigenvalue and Linear code for Tokamaks)CPC Library link to program files:https://doi.org/10.17632/35h3xmc28k.1Licensing provisions: GNU General Public License 3.0Programming language: C++, MATLABExternal routines/libraries:• EIGEN (https://eigen.tuxfamily.org/index.php?title=Main_Page)Nature of problem: The eigenvalue full MHD model determines a wide range of physical phenomena arising from the basic destabilizing forces, which are of considerable both fundamental and practical importance for magnetic fusion plasmas. From the viewpoint of physics, solving the model is equivalent to finding the spectrum of the system, and for realistic tokamak geometry, it becomes possible only with the help of computer simulation. From the viewpoint of mathematics, it is actually a problem of solving a set of partial differential equations in a general curvilinear coordinate system.Solution method: Different from the conventional method, a symbolic vector analysis module using the symbolic computation technique is developed to conduct the automatic expansion of the full MHD equations in the magnetic flux coordinate system. In addition, an automatic numerical discretization module is developed to automatically implement the numerical discretization. Facilitated by the two modules, the coefficients of the matrices of the eigenvalue equation will be automatically generated and passed to the linear eigenvalue solver (eig function of MATLAB). The eigenvalues and eigenvectors are resolved by the solver.Additional comments including restrictions and unusual features: As originally motivated by the development of an eigenvalue full MHD code, a symbolic vector analysis module by using symbolic computation technique and a closely related automatic numerical discretization module are developed and directly applied to physics code development for the first time at least in the fusion field. Many (generalized) linear physics problems can benefit from the standalone or integrated application of these two modules. The tokamak equilibrium and eigenvalue MHD problems presented in the paper can be considered two important and practical examples.
Read full abstract