-
Notifications
You must be signed in to change notification settings - Fork 52
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
Sign problem in vmec_fieldlines #238
Comments
Upon comparing the geometry coefficients from Simsopt with the ones from the gyrokinetics code GX, I get the following results |
I think Rahul is right here about cvdrift being >= gbdrift, on account of the beta term being positive definite (using bhat cross grad psi dot grad alpha = B_N = bmag). I think he's also right that (cvdrift - gbdrift)* bmag^2 is constant. Here's an example where gbdrift (orange) is always greater than cvdrift (green) plotted versus arc length. It's taken from the Ku & Boozer (2011) NFP4 Aspect Ratio 8 QH configuration, at s=0.5 and alpha=0. So I suspect he's right about a sign issue. |
Thanks for doing that check, Gareth! A few weeks ago, Matt suspected that there is another coefficient with a sign issue in vmec_fieldlines. To understand this better for a simpler case, I modified vmec_fieldlines for axisymmetric equilibria and compared the geometric coefficients with my VMEC2GK interface. The VMEC2GK interface uses a different mechanism to calculate the coefficients but the final answer should be the same for a given equilibrium. I take a simple DIIID-like equilibrium and compare the coefficients at rho = 0.6. Here are the results:
|
Ideal-ballooning marginal stability testThe marginal stability contour against ideal-ballooning modes has been plotted by many physicists before us. Therefore, I'll use that to clear some of the confusion surrounding this issue. First, I compare the two coefficients needed to solve the ballooning equation from a VMEC equilibrium with their respective analytical expression from Edmund Highcock's thesis:
On the other hand, if we use an older version of vmec_geometry (previously vmec_fieldlines), we get a sign discrepancy: Please ignore the S in the lower right. This analysis is done at theta0 = 0 for circular (up-down symmetric) equilibria. In other words, this test only checks the sign of cvdrift and gbdrift. We still need tests/further analysis for the two important sign-depends quantities: gds21 and cvdrift0. Unrelated bug in vmec_geometry for 2D equilibriaThis is an unrelated issue that one must be cognizant of. In a VMEC file, we parametrize the boundary shape using the following Fourier modes to get the geometric coefficients plotted in the figure at the beginning of this message RBC(0,1) = 40.0 ZBS(0,0) = 0.0 However, if you flip the sign of ZBS(0, 1) (which corresponds to the exact same boundary shape) you get the following coefficients: This message is already too long. I'll create another thread discussing the invariance of the geometric coefficients w.r.t the transformation psi -> -psi. |
The quantities cvdrift and gbdrift output by the vmec_fieldlines routine must always satisfy:
cvdrift >= gbdrift
These quantities are defined in Dr. Edmund Highcock's thesis in section 3.7 here.
Right now, this is not the case. In fact, cvdrift <= gbdrift. Below is a simple script demonstrating the problem:
The equilibrium I have used can be downloaded from here.
My hypothesis is that there is a sign error in the vmec_fieldlines routine at line 1174
specifically, the second term. A more important concern is the effect of the source of this problem on the rest of the geometric quantities. I hope we haven't made the same error somewhere else.
The text was updated successfully, but these errors were encountered: