LLNL / UEDGE

2D fluid simulation of plasma and neutrals in magnetic fusion devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove multiple redefinitions of variables when reading equilibrium files?

holm10 opened this issue · comments

Some of the parameters defined in the EFIT a- and g-files are re-defined multiple times when reading the files. This causes confusion in case there are issues with any such parameter.

E.g. simagx, rmagx, and zmagx are defined in multiple places in both the a- and g-file

read (iunit,1040) rmagx,zmagx,simagx,taumhd

read(iunit,2020) rmagx,zmagx,simagx,sibdry,bcentr

read(iunit,2020) cpasma,simagx,xdum,rmagx,xdum

read(iunit,2020) zmagx,xdum,sibdry,xdum,xdum

Proposed solution:
Define each variable once during reading of the files, store other duplicate definition in dummy variables. Currently, the last instance of each variable in the g-file are used, although the EFIT files sometimes only define the variables in the first row. Thus, I suggest only the first occurrences in the g-file are used, the remainder being read into dummy variables. This way, the dependency on the a-file is minimized.

Alternatively, manual definitions could be used, using simple Python scripts to pick variables (such as magnetic axis and X-point locations) could be utilized.

Currently, only strike-point locations seem to be uniquely defined in the a-file, and are the only required values from the a-file. An internal routine (using e.g. Python) could be implemented to completely remove the need for an a-file.

As an alternative to re-working the UEDGE internal routines, maybe the code could be interfaced with FreeQDSK?
https://github.com/freegs-plasma/FreeQDSK/