-
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
Error when computing Poloidal flux and Boozer toroidal stream function #664
Comments
Hi IronLSY, thanks for the report! I think both of these stem from the same cause, namely computing quantities at a point when the quantities require information at other points. For example, we compute DESC/desc/compute/_profiles.py Lines 143 to 146 in 8d2b96f
So you would need to compute it from the core outwards to get the correct value at The Boozer stream function is related I think, in that in order to compute it you need values over the entire flux surface. |
Thank you so much! This really helped me a lot. So now if I want to get the value of |
and grid = LinearGrid(rho=0.5, M=100, N=100, NFP=eq.NFP)
data = eq.compute("nu", grid=grid)
theta = grid.nodes[grid.unique_theta_idx, 1]
zeta = grid.nodes[grid.unique_zeta_idx, 2]
nu = data['nu'].reshape((grid.num_theta, grid.num_zeta))
theta_q = ... # where you want to interpolate
zeta_q = ... # where you want to interpolate
from desc.interpolate import interp2d
nu_q = interp2d(theta_q, zeta_q, theta, zeta, nu, period=(2*np.pi, 2*np.pi/eq.NFP) |
Rory beat me to it, but here are other examples of how you can accurately compute both values at the coordinates you wanted. Poloidal flux:
Boozer toroidal stream function:
|
Thank you guys for your patient answers, the interpolation works well ! By the way, what's the definition of Jacobian determinant of Boozer coordinates: However I thought: So I'm confused about the definition of Jacobian determinant of Boozer coordinates: Could you give me an analytical expression for it? |
This is likely poor notation on our part. Our "regular" However, what we call The actual equation is Which in axisymmetry reduces down to what you have above but without the factor of |
Thanks very much, and wish you all the best in your code development! |
@ddudt @f0uriest do we want to update this notation? In the booz_xform style output PR #680 , when saving that file one of the fields is to make this in our code I think we have to divide |
I'd be fine with that |
There exists errors when computing
Boozer toroidal stream function
andPoloidal flux
in the example shown below, which uses the DSHAPE_output from DESC packge.The output shown below hints some errors when computing
nu
andchi
.The
nu
should be the same at the same point (rho=0.5, theta=1.5PI, zeta=0), but it shows difference.The
chi
can not be zero at the point (rho=0.5, theta=1.5PI, zeta=0) since rho ≠ 0.The text was updated successfully, but these errors were encountered: