Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conversion utility for EFIT geqdsk #728

Open
dpanici opened this issue Oct 26, 2023 · 4 comments · May be fixed by #732
Open

Add conversion utility for EFIT geqdsk #728

dpanici opened this issue Oct 26, 2023 · 4 comments · May be fixed by #732
Labels
P3 Highest Priority, someone is/should be actively working on this

Comments

@dpanici
Copy link
Collaborator

dpanici commented Oct 26, 2023

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
Copy link
Collaborator

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
Copy link
Member

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:

  • assign theta angles to rbbs and zbbs (could do simple linear spaced probably) and fit that to a DoubleFourierSeries basis.
  • Integrate 1/q to find psi (toroidal flux) as a function of chi (poloidal flux)
  • Spline profiles as function of rho (rather than chi_N)
  • For getting the net toroidal flux, there might be an easier way, but you could brute force it by evaluating psi(chi) for all points inside the LCFS

@f0uriest f0uriest linked a pull request Oct 27, 2023 that will close this issue
4 tasks
@f0uriest
Copy link
Member

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 dpanici added the low priority Nice to have, but not needed right away label Jun 25, 2024
@dpanici
Copy link
Collaborator Author

dpanici commented Aug 20, 2024

@dpanici dpanici added P3 Highest Priority, someone is/should be actively working on this and removed low priority Nice to have, but not needed right away labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Highest Priority, someone is/should be actively working on this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants