ukaea / PROCESS

PROCESS is a systems code at UKAEA that calculates in a self-consistent manner the parameters of a fusion power plant with a specified performance, ensuring that its operating limits are not violated, and with the option to optimise to a given function of these parameters.
https://ukaea.github.io/PROCESS/
MIT License
36 stars 11 forks source link

labeling of PF coil currents in the code #3086

Open vinay-289 opened 8 months ago

vinay-289 commented 8 months ago

The variable curpfb is defined as the PF coil current array, at beginning of pulse (MA), while in the module pfcoil.py, it seems to be defined as the current at EOF. Am I interpreting this correctly?

mkovari commented 8 months ago

Hi Vinay, The PF coil currents are labelled in numerous different confusing ways in the code, I am afraid. I will have a look. Michael Kovari

mkovari commented 8 months ago

Vinay is definitely right. The definitions are as follows, where we can read the final letter of each variable name as b=beginning, f=flattop and s=stop(?):

  real(dp), dimension(ngc2) :: curpfb
  !! PF coil current array, at beginning of pulse (MA)
  !! Indexed by coil number, not group number

  real(dp), dimension(ngc2) :: curpff
  !! PF coil current array, at flat top (MA)
  !! Indexed by coil number, not group number

  real(dp), dimension(ngc2) :: curpfs
  !! PF coil current array, at end of pulse (MA)
  !! Indexed by coil number, not group number

The code, however, uses these variables in the opposite time-ordering:

                # Beginning of pulse: t = tv.tramp
                pfv.curpfs[ncl] = 1.0e-6 * pf.ccl0[nng]

                # Beginning of flat-top: t = tv.tramp+tv.tohs
                pfv.curpff[ncl] = 1.0e-6 * (
                    pf.ccls[nng] - (pf.ccl0[nng] * pfv.fcohbof / pfv.fcohbop)
                )

                # End of flat-top: t = tv.tramp+tv.tohs+tv.t_fusion_ramp+tv.tburn
                pfv.curpfb[ncl] = 1.0e-6 * (
                    pf.ccls[nng] - (pf.ccl0[nng] * (1.0e0 / pfv.fcohbop))
                )

This is followed by special code for the central solenoid, which also seems backward:

        # Current in Central Solenoid as a function of time
        # N.B. If the Central Solenoid is not present then ioheof is zero.
        pfv.curpfs[ncl] = -1.0e-6 * ioheof * pfv.fcohbop
        pfv.curpff[ncl] = 1.0e-6 * ioheof * pfv.fcohbof
        pfv.curpfb[ncl] = 1.0e-6 * ioheof

Note that ioheof is the current in the CS at EOF, which is then scaled by the factors fcohbop and fcohbof.

Possibly the use of the final letter "s" has confused the coder.