-
Notifications
You must be signed in to change notification settings - Fork 26
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
ε and Γ_c objectives with Fourier Bounce #1290
base: ku/fourier_bounce
Are you sure you want to change the base?
Conversation
which was used just to compute R0. probably not worth the memory
… can actually merge it
I can't reproduce. maybe let's wait until things like #1293 get merged before debugging |
This descript copies the comment at #1290 (comment). Due to how we make sure enough resolution is used when we call `eq.compute`, the code I gave above actually computes this quantity by computing all dependencies of the effective ripple on this higher resolution grid: ```python all_dependencies_grid = LinearGrid(rho=rho, M=eq.M_grid, N=eq.N_grid, NFP=eq.NFP, sym=False) ``` Because #1313 was not resolved yet, I had marked `effective ripple` as a quantity that should not be overriden when we call `eq.compute`. That means that once all the input data to the `effective ripple` was computed accurately on the above grid. The computation of the effective ripple itself used this grid ```python eps_eff_grid = LinearGrid(rho=rho, theta=eq.M_grid, zeta=eq.N_grid, NFP=eq.NFP, sym=False) ``` This grid has half as many nodes in poloidal and toroidal directions on which we compute FFTs to do all the integrals. The plot above is the result of this computation against Neo. To generate the Neo plot we converted the equilibrium to boozer coordinates at three times the DESC equilibrium (eq.M, eq.N, etc.) resolution. So the conclusion is that when all the bounce integrals are done using FFTs that are generated from half typical desc resolution, then effective ripple converges to Neo produces from an input with boozer resolution three times the DESC resolution. Now that #1313 is resolved, I have merged that PR into this branch, and marked effective ripple as a flux surface quantity (by saying resolution_requirement="tz"). That means unless `override_grid=False` is given then everything, including all the bounce integrals will be computed on a grid with resolution at least ```python all_dependencies_grid = LinearGrid(rho=rho, M=eq.M_grid, N=eq.N_grid, NFP=eq.NFP, sym=False) ``` The old behavior can be recovered by marking `effective ripple 3/2` compute as something other than requiring theta and zeta resolution. i.e. changing `resolution_requirement="tz"` to `resolution_requirement="z"`. Then the code I gave above (repeated here), will reproduce that plot. ```python eq = get("W7-X") rho = np.linspace(1e-12, 1, 60) # the axis limit IS implemented by the way grid = LinearGrid(rho=rho, theta=eq.M_grid, zeta=eq.N_grid, NFP=eq.NFP, sym=False) num_transit = 64 data = eq.compute( "effective ripple 3/2", grid=grid, theta=Bounce2D.compute_theta(eq, X=32, Y=64, rho=rho), num_transit=num_transit, num_quad=64, num_pitch=200, num_well=20 * num_transit, ) ```
Still can't reproduce. |
Peak optimization memory usage is 5gb.
This PR updates the
Gamma_c
,Gamma_c Velasco
#1042 andeffective ripple
#1003 objectives to use the numerical methods from #1119.