-
Notifications
You must be signed in to change notification settings - Fork 96
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
Utility to convert UEDGE to BOUT++ grids #2602
Conversation
Uses a combination of code adapted from INGRID (MIT license) and Hypnotoad (GPL-3)
Is this a thing we could add to hypnotoad? Even if just as a standalone script? Then we could use the CI setup to test that it at least keeps running without errors. [I have no idea about licences, but maybe that's a thing we'd have to worry about??] |
Hey @johnomotani I was unsure where the best place to put this would be. Talking to Mike it sounds like B2 grids are very similar to UEDGE grids, so it may be possible to make something more general that works for both. If put into hypnotoad, might it possible to load in a mesh and reuse the hypnotoad code to generate outputs? This script currently duplicates some of that code e.g metric tensor calculation. |
Getting it into hypnotoad sounds like a good idea. Would that make it possible to do the reverse conversion too? |
Hey @ZedThree ! The reverse conversion is probably easier, as long as we have the cell corner locations and B field components at those corners. |
Only tested on one DN case and one SN case. YMMV.
Prevents calculating metric components in tiny boundary cells. Also added "-i" flag to ignore error checks and continue.
hypnotoad does have cell corner positions. Not sure if Bp, Bt are calculated at the cell corners already, but that should be easy to do. |
UEDGE grids are not necessarily quite flux-surface aligned, so dx as calculated across the cell may not agree with dx between cell centers. In some pathological cases these calculations can have different signs. This version works for the small number of cases tried so far.
Closing, putting script into Hypnotoad instead boutproject/hypnotoad#136 |
Uses a combination of code adapted from INGRID (MIT license) and Hypnotoad (GPL-3)
Tested on one SN grid and two DN grids.