The COBRAVMEC code calculates ideal ballooning stability for VMEC equilibria.

Theory

The Code for Ballooning Rapid Analysis^{[1]} (CoBRA) solves for ballooning stability given a VMEC equilibria. Ballooning instabilites are interchange instabilities which are localized to regions of poor curvature in toroidal systems. In general the fourth order ballooning equation can be written

Neglecting compressional effects this reduces to

Ideal ballooning stability can thus be analyzed in terms of a linear second-order differential equation

where

while P(y) and R(y) are positive. Here y is the normalized length along a field line. Ballooning instability is thus characterized by negative eigenvalues of this equation (lambda).

Compilation

COBRAVMEC is a component of the STELLOPT suite of codes. It is contained within the 'stellopt.zip' file. Compilation of the STELLOPT suite is discussed on the STELLOPT Compilation Page.

Input Data Format (pre 4.1)

The COBRAVMEC code takes an in_cobra text file which controls the execution of the code. The file has the following format

The first line is the number of starting angles in zeta. The second line is the number of starting angles in theta. The third line is the VMEC output extension. The fourth line are the starting angles in zeta. The fifth line contains the starting angles in theta. The sixth line indicates the number of surfaces on which to calculate ballooning growth rates. The seventh line indicates the specific surfaces on which to calculate the ballooning growth rates. It should be noted that in this example since there are 5 zetas and 5 thetas there will be 25 angles evaluated.

Input Data Format (version 4.1)

This version supports non-stellarator symmetric equilibria and the input format is slightly changed.

! INPUT FILE
! 1st line: extension of WOUT file
! 2nd line: k_w, kth (No. helical wells; mode number)
! 3rd line: l_geom_input, l_tokamak_input
! 4th line: nini_zeta (No. initial toroidal angles; or ALPHA labels if L_GEOM_INPUT=F .AND. L_TOKAMAK_INPUT=T)
! 5th line: init_zeta_v (vector of initial toroidal angles (or labels), in degrees)
! 6th line: nini_theta (No. initial polidal angles; or ALPHA labels if L_GEOM_INPUT=F .AND. L_TOKAMAK_INPUT=F)
! 7th line: init_theta_v (vector of initial poloidal angles (or labels), in degrees)
! 8th line: ns_surf (No. surfaces where growth rate is to be computed)
! 9th line: ns_v (vector of surfaces where growth rate is to be computed)

Execution

The code is executed by passing the in_cobra input file on the command line. Screen output may be suppressed by passing 'F' after the input file.

yourmachine:0005> ~/bin/xcobravmec in_cobra.test
====================================================
THIS IS THE (VMEC-BASED) COBRA BALLOONING CODE Version 3.00
DATE = Sep 27,2011 TIME = 15:32:56----------------------------------------------------------------------------------------------------------------
NS FLUX-s ZT_0 TH_0 GR. RATE IT POINTS XMAX OK? SYMM PRES MERC
----------------------------------------------------------------------------------------------------------------2 2.08E-02 0.00E+00 0.00E+00 -5.3585E-02 3201 1.86E+01 T 0 8.60E-02 1.04E+00
3 4.17E-02 0.00E+00 0.00E+00 -6.6434E-02 3201 1.80E+01 T 0 8.58E-02 6.20E-01
4 6.25E-02 0.00E+00 0.00E+00 -7.7881E-02 3201 1.75E+01 T 0 8.54E-02 5.28E-01
5 8.33E-02 0.00E+00 0.00E+00 -8.6155E-02 3201 1.71E+01 T 0 8.50E-02 4.34E-01
----------------------------------------------------------------------------------------------------------------
ZETA0 = 0.000E+00 THETA0 = 0.000E+00 TIME IN COBRA CODE: 1.02E+00 SEC
====================================================

Output Data Format

The screen output (if not suppressed) is verbose, containing information about the runs in tabular format. The code outputs a text file called cobra_grate.ext file (where ext is the input extension). For each set of starting points in theta and zeta it outputs a set of growth rates on each surface requested. The first line in each set is indicates the starting position in zeta, theta, and the number of surfaces on which the growth rate was calculated. Then for each surface the code outputs a line with the surface index and the growth rate. This is repeated for each field line followed. And example can be seen below

For each starting position, the code outputs the growthrate as a function of flux surface. This can be imported and easily plotted with many plotting packages.

Princeton Plasma Physics Laboratory (PPPL) cannot guarantee the quality of the information on the PPPL wiki sites, nor does the content reflect the official voice of PPPL. Please read the terms and conditions of use.

## COBRAVMEC

## Table of Contents

## Theory

The Code for Ballooning Rapid Analysis^{[1]}(CoBRA) solves for ballooning stability given a VMEC equilibria. Ballooning instabilites are interchange instabilities which are localized to regions of poor curvature in toroidal systems. In general the fourth order ballooning equation can be writtenNeglecting compressional effects this reduces to

Ideal ballooning stability can thus be analyzed in terms of a linear second-order differential equation

where

while P(y) and R(y) are positive. Here y is the normalized length along a field line. Ballooning instability is thus characterized by negative eigenvalues of this equation (lambda).

## Compilation

COBRAVMEC is a component of the STELLOPT suite of codes. It is contained within the 'stellopt.zip' file. Compilation of the STELLOPT suite is discussed on the STELLOPT Compilation Page.## Input Data Format (pre 4.1)

The COBRAVMEC code takes an in_cobra text file which controls the execution of the code. The file has the following formatThe first line is the number of starting angles in zeta. The second line is the number of starting angles in theta. The third line is the VMEC output extension. The fourth line are the starting angles in zeta. The fifth line contains the starting angles in theta. The sixth line indicates the number of surfaces on which to calculate ballooning growth rates. The seventh line indicates the specific surfaces on which to calculate the ballooning growth rates. It should be noted that in this example since there are 5 zetas and 5 thetas there will be 25 angles evaluated.

## Input Data Format (version 4.1)

This version supports non-stellarator symmetric equilibria and the input format is slightly changed.## Execution

The code is executed by passing the in_cobra input file on the command line. Screen output may be suppressed by passing 'F' after the input file.## Output Data Format

The screen output (if not suppressed) is verbose, containing information about the runs in tabular format. The code outputs a text file called cobra_grate.ext file (where ext is the input extension). For each set of starting points in theta and zeta it outputs a set of growth rates on each surface requested. The first line in each set is indicates the starting position in zeta, theta, and the number of surfaces on which the growth rate was calculated. Then for each surface the code outputs a line with the surface index and the growth rate. This is repeated for each field line followed. And example can be seen below## Visualization

For each starting position, the code outputs the growthrate as a function of flux surface. This can be imported and easily plotted with many plotting packages.## Tutorials

Put links to tutorial pages here.