Pyrokinetics - A Python library to standardise gyrokinetic analysis

Fusion energy offers the potential for a near limitless source of low-carbon energy and is often regarded as a solution for the world’s long-term energy needs. To realise such a scenario requires the design of high-performance fusion reactors capable of maintaining the extreme conditions necessary to enable fusion. Turbulence is typically the dominant source of transport in magnetically-confined fusion plasmas, accounting for the majority of the particle and heat losses. Gyrokinetic modelling aims to quantify the level of turbulent transport encountered in fusion reactors and can be used to understand the major drivers of turbulence. The realisation of fusion critically depends on understanding how to mitigate turbulent transport, and thus requires high levels of confidence in the predictive tools being employed. Many different gyrokinetic modelling codes are available and Pyrokinetics aims to standardise the analysis of such computationally demanding simulations


Summary
Fusion energy offers the potential for a near limitless source of low-carbon energy and is often regarded as a solution for the world's long-term energy needs.To realise such a scenario requires the design of high-performance fusion reactors capable of maintaining the extreme conditions necessary to enable fusion.Turbulence is typically the dominant source of transport in magnetically-confined fusion plasmas, accounting for the majority of the particle and heat losses.Gyrokinetic modelling aims to quantify the level of turbulent transport encountered in fusion reactors and can be used to understand the major drivers of turbulence.The realisation of fusion critically depends on understanding how to mitigate turbulent transport, and thus requires high levels of confidence in the predictive tools being employed.Many different gyrokinetic modelling codes are available and Pyrokinetics aims to standardise the analysis of such computationally demanding simulations.

Statement of need
Pyrokinetics is a Python project (package: pyrokinetics) that aims to simplify and standardise gyrokinetic analysis.A wide variety of gyrokinetic solvers are used in practice, each utilising different input file formats and normalisations for plasma parameters such as densities, temperatures, velocities, and magnetic fields.To improve confidence in the predictions from gyrokinetic solvers it is often desirable to benchmark the results of one code against another.Pyrokinetics aims to make this easier for researchers by acting as an interface between each code, automatically handling the conversion of physical input parameters between different normalisations and file formats.Furthermore, gyrokinetic inputs can come from a wide variety of modelling tools outside gyrokinetics, such as TRANSP (Pankin et al., 2004) and JETTO (Cenacchi & Taroni, 1988).Pyrokinetics interfaces with these tools, allowing for the easy generation of both linear and nonlinear gyrokinetic input files, and has been designed to be extensible and simple to incorporate new sources of data.
The output of gyrokinetic codes is often multidimensional, and each code stores this data in a different format with different normalisations, potentially across multiple files.Pyrokinetics will seamlessly read in all this data and store it in a single object using an xarray Dataset, automatically converting the outputs to a standard normalisation (using pint), permitting direct comparisons between codes.Furthermore, additional derived outputs, such as the linear growth rate of a turbulent instability, can be calculated using the exact same method, such that the modeller can be confident that the output is consistent across codes.
Pyrokinetics is designed to be used by gyrokinetic modellers and has already been used in several scientific publications (Giacomin, Dickinson, et al., 2023;Giacomin, Kennedy, et al., 2023;Kennedy et al., 2023).Furthermore, the Python interface opens up gyrokinetic analysis to the wide variety of Python packages available, allowing for a range of analyses from simple parameter scans to the use of thousands of linear gyrokinetic runs to develop Gaussian process regression models of the linear properties of electromagnetic turbulence (W.A Hornsby, 2023).Pyrokinetics also maintains compatibility with IMAS, a standard data schema for magnetic confinement fusion (Imbeaux et al., 2015), enabling greater interoperability with the wider fusion community and the potential development of a global gyrokinetic database.
With Pyrokinetics we strive to make gyrokinetic modelling more accessible and to increase the community's confidence in the tools available.

Submitted: 31
August 2023 Published: 06 March 2024 License Authors of papers retain copyright and release the work under a Creative Commons Attribution 4.0 International License (CC BY 4.0).