-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warnings for function ncore #736
Comments
In GitLab by @stuartmuldrew on Jul 10, 2018, 13:12 created branch |
In GitLab by @stuartmuldrew on Jul 10, 2018, 14:09 mentioned in commit 90f7ddd5ddac024534591074ee09ef7a2b9d4003 |
In GitLab by @stuartmuldrew on Jul 10, 2018, 14:44 mentioned in commit 18af683e2aa401094b5940ef73071087d3c9cdc1 |
In GitLab by @stuartmuldrew on Jul 10, 2018, 17:01 mentioned in commit e9a3810ba87f8859447297072f733a9322d0008a |
In GitLab by @mkovari on Jul 17, 2018, 11:51 I don't think it should be possible for the central density to be less than the pedestal density unless the density profile exponent has a silly value. Is there a bug in |
In GitLab by @stuartmuldrew on Aug 24, 2018, 09:07 The equation for the core density is given by: ncore = 1.0D0 / (3.0D0*rhopedn**2) * ( &
3.0D0*nav*(1.0D0 + alphan) &
+ nsep*(1.0D0 + alphan)*(-2.0D0 + rhopedn + rhopedn**2) &
- nped*( (1.0D0 + alphan)*(1.0D0 + rhopedn) + &
(alphan - 2.0D0)*rhopedn**2 ) ) I guess if the pedestal density is set to be very high in the input compared to the volume averaged, then the core density can end up low. I've added the warning so maybe this will inform the user not to do that. The reference for that equation is the Johner (2011) HELIOS paper, however it doesn't appear in that form. In the paper the central density is written in a very convoluted way. |
In GitLab by @stuartmuldrew on Oct 9, 2018, 16:03 Attached is Hanni's Mathematica file ped_averages.nb |
In GitLab by @mkovari on Oct 10, 2018, 08:50 Can you attach this file as an image? |
In GitLab by @stuartmuldrew on Oct 24, 2018, 16:59 Unfortunately that is the only file Hanni could find and I don't have access to Mathematica to run it. Is there a machine with Mathematica installed? |
In GitLab by @mkovari on Oct 24, 2018, 17:05 Not that I know of |
In GitLab by @skahn on Jun 10, 2019, 11:46 Hi all Investigation resultsIt is really possible for Hanni's formula to be right and the issue to be caused by the fact that the It appears that even though raising the flag and the appropriate action is commented in the terminal : Proposed solutionsIt seems that all of these problems comes from the fact that the pedestal and the separatrix densities are defined in a different than the average density value :
In this situation, the pedestal densities can be set at a relatively high value while the average densities are free to vary to lower values, causing from time to time negative central densities.
Solution 1The constraint or the warning check is performed with the initial value of neped. If the neped is set with the greenwald fraction, the defauld PROCESS value is used for the test : 0.4E20. The solution would be to have a dynamic boundary setting for the average density, by the structure of the code is currently not adapted to this. The solution 3 therefore may be better for now. Solution 2 proposalIf solution 2 is proposed, it can be parametrized as
All the three would be set as exact values or iteration variables, with properly defined limit ranges Solution 3This is done in a local version, and although this is not perfectly avoiding the negative ne(0) values, it clearly improves the situation Cheers Seb |
In GitLab by @jmorris-uk on Jul 17, 2019, 18:03 removed milestone |
In GitLab by @skahn on Jul 29, 2019, 09:24 This has lead to a contraint, we can close this issue. |
In GitLab by @skahn on Jul 29, 2019, 09:24 closed |
In GitLab by @mkovari on Jul 29, 2019, 09:26 Hi Seb, |
In GitLab by @skahn on Jul 29, 2019, 09:28 I am saying that action has been taken (solution 1), and fully implemented in PROCESS develop. |
In GitLab by @jmorris-uk on Jul 30, 2019, 14:06 Constraint implemented as constraint number 81. See attached image. Constraint enforces |
In GitLab by @mkovari on Jul 30, 2019, 14:08 I assume that you have since changed the pasted comments in the code. |
In GitLab by @jmorris-uk on Jul 30, 2019, 14:30 ... as of 5 seconds ago. |
This problem raised its head again in December 2022:The graph shows ncore as a function of nsep, for different values of nped. n.0 is greater than n.av except when n.ped=n.av The whole problem arises because we have the option of setting n.ped and n.sep in terms of the Greenwald density, but we don’t do the same with n.av. You may notice that my paper doesn’t give any references for this formula, but I don’t know why. We may need to ask Hanni for the reference. I though the reference might be the attached paper. However, the formula there looks very different: |
This issue was originally raised by Stuart but it doesn't seem that Seb fixed it fully since Jon discovered the same problem in December 2022. I have reopened it, leaving it as an issue (rather than a discussion) as it is a bug rather than a feature request. @jonmaddock @jmorris-uk |
I have made a quick plotting tool that allows all of the profile and pedestal values to be played around with so that it is easier to see how the negative central density problem comes about. A quick look from a file that presents such warnings shows that raising the lower limit of A possible quick fix solution would be just to warn the user to raise the lower limit of |
Can you suggest a value for the lower bound of Also recommend that people use constraint number 81. |
@mkovari Will also have a look at the |
So can you suggest the lower bound as a fraction of the expected value of I definitely don't like the 1E-6 kludge. |
Two possible solutions at the moment, one quick fix and one long term Quick Fix Long term |
Qick fix - yes, so what lower bound do you suggest? Other options
You pointed out that we often want to match a published scenario with specified volume-averaged density, so this option may not be ideal. However, it is certainly an option, and if we really want to we could add a constraint for a specified value of
|
We do already have a check at initialisation: PROCESS/source/fortran/initial.f90 Lines 431 to 436 in a422025
This prints the following messages: "no": 154,
"level": 2,
"message": "CHECK: neped set with fgwped without constraint eq 81 (neped<ne0)"
"no": 155,
"level": 2,
"message": "CHECK: dene used as iteration variable without constraint 81 (neped<ne0)" |
Compare this density issue with a similar problem that can arise with temperature, for which we do have a check at initialisation that actually changes the value of PROCESS/source/fortran/initial.f90 Lines 384 to 410 in a422025
|
It is true that there are papers claiming that stable H mode can be obtained as long as ne,sep ≤ nGW/2. However, this is the outer midplane density. I don't think this is representative of the average density over the separatrix. This is not something we have ever discussed, really. But if you need to then obviously go ahead and make sure the default bounds are high enough to permit the regression test to run without modification. As you recall there are several other options available. |
In GitLab by @stuartmuldrew on Jul 9, 2018, 08:32
The function ncore in plasma_profiles.f90 calculates the central density of a pedestal profile, however there is currently no warning if the central density is less than the pedestal density. Additionally, under certain situations it returns a negative central density without stopping. I will add a warning to the error list.
The text was updated successfully, but these errors were encountered: