-
Notifications
You must be signed in to change notification settings - Fork 2
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
Better ways to calculate toroidal flux #44
Comments
Right now, |
@zhucaoxiang I attempted to comment out the two lines you suggested and now I get this error:
|
@lazersos Good catch. I haven't used LM for a long while and didn't test it before my commit. Could you please use CG temporarily? I will check what is going on in LM. My personal feeling for LM in FOCUS is that it is more violent than CG. Maybe more efficient but also tends to provide over-optimized results. |
New error with the CG
|
@lazersos It was caused by writing MAKEGIRD format coils for |
@zhucaoxiang I think there are still issues
|
@lazersos The Bnormal is so high. Are the coils intersecting the plasma? |
The currents were zero in the TF/VF set. I set them to a finite value and it appears to be running through. |
When you didn't find errors, you can use |
@lazersos For the background field, try to use |
@lazersos I just push a commit in |
I had a thought of on this problem. You're right that the vector potential for a current carrying wire is infinite but for a solenoid it's well defined. So if we use We just need to change |
Of course there's the fact we need to define rho. |
@lazersos I was thinking to use B dot n ds to calculate the toroidal flux. We can use the phi=0 cross-section where the normal vector is the y-axis. The only headache is that we have to determine which surface element on the x-z plane is inside the boundary. It is workable, but I didn;t find an elegant way to do this. |
@zhucaoxiang Would it work to set A_R=Cz/r. Then Bphi=curl(A) = C1/r? |
@zhucaoxiang or you could use the logarithmic form (https://physics.stackexchange.com/questions/222343/magnetic-vector-potential-of-an-infinite-wire). A_Z=C*ln(r) |
@lazersos The answer upvoted looks reasonable and promising. |
@lazersos I have implemented the formula in toroidal flux. But I didn't fully verify and validate it. Please let me know if you found any bug when using it. |
There is a cost function on the toroidal flux in FOCUS. Instead of calculating B \cdot ds, FOCUS uses the Stokes theorem and calculates A \cdot dl. Details can be found in torflux.pdf.
This works fine with normal coils. Recently, I found that it might be better to use B \cdot ds, because
To use B \cdot ds, one might select the phi=0 cut. I realize that it requires some non-trivial effort to get the toroidal cut. Basically, one needs to check if an arbitrary point on the XZ plane is inside or outside the plasma. This could be solved by counting the winding number or cross number wikipedia.
Here are some questions that we can discuss.
case_bnormal = 1
to optimized B \cdot n / |B|, one can also avoid such a trivial solution. The other good side of using the toroidal flux is to incorporate with equilibrium codes, like VMEC and SPEC. In such codes, the edge toroidal flux is always specified.The text was updated successfully, but these errors were encountered: