PrincetonUniversity / STELLOPT

This is the GitHub repository for STELLOPT, the state-of-the-art stellarator optimization code.
https://princetonuniversity.github.io/STELLOPT/
MIT License
62 stars 18 forks source link

Change to radial gridding in BEAMS3D #272

Closed lazersos closed 2 weeks ago

lazersos commented 1 month ago

@cfe316 has pointed out that by switching the internal gridding of flux lookup to rho, the code provides better lookup near the axis and better profile quantities near the axis. My proposal is to change S_spl and S4D to RHO_spl and RHO4D where s=rho*rho (rho=r/a). This then results in fewer SQRT calls and only modest changes to the code. BEASM3D will still output S_lines correctly so to the user there should be no significant changes in the post-processing routines.

cfe316 commented 1 month ago

The code I used to create the figures I showed you is here:

https://github.com/cfe316/STELLOPT/tree/feature/XYRHO4D

It's not very clean (I still create the largely unneeded X_ARR, Y_ARR and so on, and also just to be super obvious almost my new variables have rho or RHO in the name) or complete (only the init_vmec loading path is handled).

I can start a draft pull request if you like.

cfe316 commented 1 month ago

I made a draft PR #273 as a start. LMK if you want to handle the rest and I can test it or visa-versa. I think you would be better equipped to perform the testing; I mostly just have the one test case (using a VMEC input) working.