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

Odd output when iblanket=4 and secondary_cycle=2 #1444

Closed jonmaddock closed 1 year ago

jonmaddock commented 3 years ago

In GitLab by @pc6783 on Oct 28, 2021, 17:27

I received this email from another PROCESS user at PPPL:

At one point, I did a run with iblanket=4 (KIT HCLL blanket model) and secondary_cycle=2 (required for iblanket=4). In the .OUT file, the report titled "Pumping power for Inboard blanket" was printed more than 250 times. I'm not exactly sure what's causing this, but it must be somewhere in the "pumppower" function of hcll.f90.

Here's an input file which exhibits the problem: iblanket4_IN.DAT

And here is the output that he got: iblanket4_OUT.DAT

jonmaddock commented 2 years ago

In GitLab by @js0164 on Feb 15, 2022, 15:42

This printing is a result of user input error in combination with errors in the code.

For particular blanket (or related) switch combinations, conditions are met which trigger write_output in the KIT HCLL module. I am working on removing the blkttype and blktmodel switches from PROCESS (#1537). I will also change the conditional use of write_ouput to printing an error message.

The blanket (or related) switches used in iblanket4_IN.DAT by the user are as follows:

The user has set the iblanket value to KIT HCLL but the blkttype value to HCPB. Correction to iblanket4_IN.DAT: blkttype = 2 (assuming they want the HCLL model since issue title contains iblanket=4).

The user has set the ipowerflow switch to the pre-2014 version of the powerflow model this means that the wrong calculations are being used in fispact.f90 and costs.f90. Correction to iblanket4_IN.DAT: ipowerflow = 1 (for HCLL).

The user has chosen not to have an IB blanket, iblnkith = 0, and so blnkith=0.0. The user has also not entered a values for primary_pumping (=2 default).

primary_pumping = 2 means that 'Mechanical pumping power is calculated', i.e., thermo_hydraulic_model is being called. However, the thermo_hydraulic_model submodule, and the pumppower function within the submodule, both use the blnkith variable and do not allow for it to have a value of 0 (the write_ouput calls are in the pumppower function).

Temporary Correction to iblanket4_IN.DAT: primary_pumping = 0, 'User sets mechanical pumping power directly (primary_pumping_power). Values of htpmw_blkt, htpmw_div, htpmw_fw, htpmw_shld set in input file.'

The rest of the KIT HCLL module (including the blanket_composition and neutronics submodules) can use blnkith with a value of 0.

blnkith = 0.0 may also cause issues in machine_build.F90 and so using primary_pumping = 1 is not currently a suitable option when there is no IB blanket for a HCLL model (since it uses the fwarea variable, which is calculated using hfw, which is calculated using hbot, which is calculated using blnktth, see issue #1567).

I will make the necessary changes to thermo_hydraulic_model and machine_build to allow for blnkith with a value of 0.

jonmaddock commented 2 years ago

In GitLab by @pc6783 on Feb 15, 2022, 16:56

@js0164 thank you for the fixes on the code side. I'll talk to the user regarding fixes to their input file. You can set your MR to close this issue as well as #1567.

jonmaddock commented 2 years ago

In GitLab by @js0164 on Feb 21, 2022, 14:13

closed