PlasmaControl / DESC

Stellarator Equilibrium and Optimization Suite
MIT License
87 stars 22 forks source link

Add conversion utility for EFIT geqdsk #728

Open dpanici opened 10 months ago

dpanici commented 10 months ago

There are a lot of pitfalls (regarding units and conventions) between converting grad-shafranov inputs to inputs expected by DESC. It would be good to have a central utility that can take these in (say in the form of a EFIT geqdsk) and do the conversion correctly, and this would be useful for reconstruction work as well.

@f0uriest did you have one of these a while back? @rahulgaur104 it sounds like you have done this before so maybe if you already have the code we can just modify it for DESC and then add it to the codebase.

rahulgaur104 commented 10 months ago

I have tried this for SIMSOPT to convert a geqdsk to VMEC and then optimize it but I got stuck, probably due to the deficiencies of VMEC. I think I can do this with the help of SangKyeun Kim for DESC. Here's a document that helped me understand the units used by EFIT geqdsk. This document requires you to have access to the PPPL server but I swear it used to be open source. I had a copy of this page on a bulletin board in my old office.

f0uriest commented 10 months ago

This is what I had way back when: https://github.com/PlasmaControl/DESC/blob/v0.2.0/desc/gfile_helpers.py

It's probably not super useful, I don't think it did any conversion between DESC and EFIT, it was just for plotting comparisons.

I think converting a gfile to DESC should be easyish:

f0uriest commented 10 months ago

Just added a barebones function for doing this in #732

Preferably someone else can double check the units etc and make a testcase for it.

dpanici commented 2 weeks ago