Extended capabilities of time-dependent ELM transport model and neoclassical transport model; Added several fields to b2time.nc #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains all the modifications that I coded for
B2.5in the last months. Whereas they were aimed to my own current research, I coded everything in such a way to make it as general as possible and "ready" to be painlessly merged to the codebase. I have done the equivalent code modifications also for therelease/3.1.1branch. As soon as this PR will have gone through, I will create one also for that branch, already containing any new further modifications which will be suggested during the review of this PR. TheB2.5documentation has been updated accordingly, and new conversion rules (when needed) have been also implemented.The new code is fully working and functional (as I have been using it for several months already). As such, this PR is, from my side, ready to be reviewed.
The changes consist in:
Extension of the capabilities for simulating time-dependent ELM events. The modifications are based on the already existing possibility to define ELM transport profiles in
b2.transport.inputfile(through thetdata(3,:,:,:)fields). However, so far only a periodic step increase of the transport coefficients was possible (which also had to be the same for all the coefficients). Now:b2.transport.inputfile.b2.transport.inputfile. All changes are fully backwards-compatible, so the old ELM model could be still used as it was.Added flexibility (and improved output) when invoking the neoclassical transport model via
b2tqna_user_transport=8. Now:NEOART-calculated transport contributions only to a subset of all the possible radial transport coefficients (particle diffusivity/convective velocity, electron/ion thermal diffusivities, etc.), via the switchesb2tqna_neoclassical_xxx(withxxx=dna,vla,hci,hvi,hce,hve), and only to a given range of the computational grid within the confined region, via the switchesb2tqna_neoclassical_iystart/end, and only to a subset of all theB2.5fluid species, through the logical arrayNEO_NS_SETof size (0:NS-1) within the new namelistb2.neoclassical_transport.parameters.B2.5time steps, through the new switchb2tqna_neoclassical_time_steps(default = 1). When they are not re-calculated, the previously calculated ones are used. Note that, for now, the switch works as intended only when bothb2mndt_nstg0andb2mndt_nstg1are 1, while it works also for multiple 2nd level iterations. I have not found a satisfactorily solution for a more general case so far, because of the additional instances in whichb2tqnais called in case of multiple inner iterations (sinceb2tqnais called 2+nstg2times perB2.5time step ifnstg0/1= 1, I could code a solid rule for this case; however I was not able to understand the rule setting how many times perB2.5time stepb2tqnais called ifnstg0/1> 1). A better solution might be therefore desirable.NEOART(all of them, not only those really added to the B2.5 radial transport coefficients) to a newb2neo.ncoutput file at each of its calls.Added the time-dependent anomalous transport cofficients fields on the B2.5 grid as additional output in
b2movies.ncAdded several additional quantities to
b2time.nc, in particular with regards to multi-species quantities and Eirene-related quantities. Namely (the below list may be not exhaustive):nasep(m/a/i)), atomic/molecular densities from Eirene (d(a/m)bsep(m/a/i)), atomic/molecular temperatures from Eirene (t(a/m)bsep(m/a/i)). The corresponding averaged time traces and standard deviation time traces are also included.na3d(i/a/r/l)), atomic/molecular density profiles from Eirene (d(a/m)b3d(i/a/r/l)), atomic/molecular temperature profiles from Eirene (t(a/m)b3d(i/a/r/l)). MODIFIED fields are midplane transport coefficients profiles (dn3d(a/i),vx3d(a/i),vy3d(a/i),vs3d(a/i)) and target particle flux profiles (fn3d(a/i)), which now contain the data for all fluid species, not only for the main ion. Note that for the target quantities, also the additional fields for case of DN geometries have been added/modified).jxi,jxa,jsep), radial coordinates (dsi,dsa,dsr,dsl), target areas (dsR,dsL) and poloidal contact areas (dsRP,dsLP) are outputted tob2time.nc. Again, the additional coordinates for DN geometries are also included.b2mod_mwtialso outputs the above mentioned coordinates and areas to the run directory on ASCII files named in the same way as the coordinate/area. On case-insensitive file systems (e.g. one one present by default on MacOS computers) this would create problems, because e.g. the strings "dsr" and "dsR" are interpreted as identical. I have therefore added a safety, thanks to which the code detects if this is the case, and, only in this case, the target areas are insted outputted to files nameddsRTanddsLT, to avoid this problem. For case-sensitive systems (e.g. all Linux distributions), the output is unchanged. Again, same for additional areas in case of DN geometries.b2mod_mwtiwill have been rolled out, appending fields inb2time.ncover data from previous runs (viab2mndr_stim< 0.0) will not be possible anymore, namely a newb2time.ncwill need to be created.