Calculate the cylindrical (R,Z) at (r,θ) for the generalised elongation model
See section 5.1.2 of Ball Oxford PhD thesis or section 2.1.3 of "GS2 analytic geometry specification"
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(leq_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | r | |||
real, | intent(in) | :: | theta | |||
real, | intent(out) | :: | Rpos | |||
real, | intent(out) | :: | Zpos |
pure subroutine geo_generalizedElongation(self, r, theta, Rpos, Zpos)
implicit none
class(leq_type), intent(in) :: self
real, intent (in) :: r, theta
real, intent (out) :: Rpos, Zpos
real :: dr, thAdj, rCyl, rCylp, Rfinal, Zfinal, Rfinalp, Zfinalp
dr = r - self%surf%r
thAdj = theta + self%thetaShift
rCyl=self%surf%r * (1 &
+ (-1+self%surf%delm/sqrt(1+(self%surf%delm**2-1)*cos(self%surf%mMode*(thAdj+self%surf%thm)/2.0)**2)) &
+ (-1+self%surf%deln/sqrt(1+(self%surf%deln**2-1)*cos(self%surf%nMode*(thAdj+self%surf%thn)/2.0)**2)))
rCylp=1 &
+(-1+(1+(self%surf%delm**2-1)*cos(self%surf%mMode*(thAdj+self%surf%thm)/2.0)**2)**(-0.5)*(self%surf%delm+self%surf%r*self%surf%delmp &
*(1-(self%surf%delm*cos(self%surf%mMode*(thAdj+self%surf%thm)/2.0))**2/(1+(self%surf%delm**2-1)*cos(self%surf%mMode*(thAdj+self%surf%thm)/2.0)**2)))) &
+(-1+(1+(self%surf%deln**2-1)*cos(self%surf%nMode*(thAdj+self%surf%thn)/2)**2)**(-0.5)*(self%surf%deln+self%surf%r*self%surf%delnp &
*(1-(self%surf%deln*cos(self%surf%nMode*(thAdj+self%surf%thn)/2.0))**2/(1+(self%surf%deln**2-1)*cos(self%surf%nMode*(thAdj+self%surf%thn)/2.0)**2))))
Rfinal=rCyl*cos(thAdj)+self%surf%Rmaj
Zfinal=rCyl*sin(thAdj)
Rfinalp=rCylp*cos(thAdj)+self%surf%sHorz
Zfinalp=rCylp*sin(thAdj)+self%surf%sVert
Rpos=Rfinal+dr*Rfinalp
Zpos=Zfinal+dr*Zfinalp
end subroutine geo_generalizedElongation