TOQ Equilibrium Mode and Profile Parametrization



Equilibrium Mode

Parameters: equiltype (qsolver), jbs (false)

To solve the Grad-Shafranov Equation, two flux functions must be specified (see References). TOQ allows three major modes (specified by the equiltype namelist variable) depending upon which two flux functions are used:

(1) equiltype='qsolver'
Specify p' and q
(2) equiltype='ffprime'
Specify p' and ff'
(3) equiltype='jdotb'
Specify p' and (j.b)
There are two important submodes for equiltype='jdotb'
(3.1) jbs-.false.
No bootstrap current
(3.2) jbs-.true.
Include bootstrap current

For each flux function, several ways are used to parameterize the profile as described below.


Pressure Profile Parameterization

Subroutine: psetup

TOQ allows five different ways to parameterize the pressure profile. The parametrization chosen is given by the modelp namelist variable.

(1) Exponential parameterization (modelp=1)
Parameters: ncent, nedge, nexpin, nexpout, tcent, tedge, texpin, texpout, rcent, redge, rexpin, rexpout
         xpsi=scaled poloidal flux ranging from 0 on axis to 1 at edge
            nval=(ncent-nedge)*(1.-xpsi**nexpin)**nexpout+nedge
            tval=(tcent-tedge)*(1.-xpsi**texpin)**texpout+tedge
            rval=(rcent-redge)*(1.-xpsi**rexpin)**rexpout+redge
         g_0=rval/(2.*tval)
         p(R,psi)=nval*tval*exp(((R/Raxis)**2-1.)*g_0)
(2) dskeqdata (modelp=2)
Read pprime in from dskeqdata
(3) Polynomial parameterization (modelp=3)
Parameters: nppcoef, ppcoef
            do j=1,nppcoef
               p_0prim(i)=p_0prim(i)+ppcoef(j)*xpsi**(j-1)
               p_0(i)=p_0(i)+ppcoef(j)*(xpsi**j-1.)/float(j)
            end do
            do j=1,nrotcoef
               g_0(i)=g_0(i)+rotcoef(j)*xpsi**(j-1)
               g_0prim(i)=g_0prim(i)+(j-1)*rotcoef(j)*xpsi**(j-2)
            end do
(4) Other parameterization (modelp=4)
Parameters: alp4, bp4, gamp4, cp4, sigp4, a04, d4
Note: a04 and d4 are used for modelf=4 as well
      p_0prim(i)=-bp4*jff4*((1.-xpsi**alp4)**gamp4*
     $           (1.+cp4*xpsi**alp4)+
     $           sigp4*xpsi/(1.+((xpsi-a04)/d4)**2))/(4.*pi)
(5) Spline version (modelp=5)
Parameters: xppspline, ppspline, nppsline: xppspline is normalized poloidal flux
         call spline(xppspline,ppspline,nppspline,-1.e30,-1.e30,
     $        y2coeff)


q Profile Parameterization

Subroutine: qsetup

TOQ allows three different ways to parameterize the q profile when equiltype='qsolver'. The parametrization chosen is given by the modelq variable.

(1) Other parameterization (modelq=1)
Parameters: qax, qaxp, qlim, qlimp, iqval, alphaq, gammaq, jlimzero
Note: setting jlimzero=1 makes code adjust qlimp to get ffprime=0 at edge
         iqval.lt.0 (roughly gammaq 0:1 determines crossover between
            alphaq dependence and alpha=2 dependence)
            alphaq=(qlimp-qaxp-2.*(1-gammaq)*(qlim-qax-qaxp))/
     >           (gammaq*(qlim-qax-qaxp))
         otherwise alphaq specified on input
         if(iqval.le.0) qval=(qv2*xv+qv1)*xv+qv0+qv3*xv**alphaq
         else           qval=qax+(qlim-qax)*xv**alphaq
(2) dskeqdata (modelq=2)
Read q profile in from dskeqdata
(3) Spline version (modelq=3)
Parameters: xqspline, qspline, nqspline, qpaxspline, qplimspline
         call spline(xqspline,qspline,nqspline,qpaxspline,
     $        qplimspline,qpp)


f Profile Parameterization

Subroutine: sigset

TOQ allows three different ways to parameterize the f profile when equiltype='ffprime'. The parametrization chosen is given by the modelf variable.

(1) Polynomial parameterization (modelf=1)
Parameters: ffpcoef,nffp
            do i=1,npsi
               xx=xval(i)
               temp1=ffpcoef(1)
               do j=2,nffp
                   ffp(i)=ffp(i)+ffpcoef(j)*xx**(j-1)
               end do
            endif
        integrate ffp to get f with boundary condition f(npsi)=rzero*baxis0
(2) dskeq (modelf=2)
Read q values from dskeqdata
(3) Other (modelf=4)
Parameters: jff4,aj4,gamj4,sigj4,a04,d4,bp4
Note: a04,d4 and bp4 are used in modelp=4 as well
            do i=1,npsi
               xx=xval(i)
               fp(i)=jff4*((1-xx**aj4)**gamj4+
     $              sigj4*xx*(1-xx)**2/(1.+((xx-a04)/d4)**2))*(1.-bp4)
            end do
        integrate ffp to get f with boundary condition f(npsi)=rzero*baxis0


JdotB Profile Parameterization

Subroutine: sigset

TOQ allows only one way to parameterize the JdotB profile when equiltype='jdotb'.

Parameters: ncdcoeff (2),cdcoeff,cdx (0.5),cddelx (0.02),cdlocbump (1. e10),cdwidthbump (1), bavcd (0)

do j=1,ncdcoeff+1
cdcoeff(j)=(bavcd+(1.-bavcd)*gamma)*cdcoeff(j)
end do
do i=1,npsi
xx=xval(i)
temp1=cdcoeff(1)
do j=2,ncdcoeff
temp1=temp1+cdcoeff(j)*xx**(j-1)
end do
temp1=temp1+ cdcoeff(ncdcoeff+1)*xx*(1-xx)**2
$ /((1.+((xx-cdlocbump)/cdwidthbump)**2))
cd(i)=temp1*0.5*(1.-tanh((xx-cdx)/cddelx))
end do

Bootstrap Options(for when jbs=true)

Subroutine: sigset

cboot (1.0)
zeff (1.5)
gamboot (0.5)
ifillboot (0)
jbjratio (1)
jbtype ('separate')