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

plasmod.f90 #644

Closed jonmaddock closed 1 year ago

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 07:27

please consider this file and now it is consistent with PLASMOD @hlux @kellis plasmod.f90

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 07:30

sorry, this one plasmod.f90

I removed all the checks, I mean I dont understand, do we use PLASMOD, or do we use PROCESS 0D ? Because now it is like a mix and it is not consistent

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 07:30

impurity enrichment I commented and put 20.d0, but you can put it back, also please explain how is this defined from the input file

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 07:56

impurity_enrichment is an input array. Please use impurity_enrichment(9) for Argon. Just commeting out error handling is not really a suitable approach. I purposefully put those checks in to make sure we understand your outputs. Please provide us with more documentation on those values, if they differ from our standard values.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:05

ok so I simply write

impurity_enrichment(9) = 20.d0

in the input file ?

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:06

and for the checks, then how can we make it work if now it stops because the values are different?

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:08

Yes that's right instead of plasmod_c_car = 20.d0 just write impurity_enrichment(9) = 20.d0

Well, please send me your documentation of these values and then we can understand how they differ, why they differ and clearly label in the output what those values mean rather than pretend they are the same.

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:10

At the current stage it would be sufficient for us to document those values in this issue, if you have no separate document where they can be written. You can use markdown and include pictures, if you have e.g. integral formulae from a Latex file somewhere.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:11

ok now I go through the checks and tell you where the values come from

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:15

falpe and falpi are computed in PLASMOD consistently with profiles and critical energies, so please comment these lines falpe = 0.88155D0 exp(-tepc/67.4036D0) falpi = 1.0D0 - falpe

because later on they are assigned from PLASMOD.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:16

I mean all these are 0D formulas, yhile PLASMOD is 1D. isnt this the whole point of this work? If we try to force 1D to agree with 0D, we fail miserably. So, could you revert back to how it was before? We use PLASMOD results for all this stuff.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:17

if you want to enforce 0D results to match 1D, I tell you, we will never go anywhere.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:20

the only quantities which are missing from PLASMOD, and I can fill them, are :

dlamee dlamii zampi znimp afuel abeam zeffai

no problem to add them to PLASMOD output, but please do not use 0D!

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:20

as for the documentation, these are all ASTRA formulas, I can add them here

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:21

si I strongly recommend that we revert back, and simply you add the missing outputs with = 0.d0 and I fill them with PLASMOD outptus, without checks, without 0D. Instead, what we do later on, is to put the impurity formulas IN PLASMOD, so that then the 1D is actually consistent with PROCESS data of Lz and Z. Agree?

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:22

Sorry that falpi and falpe where outputs from PLASMOD, completely slipped by me. As you might have seen those were overwritten by PLASMOD outputs anyway. There was clearly a lot to got through. And I agree those are clearly 1D outputs where the values should be taken from PLASMOD.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:23

yes, and I would do the same for all the others, zeffai, etc. later on, as said, we substitute ASTRA formulas with the PROCESS atomic data. Does this sound reasonable?

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:23

I am pretty sure that a baseline done with PLASMOD-ASTRA formulas, and one done with PROCESS atomic data, will not dramatically differ.

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:27

Well, I did not want to put things in just assuming that they will not differ and not checking. I am amazed that you run into issues with all of these quantities. But lets go through them one by one in stead of having generic discussions.

How come that the helium ion density dnalp is so different from dene*ralpne? I thought this was essentially the definition of ralpne? Why would that differ in PLASMOD?

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:28

After all ralpne is a 0D quantity

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:29

And I assume you did not mean to uncomment the check that deni is never below 0, right? Also for PLASMOD negative densities do not make sense, right? ;-)

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:29

ja in PLASMOD there will never be a negative deni

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:30

ok lets go 1 by 1

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:32

Yes, so how about dnalp?

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:33

in PLASMOD ne and nHe are not fully synchronized since the computation of nHe happens after ne, and the iteration stops when the error is reached. Now I fixed that by simply using the last value of ne to recompute nhe, now the error is machine precision, please pull

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:34

second point?

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:36

ok then all follows because of zimp the problem is: Zav_of_te(impurity_arr(imp),te) this is not equivalent to the ASTRA formulas for the charge of Ar and Xe. That is why I said, please revert to as it was before, and we will plug then later on Zav_of_te and also Lz_of_Te in PLASMOD to get the full 1D profile from te(x)

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:36

Okay, I will pull the new version in a minute. I will leave the check in just to catch bugs in the future. After all both dene and ralpne come from PLASMOD.

The next check is on deni Fuel density (/m3). in PROCESS this is

znfuel = dene - 2.0D0*dnalp - dnprot - dnbeam - znimp deni = znfuel/(1.0D0+fhe3)! Fuel density (/m3)

I assume there is a difference, as you don't take the beam into account? Or maybe the protium is not propagated through??

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:36

ralp is fixed, all the rest is really problematic since zav_of_te is not coincident with ASTRA formulas.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:37

no the problem is zimp

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:37

the average charges come from PROCESS zav of the and this is not as in ASTRA since you have different atomic data

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:37

so, can we please use PLASMOD and later on plug in this ?

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:38

Ah, okay. This is essential. We have on purpose been asked to make your Z dependent on temperature for use of W and Xe, as this really matters there. I agree you currently don't have the data for that. So I will comment out the check for the moment, but in the future this needs to be done properly.

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:42

Yes, okay that clarifies all other parts. I will make the adjustments and push a version that should work for the moment.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:45

I totally agree with you that a releasable version will have to have consistent functions in PLASMOD to make the output consistent with the 0D, in terms of database of atomic data for example. Basically one needs to go through produce_transport and put there these impurity formulas. Another one that I'd like to use from PROCESS is fpion, because for the NBI I now split 50%, but fpion is based on something at least. I suggest to do this after the EPS, because for that conference, I think it is enough to show the coupling and some parameter dependence of the results, without pretense of being like this is the machine we are going to build. this will come later this year.

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:47

Yes, I also agree we don't need to do everything at the beginning. But at least this flagged up the difference in definitions between PLASMOD and PROCESS at the moment, which is important to realise when doing comparisons.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:48

ok

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:53

Sorry just to double check, but dnz the high z impurity density, should be the same in PLASMOD and 0D, right? Again this really is just summing over the impurity fractions*dene.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:53

1 sec I check

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:54

I should have clarified that this is everything with Z > Z(He). So no He or hydrogenic species.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:54

yes, in PLASMOD it it just Ar + Xe

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:55

ah no, actually I also put He, I remove this now

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:56

Okay, great found another inconsistency in definitions! Well, then I hope this is working now.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 08:57

1 sec I will push this and then we try

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 08:59

Okay, sorry, I pushed to early. I will wait for you now.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 09:10

ah ok now I see it yes well in PLASMOD impurities are not fixed concentration, the concentration is just pedestal top to use fixed concentration, use impmodel = 0 now we use 1, which is more realistic, but then formula dnz = dnz + impurity_arr(imp)%frac*dene is not consistent, because it assumes constant conc. I suggest to use radp%av_nz and not this formula because in PLASMOD the concentration of imps is not constant with impmodel = 1 (which is more realistic than constant conc, while for H and He is OK. The reason? Turbulent transport of high-Z makes them flat, while for H and He makes them peaked)

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 09:12

ok pushed

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 09:14

so I pulled yours, is fine, just dnz still to set to false and use radp%av_nz instead

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 09:27

i have put a false and now it runs there is still zeffai which uses zav of te, I can produce it from PLASMOD in case, but is it really used somewhere else?

jonmaddock commented 6 years ago

In GitLab by @hlux on Mar 23, 2018, 09:32

zeffai is used in our current drive routines. One of the reasons why we used the temperature dependent Zeff. And in beamfusion. I will leave our definition for the moment, until you have produced and output from PLASMOD.

jonmaddock commented 6 years ago

In GitLab by @efable on Mar 23, 2018, 09:34

ok