-
Notifications
You must be signed in to change notification settings - Fork 19
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
Implement calculation of sqrt(g), B^X, B_X, and |B| from R, Z, lambda, iota, phi' #42
Comments
Perhaps related: the output of xn_nyq modes in wout.nc has opposite sign from xn , no matter if LNYQUIST is true or false. One should check the sign convention of zeta once more, and which of xn or xn_nyq produces the intended one. Correction: seems like this affects only matlabVMEC, where xn switches sign but not xn_nyq |
? xn and xn_nyq always seems to have the same sign, both in wout.nc files
I've generated by running stellopt's vmec myself and in wout files I've
received from IPP.
…On Fri, Feb 7, 2020 at 6:27 AM Christopher Albert ***@***.***> wrote:
Perhaps related: the output of xn_nyq modes in wout.nc has opposite sign
from xn , no matter if LNYQUIST is true or false. One should check the sign
convention of zeta once more, and which of xn or xn_nyq produces the
intended one.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#42?email_source=notifications&email_token=ABH4ZA4OYI7EGQNGELC3NBDRBVASDA5CNFSM4KQ5ZS42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELCTWCQ#issuecomment-583351050>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABH4ZA475HIFCLYIOJEDWR3RBVASDANCNFSM4KQ5ZS4Q>
.
--
=======================================
Dr. Matt Landreman
Associate Research Scientist
Institute for Research in Electronics & Applied Physics
University of Maryland
8223 Paint Branch Drive, College Park MD 20742, USA
(+1) 651-366-9306
mattland@umd.edu
|
Sorry for the confusion - it was really just in matlabVMEC where this occured, and otherwise the sign was the same directly from wout.nc . No idea why - @lazersos what do you think? |
So there was an issue in |
Thanks! This whole story became a bit more confusing, and I'll try to summarize it here. We made two runs on the same equilibrium, one time with ntor=mpol=6 and one time with ntor=mpol=12 harmonics. Here are the results for |B| on the flux surface s=0.3 . Column 1: truncated spectrum ( The two observations are
This means that when using low resolution VMEC runs such as 6x6, one might get results matching reality better by artificially truncating / filtering the spectrum of the B field, even though it's not consistent with low-resolution R,Z geometry. It would be interesting to investigate this in detail. 6x6
12x12
|
@krystophny Interesting. I've been reading through bit more of VMEC to better understand how the GMNC array is constructed. One thing that VMEC does internally is to separate the even and odd modes of R,Z, and Lambda. They then divide the odd modes by
where the
where I've taken This has implication for the computation of the cross product. Essentially it has extra terms as can be seen in I've raised the issue with the ORNL/VMEC GitHub site and am tracking it there with their developers. The end goal will be to only use the basic quantities from VMEC in the future so as to be |
I just wanted to give a quick explanation of why this is an issue. The VMEC jacobian looks like |
@lazersos Thanks for pointing this out! I always wondered about the 0.25 in |
@zhucaoxiang it is because TERPSICHORE needs the Jacobian which is NYQUIST sized. |
Just an update to this issue. The even and odd modes of R, Z, and Lambda do need to be interpolated differently. The even modes can be linearly interpolated in flux but the Odd modes must be interpolated in rho, so the harmonics need to be multiplied by Looking at VMEC, internally the code recomputes lambda on the half grid before outputting (for back-compatibility with old version). However, this may not be done correctly near the axis (or may be hiding special treatment). |
Similar to using TERPSICHORE, when using stellopt or vmec with cobravmec, LNYQUIST=F must be specified in the vmec-portion of the input namelist. On branch Lazerson with commit 98b1667 (HEAD -> Lazerson, origin/Lazerson) I did a benchmarking test of vmec, stellopt and cobravmec through the various ways that the code(s) handle the LNYQUIST flag, and through the various ways that that codes can be run: vmec stand-alone, stellopt in 'single_iter' mode, and stellopt in standard 'lmdiff_bounded' mode with niter=1, (similar to lmdiff, but with bounds), and 'lmdiff_bounded' mode with niter>1. So, I have 12 types of code paths:
Only the runs with LNYQUIST=False produce the correct results. |
@jcschmitt I can see in COBRAVMEC at |
Sounds good. On Monday, I’ll go over this with Aaron and Ben (they wrote a julia version that agrees with what I called the ‘correct’ results. )
…________________________________
From: Samuel Lazerson ***@***.***>
Sent: Saturday, March 12, 2022 1:04 PM
To: PrincetonUniversity/STELLOPT ***@***.***>
Cc: John Schmitt ***@***.***>; Mention ***@***.***>
Subject: [EXT] Re: [PrincetonUniversity/STELLOPT] Implement calculation of sqrt(g), B^X, B_X, and |B| from R, Z, lambda, iota, phi' (#42)
CAUTION: Email Originated Outside of Auburn.
@jcschmitt<https://github.com/jcschmitt> I can see in COBRAVMEC at order_input the change which needs to happen. However, I disagree that any result obtained with LYQUIST=F is 'correct'. When LNYQUIST=F is set the modes for anything other than the R, Z and Lambda harmonics are artificially truncated. I will make the change to order_input with the correct behavior. This change will propagate to STELLOPT as well.
—
Reply to this email directly, view it on GitHub<#42 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACUG23NTSQLTL3MCG2TSZILU7TTEVANCNFSM4KQ5ZS4Q>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@jcschmitt If they're not using the full nyquist sized results then it's isn't 'correct'. I've pushed a branch which should fix the issue for COBRAVMEC, but initial tests indicate it's slower since the searches over Lambda now have to deal with the larger mode structure. |
@jcschmitt In the branch I've pushed #147 the code now properly handles LNYQUIST sized arrays. However, I've noticed that inside of COBRAVMEC all arrays are linearly interpolated from the half to full mesh. This isn't entirely correct as the odd modes should go as |
@lazersos Hmm... Can we still trust all the previous results? |
Currently VMEC only output the correct values from sqrt(g), B^X, B_X, and |B| when
LNYQIST=.true.
is set inwrout.f90.
When this is done these arrays have a different Fourier spectrum than the R, Z and Lambda arrays. This is going to be addressed in two ways.For reference
sqrt(g) = R*(RuZs-RsZu) where Ru=dR/du
B^u = phiprime*(iota-Lv)/sqrt(g) where Lv=dlambda/dv
B^v = phiprime(1+Lu)/sqrt(g)
|B| = sqrt(B^u2guu+2B^uB^vguv+b^v2*gvv)
Here's what I suggest be worked on:
COBRAVMEC: Need to be implemented (@lazersos) - DoneDid I miss anything?
The text was updated successfully, but these errors were encountered: