FOCUS
FOCUS copied to clipboard
Better ways to calculate toroidal flux
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
- The subroutine of calculating B can be re-used directly. Thus it would be consistent when we changed the bfield.f90 file.
- The vector potential of an infinitely long current wire is actually infinite Eq. 9.3.5, which means using A-field doesn't work for the toroidal field generated by a current in the center of the torus. (Maybe I am wrong?)
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.
- Do we need to use the toroidal flux constraint? It was imported to avoid trivial solutions of all currents going to zero. By fixing the coil current, specifying non-zero target Bn (e.g. from plasma), or using
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. - Can we use another format of current constraint? It is common to specify the overall toroidal current and poloidal current.
- If we are going to use the toroidal flux and use the B \cdot ds, is there an easier way to integrate B \cdot ds?