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

Incorrect output of TF cable areas [BUG] #3031

Open mkovari opened 7 months ago

mkovari commented 7 months ago

Describe the bug

This output makes no sense:

 Fractions by area
 internal area of the cable space                                         (acstf)                   2.486E-02
 Coolant fraction in conductor excluding central channel                  (vftf)                    5.000E-02
 Copper fraction of conductor                                             (fcutfsu)                 7.500E-01
 Superconductor fraction of conductor                                     (1-fcutfsu)               2.500E-01
 Check total area fractions in winding pack = 1                                                         1.000

It comes from outtf:

                po.ocmmnt(self.outfile, "Fractions by area")
                po.ovarre(
                    self.outfile,
                    "internal area of the cable space",
                    "(acstf)",
                    tfcoil_variables.acstf,
                )
                po.ovarre(
                    self.outfile,
                    "Coolant fraction in conductor excluding central channel",
                    "(vftf)",
                    tfcoil_variables.vftf,
                )
                po.ovarre(
                    self.outfile,
                    "Copper fraction of conductor",
                    "(fcutfsu)",
                    tfcoil_variables.fcutfsu,
                )
                po.ovarre(
                    self.outfile,
                    "Superconductor fraction of conductor",
                    "(1-fcutfsu)",
                    1 - tfcoil_variables.fcutfsu,
                )

The check that is then carried out uses a completely different set of variables:

                po.ovarrf(
                    self.outfile,
                    "Check total area fractions in winding pack = 1",
                    "",
                    (
                        tfcoil_variables.acond
                        + tfcoil_variables.n_tf_turn * tfcoil_variables.acndttf
                        + tfcoil_variables.aiwp
                        + tfcoil_variables.avwp
                        + tfcoil_variables.awphec
                    )
                    / ap,
                )

In fact, acstf is an area, with units m2, not a fraction at all:

real(dp) :: acstf
!! Cable space area (per turn)  [m2]
!! Includes the area of voids and central helium channel

As far as I can tell this is just an output errror, not an error in the calculation.

Steps to reproduce

For example, Charles's STEP output file with negative cable area (attached in the comment below).

Expected behaviour

It is usually best to avoid fractions and use dimensional quantities. We would then expect to see a table of the area of each component of the turn and the total area of the turn.

Additional context

It would be a good idea to fix this if and when steps are taken to prevent the negative area problem arising (see #1709 etc).

@cjwgriesel @timothy-nunn

cjwgriesel commented 6 months ago

I am looking at the magnet dimensions as this is related to the cable pack problem