BOUNDARY CONDITIONS IN VMEC !
Calculate
Regardless of the choice of coordinates we have kψ = (dx/dψ) kx kα = (dy/dα) ky hat{s} = -(rho/iota)(diota/drho)
For VMEC we use alpha = theta - iotazeta z = zeta = 2piP = 2pifield_period_ratio = 2pi*nfield_periods/nfp
Standard twist-and-shift boundary conditions
dkpsi/dkalpha * jtwist = 2piP(diota/dψ) = 2piP * (drho/dψ) (diota/drho)
dkx/dky * jtwist = -2pi*P * (dψ/dx) (dy/dα) * (drho/dψ) * hat{s} (iota/rho)
Stellarator symmetric twist-and-shift boundary conditions
dkpsi/dkalpha * jtwist = -2 (∇ψ . ∇α) / |∇ψ|^2 (at the last z-point)
dkx/dky * jtwist = -2 * (dψ/dx) (dy/dα) * (∇ψ . ∇α) / |∇ψ|^2
ALLOCATE TEMPORARY ARRAYS !
DEALLOCATE TEMPORARY ARRAYS !
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nalpha | |||
integer, | intent(in) | :: | naky |