14SUBROUTINE belicu(torcur, bx, by, bz, cos1, sin1, rp, zp)
18 use abscab,
only: magneticfieldpolygonfilament
22 REAL(rprec),
INTENT(in) :: torcur
23 REAL(rprec),
DIMENSION(nuv2),
INTENT(in) :: cos1, sin1, rp, zp
24 REAL(rprec),
DIMENSION(nuv2),
INTENT(out) :: bx, by, bz
26 REAL(rprec) :: current
27 INTEGER :: i, j, kper, kv
29 REAL(rprec) :: L, Ri, Rf, Ri_p_Rf, Bmag
30 REAL(rprec),
dimension(3) :: dvec, xpt, Ri_vec
32 real(rprec),
dimension(3, nuv2) :: eval_pos, magnetic_field
36 logical,
parameter :: use_abscab_for_axis_current = .false.
50 xpts(1, i) =
raxis_nestor(kv)*(cosper(kper)*cosuv(kv) - sinper(kper)*sinuv(kv))
51 xpts(2, i) =
raxis_nestor(kv)*(sinper(kper)*cosuv(kv) + cosper(kper)*sinuv(kv))
61 if (use_abscab_for_axis_current)
then
65 eval_pos(1, j) = rp(j) * cos1(j)
66 eval_pos(2, j) = rp(j) * sin1(j)
67 eval_pos(3, j) = zp(j)
71 magnetic_field = 0.0_dp
74 call magneticfieldpolygonfilament(nvper * nv + 1,
xpts, current, &
75 nuv2, eval_pos, magnetic_field)
77 bx(:) = magnetic_field(1,:)
78 by(:) = magnetic_field(2,:)
79 bz(:) = magnetic_field(3,:)
99 xpt(1) = rp(j) * cos1(j)
100 xpt(2) = rp(j) * sin1(j)
103 ri_vec = xpt -
xpts(:,i)
105 rf = norm2(xpt -
xpts(:,i + 1))
109 bmag = 1.0e-7_dp * current * 2.0_dp * ri_p_rf / ( ri * rf * (ri_p_rf*ri_p_rf - l*l) )
112 bx(j) = bx(j) + bmag * (dvec(2)*ri_vec(3) - dvec(3)*ri_vec(2))
113 by(j) = by(j) + bmag * (dvec(3)*ri_vec(1) - dvec(1)*ri_vec(3))
114 bz(j) = bz(j) + bmag * (dvec(1)*ri_vec(2) - dvec(2)*ri_vec(1))
subroutine belicu(torcur, bx, by, bz, cos1, sin1, rp, zp)
Magnetic field due to net toroidal current modeled by a filament along the magnetic axis.