TRANSP

From LTX Wiki
Jump to: navigation, search

Introduction

This document is intended to be somewhat of a manual for setting up and running TRANSP for the Lithium Tokamak Experiment (LTX). Also some of this information may be out of date, referring to LTX rather than LTX-B or neglecting recent changes to the cluster, etc.

The official TRANSP webpage is https://transp.pppl.gov and a helpful old webpage is https://w3.pppl.gov/~pshare/help/transp.htm

There's also a private TRANSP github that you may need to ask transp_support@pppl.gov to access: https://github.com/PrincetonUniversity/TRANSPhub

Preliminaries

Email transp_support@pppl.gov to have a TRANSP account set up for you. Let them know you'll be running on LTX.

In /u/[username]/.cshrc, add:

setenv TR_EMAIL [email]

setenv EDITOR emacs

setenv MDS_TRANSP_SERVER transpgrid.pppl.gov

setenv MDS_TRANSP_TREE TRANSP_LTX

setenv XTRANSPIN_TOK LTX

module load mdsplus

module load mod_ntcc

module load mod_ntcc ntcc/intel/2019/22.1.6

Run Directory

By default, files for TRANSP runs are stored in /u/[username]/transp/t[TRANSP_shotnumber].

TRANSP Shotnumbers

LTX-B and TRANSP shot numbers are both 6 digits and so the same number. However there is potential for collision with old LTX TRANSP shot numbers, which will have to be addressed eventually.

LTX had shotnumbers based on the time and date, in YYYYMMDDhhmm format. However, TRANSP can only accept six digit shotnumbers. To remedy this, a TRANSP shotnumber is created based off the number of valid shotnumbers since a certain date (0902270000). To avoid trouble with TRANSP, the first TRANSP shotnumber is 100001. A mapping of shot numbers is stored in /p/ltxdata/idl_analysis/TRANSPshotnumber_map. The IDL procedure build_TRANSP_shotnumber_list.pro creates this file and updates it. get_LTX_shotnumber.pro and get_TRANSP_shotnumber.pro convert one shot number to another.

TRANSP Inputs

TRANSP requires specially-formatted input ufiles. Several utilities have been created in /p/idl_analysis/TRANSP/ to generate these ufiles. These also require /p/beast/idl to be added to the IDL path

Name Function
make_transp.pro Makes all ufiles from experimental data by calling the following
make_ip.pro Makes plasma current ufile from experimental data
make_rbz.pro Makes R*B_z ufile from experimental data
make_ts.pro Reads TS data from the MDS tree and writes ufiles
make_ts_multitime.pro Reads TS data from multiple shots in the MDS tree at different times and writes ufiles
make_vsurf.pro Reads loop voltage from the MDS tree and writes ufiles

Scrunch2

  • To run scrunch2 to set up magnetics equilibria:

scrunch2

enter 3 or 4 character TOKAMAK id code, e.g. “NSTX”: index

unixfile (scrunch2 (G-Eqdsk index file)): enter file spec or “r”: index.dat

tokamak id (3 or 4 characters e.g. "MAST"): LTX

shot number (non-negative integer.le999999): 103198

four digit shot year: 2012

enter “Y” to verify: Y

scr2_options: processing option: e 2 (this ganges gs_errmax to a reasonable level)

scr2_options: processing option: a

scr2_examine: processing option: q

scr2_examine: write the data to Ufiles? (Y/N): y

scr2_write: enter option code letter: w

enter 3 or 4 character TOKAMAK id code, e.g. "NSTX": q

  • You can run the whole thing at the command line, for example scrunch2 index ~/eqdsk/TS64/index_TS64.dat ltx 102974 y e 2 a q y w q
  • Scrunch requires an index.dat file with a list of times and associated g-files:

ntimes=3

path='/p/nstxusr/nstx-users/jschmitt/lrdfit3/LTX/MultiYear/verPublic/fits/1209141619/01/output'

time=0.457 filename=g120914.00457_000

time=0.458 filename=g120914.00458_000

time=0.459 filename=g120914.00458_000

However, I haven't gotten the path to work. It seems not to be needed if the index file is in the same directory as the eqdsk files, or else fully specify the path for each filename.

Namelist

xtranspin lets you edit the namelist interactively, though it is no longer supported. [shot]TR.DAT

Running TRANSP

https://w3.pppl.gov/transp/xtranspin_user.guide seems to be of use.

trdat: tests run setup

tr_start 105198A01

tr_send 105198A01

xtranspin File > Open > [namelist file]

RPLOT: Plotting TRANSP Output

  • rplot can be run on NoMachine to plot TRANSP variables
  • Below are the steps to grab data from TRANSP run 103617C01, with a few examples showing how to plot some variables/multigraphs.

>> xterm & (this is necessary to plot anything)

>> rplot (from new window)

>> t (select from MDSplus tree)

  • Server and tree name should already be transpgrig.pppl.gov and transp_ltx
  • If not set, set them using inputs s, t

>> n (identify by run ID)

>> 103617C01

>> q

  • From this top node here are steps to plot:

Scalar Multigraph PBLOS:

>> 2

>> 7

>> pblos

Profile Multigraph NB01:

>> 6

>> nb01

>> 1

>> 1

>> 0.470 (selecting time=470ms)

Scalar Output:

>> 2

>> 2

>> pinj (neutral beam power)

Accessing TRANSP Output

IDL>

mdsconnect, 'transpgrid'

mdsopen, 'transp_ltx', 1029890103

Cold shell high-Ip: 1029890103

Hot shell high-Ip: 1032160104

Get fast ion data out of TRANSP run

  • You need to have SELAVG and OUTTIM defined in your namelist in order for TRANSP to dump out .DATA files enumerated for each time point you requested (.DATA1, .DATA2, etc)
  • To get the .DATA files converted to .cdf files you need to run get_fbm. Below is an example showing commands necessary to create the cdf file for the 2nd time point of transp run 111539F03, run on NoMachine.

$ cd /u/wcapecch/transp/t111539/

$ get_fbm

(enter transp run ID) -> 111539F03

(enter path string) -> /p/transparch/result/LTX/15/

(enter path string) -> q

(enter file id) -> 2

(option code) -> t

(tokamak label) -> LTX

(option code) -> w

(option code) -> c

  • The LTXb-py repository in the LTXb-PPPL Organization on GitHub contains the Halo3D class in LTXb-py/transp_code/transp_classes.py to process and visualize the 3d Halo neutral density once a CDF file has been created.
  • Once generated, the FBM python class found in LTXb-py/transp_code/transp_classes.py can be used for manipulating and visualizing data. See the LTXb-PPPL Organization page for access.

Get 3D neutral data out of TRANSP

  • TRANSP can be set up to compute the neutral footprint of the NBI, computing multiple generations of neutrals. The namelist needs to be set up to record this data, see /u/wcapecch/transp/t103617/103617C03TR.DAT for an example. (Runs C03, C04, and C05 compute the neutral footprint from the full, half, and third energy beam components in an effort to minimize the large compute resources necessary.) These runs are very large and are difficult to set up in such a way as to get them to complete while getting good statistics. It is recommended that you append big when starting your TRANSP run to allocate additional memory resources as follows: tr_start <run_id> big
  • Similar to get_fbm above, the code below illustrates how to create a cdf file containing the 3d halo neutral data

$ cd /u/wcapecch/transp/t103617/

$ pboxn0

(enter transp run ID) >> 103617C03

(enter path string) >> /p/transparch/result/LTX/12/

(enter path string) >> q

(enter file id) >> 4 (this corresponds to time pt 4 set by OUTTIM in tr.dat)

(enter display op code) >> d (this writes to file)

>> q

>> q

  • Plotting is also possible within the pboxn0 program, but in order for plots to show properly enter xterm & first and run pboxn0 from this new (plot friendly) terminal window.
  • The LTXb-py repository in the LTXb-PPPL Organization on GitHub contains the Halo3D class in LTXb-py/transp_code/transp_classes.py to process and visualize the 3d Halo neutral density once a CDF file has been created.

Dump EQDSK from TRANSP run

  • Utilizing code trxpl an eqdsk file can be created giving magnetic field state information at timepoints during a TRANSP simulation (amongst other things probably)
  • The steps below will walk through dumping an eqdsk file for t=464.152ms (corresponding to timepoint 5 of OUTTIM) of run 106536R02 from a NoMachine terminal.

>>trxpl

>>m (toggle to MDS+ mode)

>>d (set MDS shot #)

>>s (set shot #)

>>106536R02

>>a (accept)

>>4.64152E-01

>>5.e-4 (time averaging window- not sure bout this setting)

>>151 (# theta pts)

>>101 (# R pts)

>>103 (# Z pts- 101 was default, using 103 helps distinguish axes)

>>1 (Bt is ccw)

>>-1 (Ip is cw)

>>y (confirm)

>>g (write GEQDSK)

>>Enter 101, 103, 201 to confirm old value settings

>>106536R02_05.eqdsk (give filename)

  • File should be written to current working directory
  • This eqdsk file can be read by read_eqdsk3 in LTXb-py/helpful_stuff/