-
Notifications
You must be signed in to change notification settings - Fork 90
Make choices of j_parallel and j_toroidal consistent #1489
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
Conversation
|
@jcitrin am I right that the noninductive psi sources are ECCD, bootstrap, and generic current source? Am I missing any? ECCD is field-aligned following #1363. Bootstrap is field aligned by definition? Currently the generic current source is set to provide a fixed toroidal current in A (or fraction of the total current). Would you like this to remain as specifying a toroidal current, or is it ok to silently change it to being the specification of a field-aligned current? Can add to the generic current source either documentation saying it's a <j.B> current or add the conversion from j_tor to <j.B>. |
c500484 to
012eacf
Compare
5275110 to
da2de19
Compare
For now yes. In principle there could be NBI or Lower Hybrid (LH) current sources, but we don't have models for them yet.
Yes, the output of the bootstrap model is <j \cdot B>/B_0 . So its usage in the psi equation is correct. However, what is incorrect is our interpretation elsewhere that it is flux-surface-averaged toroidal current. For example in the output I_p, I_bootstrap, I_ecrh, everything is assumed as toroidal current. In any internal calculations calculating j_ohmic etc., for the initialization stuff, then we assume that all currents are always toroidal. What we need are conversion formulas from <j \cdot B>/B_0 to j_torax = <j_phi / R> / <1/R> , and vice versa. I'll make a separate issue for this (even though it's intimately linked to this issue).
I think the generic current source input description should remain "toroidal current" which is more user intuitive. Then internally we have the conversions to what's need to the psi equation, as discussed. Thanks for being on top of this one! |
|
Cool, I'll implement and test the conversion in #1508 and then hunt down all the places it needs to be converted in here. |
bcc0d44 to
73902ae
Compare
fb132ff to
271e18b
Compare
|
The convention parallel vs toroidal is good. However, we have committed not to make breaking changes to output API until V2. This means that new additions can be made, but name changes cannot. So I recommend having something like j_foo_parallel and j_foo, where j_foo is toroidal, and this is mentioned explicitly in the docs. A TODO for name updates conversion to V2 can be made. |
Turns out JETTO also has inconsistencies in its IMAS outputs with <j.B> vs j_toroidal, so we're fixing that upstream. Once that's sorted, we'll be able to do the comparison easily! |
7c5b36f to
225844a
Compare
943559a to
81e4ce5
Compare
|
@jcitrin ready for internal review. |
|
Great stuff. Yes please squash the commits, I'll then bring it in |
49b2dac to
1dc3223
Compare
5cd2722 to
8d5b46b
Compare
|
@jcitrin thanks for the review comments :) Current density profile plots on STEP for reference: you can see that the js now do all add up to the j_total. Bonus is that j_ohmic is now visibly near zero for most of the core, as expected, so this has knock-on improvements for simulations with vloop BC. On-axis behaviour should be investigated in a follow-up PR.
|
- Add conversion functions to psi_calculations - Compute derivatives manually from face grid values for improved accuracy - Manually extrapolate on-axis values to avoid numerical artifacts - Tested on STEP geometry for grid sizes 25-1000 - Unit test - In outputs: change j_* to be toroidal, and add j_parallel_* - Bootstrap: rename to j_parallel_bootstrap for clarity - Switch psi sources to being <j.B>/B_0 - Regenerate tests
8d5b46b to
86a2f72
Compare


#1459