SPEC

1. Code Name: SPEC.
2. Code Category: MHD equilibrium code allowing for chaotic fields in stellarator geometry.
3. Primary Developer: S.R. Hudson.
4. Other Developers and Users: No other developers. A PhD student at the Australian National University, M. McGann, has used the code to prepare input for post-processor analysis.
5. Short description (one line if possible): Combines ideal MHD and Taylor relaxation theory to construct Multi-region, RelaXed MHD equilibria (MRXMHD).
6. Computer Language (Fortran77, Fortran90, C, C++, etc) and approx # of lines: Fortran90, approx. 23000 lines (including source documentation).
7. Type of input required (including files and/or output from other codes). Is there any special input preparation system (eg, GUI): Required input is (i) pressure and (ii) transform profiles as functions of toroidal flux, and (iii) a fixed outer boundary. A comprehensive IDL GUI has been prepared for preparing input and visualizing output.
8. Type of output produced (including files that are read by other codes and sizes of large files and synthetic diagnostics): The equilibrium magnetic field and geometry is computed. Output files include Poincare plots etc. No large data files are produced. Information allowing an independent calculation of force-balance is produced, and this is required for the xpjh code.
9. Describe any postprocessors which read the output files: An external code, xpjh, verifying that force-balance, has been achieved is available as a stand-alone code. The IDL GUI can read the output geometry and fields and can construct various diagnostics.
10. Status and location of code input/output documentation: Code inputs and outputs are documented in detail on code website. For each subroutine, a LaTeX document describing in detail the function of the subroutine, incl. mathematics, is automatically prepared on compilation.
11. Code web site? http://w3.pppl.gov/~shudson/spec.html
12. Is code under version control? What system? Is automated regression testing performed? The code is kept under CVS. Various benchmarks, convergence studies on standard test cases are routinely performed.
13. One to two paragraph description of equations solved and functionality including what discretizations are used in space and time: The code minimizes the plasma energy in a set of toroidal annuli, under the constraints of conserved toroidal flux, helicity and mass in each annulus. The topological constraints of ideal MHD are used only at the interfaces separating the annuli. These interfaces are barriers to transport and can support a finite pressure jump, and thus equilibria with non-trivial pressure stepped-pressure profiles can be computed. Within each annulus, the field is allowed to relax and reconnect, resulting in a Taylor state. The geometry is arbitrary stellarator symmetric. The magnetic vector potential is discretized using 5th order finite-elements in the radial and a Fourier series in the poloidal and toroidal directions. The Fourier representation employs a spectrally condensed poloidal angle (to give optimal efficiency). A multi-dimensional quasi-Newton scheme with global convergence properties (provided by NAG) is used to adjust the interface geometry to satisfy global force balance.
14. What modes of operation of code are there (eg: linear, nonlinear, reduced models, etc): Construction of force-free field in given annulus. (local calculation) MHD equilibrium calculation. (global calculation)
15. Journal references describing code: A comprehensive article describing the code is presently under preparation and is available at (not for distribution) http://w3.pppl.gov/~shudson/Papers/Drafts/spec.2.1.0.0.1.pdf (See website for complete list of publications and presentations describing the theoretical foundation of the equilibrium model.)
16. Codes it is similar to and differences (public version): The SPEC code may be considered as a generalization of the VMEC code. VMEC computes MHD equilibria in arbitrary geometry but under the constraints of ideal MHD globally which does not allow the flux surfaces to "tear". SPEC relaxes this constraint and allows partial Taylor relaxation across the resonances to allow islands and chaotic fields to emerge.
17. Results of code verification and convergence studies (with references): A comprehensive article describing various benchmarks and convergence studies is under preparation and is available at (not for distribution) http://w3.pppl.gov/~shudson/Papers/Drafts/spec.2.1.0.0.1.pdf
18. Present and recent applications and validation exercises (with references as available): The equilibrium of an axisymmetric + small resonant perturbation configuration was computed. This was compared to ideal stability theory (as computed by PEST). This work is ongoing.
19. Limitations of code parameter regime (dimensionless parameters accessible): Not yet explored.
20. What third party software is used? (eg. Meshing software, PETSc, ...): NAG and MPI. The graphical user interface is written using IDL.
21. Description of scalability: The code is parallelized over the radial coordinate. Scaling studies not yet performed.
22. Major serial and parallel bottlenecks: Presently a "Hessian" matrix is computed (in parallel) using finite-differences. This is by far the most time consuming task. (Present work is to seek an approximate Hessian analytically.)
23. Are there smaller codes contained in the larger code? Describe: The code computes linear, force-free fields in given annular geometry. This calculation may be performed independently of the full (non-linear) equilibrium calculation. Various post-processor diagnostics are included that are generally applicable to chaotic magnetic fields: such as routines that (i) locate invariant flux (KAM) surfaces, (ii) locate periodic orbits and estimate island widths, (iii) implementation of Greene's residue criterion. An additional post-processor diagnostic constructs an auxiliary force-balance or pressure-jump Hamiltonian, and this may be used to determine an optimal pressure profile for chaotic equilibria.
24. Supported platforms and portability: A Fortran90 compiler, MPI and NAG is all that is required. (The GUI requires IDL.)
25. Illustrations of time-to-solution on different platforms and for different complexity of physics, if applicable: Not yet.