Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

labeling of PF coil currents in the code #3086

Open
vinay-289 opened this issue Mar 5, 2024 · 2 comments
Open

labeling of PF coil currents in the code #3086

vinay-289 opened this issue Mar 5, 2024 · 2 comments

Comments

@vinay-289
Copy link

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
Copy link
Collaborator

mkovari commented Mar 6, 2024

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
Copy link
Collaborator

mkovari commented Mar 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants