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

Questions for iterable variables and changing variables #3293

Closed JaeBeom1019 closed 1 week ago

JaeBeom1019 commented 3 weeks ago

Hello!

I have a few simple questions about using the process.

I'm a bit confused about 'which variables are iterable and which are not' and also 'which variables are changing and which are not'. I understand that only the variables listed in lablxc (about 172 in total) can change during the code execution. However, I'm encountering a situation that I don't quite understand.

For instance, the input values ptrepv and ptripv (transport power per volume) and pradpv, pcoreradpv (radiation power per volume) are initialized to 0.0D0 in physics_variables.f90. This would mean that the total power (the sum of transport power and radiation power) should be zero, even when icc=2 is turned on.

From this, I infer that the variables listed in lablxc are used for iteration, while other variables in physics_variables.f90 are updated according to the iterating variables.

Could you please confirm if my understanding is correct? If it is, could you also explain how I can check the results of the variables listed in physics_variables.f90? (I couldn't find the result of ptrepv, ptripv, pradpv, pcoreradpv in MFILE)

Thank you!

mkovari commented 3 weeks ago

Hi JaeBeom,

You are correct that any variable that is not an iteration variable can be updated by the code in the physics and engineering routines. These variables are usually initialised to zero. The iteration variables are only updated by the optimiser.

Not every variable is output - some are just intermediate quantities. For example, ptrepv is multiplied by the plasma volume to obtain the total electron transport power ptremw, which is then output:

Electron transport (MW)                                    (ptremw)                  1.593E+02  OP 

When looking at the results it is best to read through the OUT.DAT first, searching for relevant terms in English. Looking for variables that you have seen in the code can be frustrating as they can be passed as an argument into a function (or subroutine) in which they have a different name, or used as an intermediate as in the example above.

JaeBeom1019 commented 3 weeks ago

Thanks for your reply!

.

Let me ask a one more question about constraint_equation.f90.

line 1986 in constraint_equation.f90: !! q : safety factor 'near' plasma edge: equal to q95

I cannot understand that line because q is not same with q95 in OUT.DAT

.

And I also found some wrong descriptions about variables in constraint_equation.f90. This issue is quite trivial but I hope it would be helpful for your code!

line 1103 in constraint_equations.f90: !! mvalim : input real : TF coil outboard leg resistive power (MW) should be fixed into !! mvalim : input real : maximum TF coil MVA limit (MW)

line 1136 in constraint_equation.f90: !! rtanbeam : input real : ratio of collision length / connection length should be fixed into !! rtanbeam : input real : neutral beam centreline tangency radius (m)

mkovari commented 3 weeks ago

I am afraid the q notation is not very consistent in the code. The OUT.DAT, however, is consistent as far as I know. Three different q values are output:

 Safety factor on axis                                     (q0)                          2.830     
 Safety factor at 95% flux surface                         (q95)                         5.816  ITV
 Cylindrical safety factor (qcyl)                          (qstar)                       3.461  OP 

Thanks for pointing out the copy-paste errors in constraint_equations.f90. I will put them into a new issue.

JaeBeom1019 commented 1 week ago

Thank you for your comment!