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

Load wall data from G-EQDSK file #71

Closed
henrikjaerleblad opened this issue Jan 22, 2024 · 0 comments · Fixed by #74
Closed

Load wall data from G-EQDSK file #71

henrikjaerleblad opened this issue Jan 22, 2024 · 0 comments · Fixed by #74
Labels
enhancement New feature or request

Comments

@henrikjaerleblad
Copy link
Contributor

I have implemented the possibility to load wall data from a G-EQDSK file (magnetic equilibrium files with file endings .eqdsk, or sometimes .geqdsk). G-EQDSK files (almost always) contain (R,z) points that define the first wall. You can therefore choose to load this data as a wall_2D or a wall_3D (by rotating the 2D data around toroidally). This can be specified via the return3Dwall keyword argument. The data is loaded into a wall_3D by default.

You use this new feature as follows:
**define your ASCOT object as a5**
a5.data.create_input("wall_geqdsk",fn="/path/to/your/G-EQDSK/file.eqdsk") # will be loaded as a wall_3D

Or, if you would rather have a wall_2D
**define your ASCOT object as a5**
a5.data.create_input("wall_geqdsk",fn="/path/to/your/G-EQDSK/file.eqdsk", return3Dwall=False) # will be loaded as a wall_2D

P.S. COCOS is taken into account. As a sidenote, when loading .eqdsk files (in general, not just walls), you have to specify explicitly if the .eqdsk file has a phi-direction clockwise (viewed from above). You do this via the phiclockwise keyword argument. You don't have to specify explicitly if the .eqdsk file has a phi-direction counter-clockwise (viewed from above)(phiclockwise=False is assumed by default, as it is true for most magnetic equilibria). Continuing, you also have to specify explicitly if the .eqdsk file has a poloidal flux that has NOT been divided by 2pi. You do this by setting the weberperrad keyword argument to False (True by default, since most magnetic equilibria have a poloidal flux that HAS been divided by 2pi). Therefore, the above a5.data.create_input() calls would look like this in these cases:

Phi-direction in the clockwise direction (viewed from above):
**define your ASCOT object as a5**
a5.data.create_input("wall_geqdsk",fn="/path/to/your/G-EQDSK/file.eqdsk", phiclockwise=True)

Poloidal flux NOT already divided by 2*pi:
**define your ASCOT object as a5**
a5.data.create_input("wall_geqdsk",fn="/path/to/your/G-EQDSK/file.eqdsk", weberperrad=False)

Phi-direction in the clockwise direction (viewed from above) AND poloidal flux NOT already divided by 2pi:
**define your ASCOT object as a5**
a5.data.create_input("wall_geqdsk",fn="/path/to/your/G-EQDSK/file.eqdsk", phiclockwise=True, weberperrad=False)

@henrikjaerleblad henrikjaerleblad added the enhancement New feature or request label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants