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 tokamak option psi_divide_twopi #172

Merged
merged 2 commits into from
Jan 12, 2024
Merged

Add tokamak option psi_divide_twopi #172

merged 2 commits into from
Jan 12, 2024

Conversation

bendudson
Copy link
Contributor

Some equilibrium codes write GEQDSK files with a factor of 2pi in the poloidal flux (lookin' at you, LIUQE), resulting in poloidal fields that are 2pi too large. If this option psi_divide_twopi is set to true then the input poloidal flux is divided by 2pi.

  • Closes #xxxx
  • Tests added
  • Udated manual
  • Updated doc/whats-new.md with a summary of the changes

Some equilibrium codes write GEQDSK files with a factor of 2pi
in the poloidal flux, resulting in poloidal fields that are 2pi
too large. If this option `psi_divide_twopi` is set to `true`
then the input poloidal flux is divided by 2pi.
Copy link
Collaborator

@johnomotani johnomotani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to leave as is.

If you have the time/energy for it though:

  • There's a cocos argument to _geqdsk.read() that would do the dividing by 2pi already
  • The tricky part is that we call _geqdsk.read() before the TokamakEquilibrium options have been read, so we can't conveniently use them to decide what arguments to pass to _geqdsk.read()
  • If we moved basically all the code in the read_geqdsk() function inside the TokamakEquilibrium constructor (to be used if eg a geqdsk_filehandle is passed, leaving the way of constructing in case it's used somewhere), then we could use the TokamakEquilibrium settings.
  • Maybe add a cocos setting instead of the psi_divide_twopi one?

@ZedThree
Copy link
Member

Building on John's suggestion, it might be nice to do this automatically inside FreeQDSK (see freegs-plasma/FreeQDSK#9)

@bendudson bendudson merged commit aa17037 into master Jan 12, 2024
21 checks passed
@bendudson bendudson deleted the psi-2pi-factor branch January 12, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants