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
30 stars 11 forks source link

Poloidal field null, delete pfjalw, fix temp margin #205

Open jonmaddock opened 9 years ago

jonmaddock commented 9 years ago

In GitLab by @mkovari on Feb 25, 2015, 10:50

1 Diagnostic for poloidal field null

PROCESS calculates the PF coil currents required to create a poloidal field null on the midplane for plasma initiation. This is a complicated calculation and happens suspiciously quickly! I have added an output to OUT.DAT of the field at all the points on the midplane where it is supposed to be null, active when verbose = 1.

The code is in pfcoil.f90, following ! Find currents for plasma initiation to null field across plasma.
This sets the field to zero at the 32 test points, and calls subroutine efc to determine the currents.

I put the actual fields calculated in subroutine rsid in module-level arrays br_actual and bz_actual. When the null is calculated these are copied to null_br and null_bz, and these are only output if verbose = 1. I have put the output of the "smoothing parameter" in the same section, and commented out the printing of the very unhelpful normalised sum of squares.

I have run one test file, and have reasonable results:

 Residual fields at equi-spaced points on midplane during null for plasma initiation [T] (radial, vertical):

  2.8E-17 -5.6E-17 -8.3E-17  5.6E-17 -2.8E-17  0.0E+00 -2.8E-17  0.0E+00 -8.3E-17 -2.8E-17 -2.8E-17  0.0E+00 -2.8E-17 -5.6E-17  0.0E+00 -2.8E-17 -2.8E-17  0.0E+00 -2.8E-17 -5.6E-17 -2.8E-17 -2.8E-17 -2.8E-17 -2.8E-17 -4.2E-17 -1.4E-17 -2.8E-17 -2.8E-17  0.0E+00 -1.4E-17 -1.4E-17 -4.2E-17
 -4.7E-03 -2.9E-03 -1.5E-03 -2.9E-04  6.3E-04  1.3E-03  1.8E-03  2.1E-03  2.2E-03  2.2E-03  2.0E-03  1.8E-03  1.5E-03  1.1E-03  7.0E-04  2.9E-04 -1.2E-04 -5.0E-04 -8.4E-04 -1.1E-03 -1.4E-03 -1.5E-03 -1.6E-03 -1.6E-03 -1.4E-03 -1.2E-03 -8.9E-04 -4.5E-04  8.8E-05  7.3E-04  1.5E-03  2.3E-03
 maximum residual radial field [T] :                                                                5.551E-17
 maximum residual vertical field [T] :                                                              2.300E-03
 Smoothing parameter                                                      (alfapf)                  5.000E-10

2 Deleted function pfjalw as it is no longer used (and delete the commented-out calls to it).

3 subroutine ohcalc lines 919 etc

! Allowable coil overall current density at EOF
call superconpf(bmaxoh,vfohc,fcuohsu,abs(ric(nohc))/awpoh, &
! Allowable coil overall current density at BOP
call superconpf(bmaxoh0,vfohc,fcuohsu,abs(ric(nohc))/awpoh, &

These two calls refer to different time points, but they use the same current, which doesn't seem right:
ric(ngc2) : peak current in coil i (MA-turns)

I have replaced these current densities (winding area density) by

abs(coheof)*areaoh/awpoh
and
abs(cohbop)*areaoh/awpoh

I am a bit puzzled why this wasn't done in the first place.

Oddly, the temperature margin for the CS drops by about 1 K.

jonmaddock commented 9 years ago

In GitLab by @mkovari on Feb 25, 2015, 15:45

See attached pfcoil_204.f90

mkovari commented 5 months ago

I was about to close this issue since it seemed to have been completed, when I realised that the code seems to have jumped back to its previous state for some reason. Item 3 above replaced the peak current densities by the actual current densities for each time point (EOF and BOP). However, the python code now uses the peak current densities again! In other words, the two functions calls use identical arguments except for the field:

        if pfv.ipfres == 0:
            # Allowable coil overall current density at EOF
            # (superconducting coils only)

            (jcritwp, pfv.jstrandoh_eof, pfv.jscoh_eof, tmarg1,) = self.superconpf(
                pfv.bmaxoh,
                pfv.vfohc,
                pfv.fcuohsu,
                (abs(pfv.ric[pfv.nohc - 1]) / pfv.awpoh) * 1.0e6,
                pfv.isumatoh,
                tfv.fhts,
                tfv.str_cs_con_res,
                tfv.tftmp,
                tfv.bcritsc,
                tfv.tcritsc,
            )

            pfv.rjohc = jcritwp * pfv.awpoh / pfv.areaoh

            # Allowable coil overall current density at BOP

            (jcritwp, pfv.jstrandoh_bop, pfv.jscoh_bop, tmarg2,) = self.superconpf(
                pfv.bmaxoh0,
                pfv.vfohc,
                pfv.fcuohsu,
                (abs(pfv.ric[pfv.nohc - 1]) / pfv.awpoh) * 1.0e6,
                pfv.isumatoh,
                tfv.fhts,
                tfv.str_cs_con_res,
                tfv.tftmp,
                tfv.bcritsc,
                tfv.tcritsc,
            )

PROCESS/process/pfcoil.py

For context, the current density is obviously not required to calculate the allowable current density. superconpf uses it to derive the temperature margins (tmarg1 and tmarg2).

Can anyone cast any light on this? @ajpearcey @jmorris-uk @timothy-nunn @ym1906 I am a bit worried that the answer will be no.

mkovari commented 5 months ago

Item 1 (Diagnostic for poloidal field null) also seems to have disappeared from the code. Obviously someone was very lax about making sure that his/her code actually got incorporated into the reference version.

stuartmuldrew commented 3 months ago

PF coils to be looked at in WPDES later this year. Reassigned to @ajpearcey