Table of Contents
Fetching ...

The Numerics of VMEC++

Jonathan Schilling

TL;DR

The internal numerics of the open-source VMEC++ package publicly for the first time are presented: special care has been put in providing an idiomatic Python experience, from installation to actual usage.

Abstract

VMEC++ is a Python-friendly, from-scratch reimplementation in C++ of the Variational Moments Equilibrium Code (VMEC), a fixed- and free-boundary ideal-MHD equilibrium solver for stellarators and tokamaks. The first VMEC implementation was written by Steven P. Hirshman and colleagues in the 1980s and 1990s and its latest Fortran incarnation (PARVMEC, https://github.com/ORNL-Fusion/PARVMEC) is widely used in stellarator optimization systems. Our work improves on previous implementations with regard to various critical aspects: special care has been put in providing an idiomatic Python experience, from installation to actual usage; VMEC++ has a zero-crash policy; it supports inputs in the classic INDATA format as well as friendlier JSON files. VMEC++ execution times are typically less than or equal to previous implementations, and time to convergence can be decreased dramatically by leveraging its hot-restart feature: by providing the output of a VMEC++ run as initial state for a subsequent one, VMEC++ is initialized using the previously converged equilibrium. This can dramatically decrease runtimes when running on many similar magnetic configurations as it typically happens in stellarator optimization pipelines. On the flip side, some features of the original Fortran VMEC implementation are not yet available in VMEC++, such as support for non-stellarator-symmetric configurations. This contribution presents the internal numerics of the open-source VMEC++ package publicly for the first time.

The Numerics of VMEC++

TL;DR

The internal numerics of the open-source VMEC++ package publicly for the first time are presented: special care has been put in providing an idiomatic Python experience, from installation to actual usage.

Abstract

VMEC++ is a Python-friendly, from-scratch reimplementation in C++ of the Variational Moments Equilibrium Code (VMEC), a fixed- and free-boundary ideal-MHD equilibrium solver for stellarators and tokamaks. The first VMEC implementation was written by Steven P. Hirshman and colleagues in the 1980s and 1990s and its latest Fortran incarnation (PARVMEC, https://github.com/ORNL-Fusion/PARVMEC) is widely used in stellarator optimization systems. Our work improves on previous implementations with regard to various critical aspects: special care has been put in providing an idiomatic Python experience, from installation to actual usage; VMEC++ has a zero-crash policy; it supports inputs in the classic INDATA format as well as friendlier JSON files. VMEC++ execution times are typically less than or equal to previous implementations, and time to convergence can be decreased dramatically by leveraging its hot-restart feature: by providing the output of a VMEC++ run as initial state for a subsequent one, VMEC++ is initialized using the previously converged equilibrium. This can dramatically decrease runtimes when running on many similar magnetic configurations as it typically happens in stellarator optimization pipelines. On the flip side, some features of the original Fortran VMEC implementation are not yet available in VMEC++, such as support for non-stellarator-symmetric configurations. This contribution presents the internal numerics of the open-source VMEC++ package publicly for the first time.

Paper Structure

This paper contains 114 sections, 843 equations, 24 figures, 9 tables, 3 algorithms.

Figures (24)

  • Figure 1: Demo of the reduced integration interval for integrals over an even-parity function. The grey area marks those points that are actually included in the discrete summation. The dashed lines at the bottom link points of equal value in the full interval and their counterparts in the half interval.
  • Figure 2: Flux surface geometry and MHD force residual color-coded on it, of the standard magnetic configuration of the Wendelstein 7-X stellarator. Some of the flux surface are shown as cut-open to see the inner surfaces.
  • Figure 3: Coordinate systems in use in this work. A poloidal cut through a flux surface at the toroidal angle $\phi$ is shown. A point on the (torus-like) flux surface can be uniquely specified either by its Cartesian coordinates $(x,y,z)$, by its cylindrical coordinates $(r, \phi, z)$ or by its toroidal coordinates $(\rho,\theta,\phi)$. $R_0$ is the major radius of the toroidal coordinate system at $\phi$.
  • Figure 4: Full mode number spectrum used in Eqn. (\ref{['eqn:R2']}) and Eqn. (\ref{['eqn:Z2']}) (black grid) for $M=3$ and $N=5$. The horizontal axis enumerates toroidal mode numbers $-N \leq n \leq N$ and the vertical axis enumerated poloidal mode numbers $-M \leq m \leq M$. Single Fourier modes are represented by black dots in the grid cells. The green rectangle contains the modes with $m \geq 0$. The blue rectangle contains the modes with $m=0$ and $n \geq 0$. The red polygon includes all mode number combinations required to uniquely define a real-space quantity, e.g., $R$ or $Z$. The pink dashed line and the pink numbers indicate the linear arrangement of the Fourier harmonics used to vectorize the numerical implementation.
  • Figure 5: Curve fit Jacobian matrix of a D-shaped and a bean-shaped boundary.
  • ...and 19 more figures