Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Q
QuaLiKiz
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 28
    • Issues 28
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 0
    • Merge Requests 0
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • QuaLiKiz-group
  • QuaLiKiz
  • Wiki
    • Qlknn
    • Qlknn hyper
  • QLKNN hyper usage

Last edited by Karel van de Plassche Feb 13, 2021
Page history

QLKNN hyper usage

These are the options available to QLKNN fortran. The options are given as a derived data type found in src/core/qlknn_types.f90. All options are also exposed to MATLAB, where they are given by a struct.

option default description
apply_victor_rule false Apply the 'Victor' rotation model in postprocessing
use_ion_diffusivity_networks false True: Return D_i if use_effective_diffusivity = false
False: Return D_e if use_effective_diffusivity = false
use_effective_diffusivity true Return \Gamma_{e}, not separarate Ds and Vs
calc_heat_transport true Return q_i and q_e for all modes (not implemented yet)
calc_part_transport true Return \Gamma_{e,eff}, Ds, and Vs for all modes
use_ETG true Return q_{e,ETG}
use_ITG true Return q_{e,ITG}, q_{i,ITG}, \Gamma_{e,ITG}, D_{i,ITG}, D_{e,ITG}
use_TEM true Return q_{e,TEM}, q_{i,TEM}, \Gamma_{e,TEM}, D_{i,TEM}, D_{e,TEM}
constrain_inputs true Constrain inputs at QLKNN ingestion to set ranges
min_input, max_input, margin_input per net min, max and margin of QLKNN input clipping
constrain_outputs true Constrain outputs after QLKNN calculation, but before merging modes together
min_output, max_output, margin_output per net min, max and margin of QLKNN output clipping

The following debug options are also available, but should not be touched in general. Additionally, the verbosity input is passed from any implementing interface where QLKNN verbosity = interface verbosity - 1

option default description
apply_stability_clipping true Clip all transport if leading flux is <=0
merge_modes true Merge modes together. (e.g. q_{e} = q_{e, ETG} + q_{e, ITG} + q_{e, TEM})
force_evaluate_all false Override all flags, and evaluate and return all fluxes

Flags can be combined in an and-like fashion. For example use_ITG = false use_effective_diffusivity = false and rest default will return q_{e,ETG}, q_{e,TEM}, q_{i,TEM}, \Gamma_{e,TEM}, D_{e,TEM}

QLKNN-10D IO

The call signature of QLKNN-10D is as follows

evaluate_QLKNN_10D(input, nets, qlknn_out, verbosityin, optsin, qlknn_normsin, dqlknn_out_dinput)
argument description shape optional
input Input array to NNs 11xnrho no
nets The networks to be evaluated, see type net_collection in src/qlknn_types.f90 - no
qlknn_out output array of the evaluated networks nrho x nout no
verbosityin verbosity of debug messages - yes, default = 0
optsin Options (described above) to QLKNN - yes, defaults as above
qlknn_normsin normalizations needed for victor rule - yes, mandatory if use_victor_rule = true
dqlknn_out_dinput Jacobian of QLKNN with respect to input vector nout x nrho x 10 yes

nout is the amount of networks if merge_modes = false. The columns are (1)q_{e,ETG}, (2)q_{e,ITG}, (3)q_{e,TEM}, (4)q_{i,ITG}, (5)q_{i,TEM}, (6)\Gamma_{e,ITG}, (7)\Gamma_{e,TEM}, (8)D_{e,ITG}, (9)D_{e,TEM}, (10)V_{t,e,ITG}, (11)V_{t,e,TEM}, (12)V_{c,e,ITG}, (13)V_{c,e,TEM}, (14)D_{i,ITG}, (15)D_{i,TEM}, (16)V_{t,i,ITG}, (17)V_{t,i,TEM}, (18)V_{c,i,ITG}, (19)V_{c,i,TEM}, (20)\gamma_0

if merge_modes = true nout = 10, namely (1)q_{e}, (2)q_{e,ETG}, (3)q_{i}, (4)\Gamma_{e}, (5)D_{e}, (6)V_{t,e}, (7)V_{c,e}, (8)D_{i}, (9)V_{t,i}, (10)V_{c,i}

RAPTOR NOTE: As of legacy (sorry!) in RAPTOR it is: if merge_modes = true nout = 7, namely (1)q_{e}, (2)q_{i}, (3)\Gamma_{e}, (4)D_{e}, (5)V_{e}, (6)D_{i}, (7)V_{i}

Input is not hard-coded, but currently: (1)Z_{eff}, (2)RLT_i, (3)RLT_e, (4)RLn, (5)q, (6)\hat{s}, (7)x, (8)T_i/T_e, (9)\log{\nu^*}, (10)\gamma_{ExB}, (11)T_e, where T_e is only needed if use_victor_rule = true

All in-out quantities are in GyroBohm and/or QuaLiKiz convenient units when applicable.

Conversion from QLKNN to TCI interface

The QLKNN outputs fluxes in QuaLiKiz GB units. The inputs are QuaLiKiz convenient units.

variable definition calculation TCI field
A_{ns} Normalized logarithmic density gradient -\frac{R_0}{n_{s, FSA}} * \frac{dn_{s, FSA}}{dr_{minor}} -
A_{ts} Normalized logarithmic temperature gradient -\frac{R_0}{T_s} \frac{dT_s}{dr_{minor}} -
n_{s,LFS} Density in [m**-3] on LFS midplane - ni_LFS/ne_LFS
n_{s,FSA} Density in [m**-3] Flux Surface Avaraged - ni/ne
T_e temperature in [J] - Te
q_s Heat transport SI (n_{s,LFS} * T_s * \chi_{GB})/a_{ref} * q_{s,NN} heat_fluxes
\Gamma_e Particle transport SI (n_{s,LFS} * \chi_{GB})/a_{ref} * \Gamma_{e,NN} particle_fluxes
\chi_{s, eff} Effective heat diffusivity q_s / (n_{s,FSA} * A_{ts} * \frac{T_s}{R_0}) chieff
V_{s, t, eff} Effective heat pinch q_s / (n_{s,FSA} T_s) -
D_{s, eff} Effective diffusivity \Gamma_{FSA} / (A_{ns} \frac{n_{s, FSA}}{R_0}) deff
V_{s, p, eff} Effective particle pinch \Gamma_{FSA} / n_{s, FSA} -

Note that QuaLiKiz R_0 == R_{0,TCI}, and we don't have heavy impurity 2D effects, so $\Gamma_{FSA} == \Gamma_{asym} == \Gamma$. $aref=Rmin_in(1)$.

Now there are multiple options to get the \chi, V_t, D and V terms for the transport equation solver (TCI chi, Vt, d and Vp respectively)

1. effective flux

If heat_fluxes * A_{ts} > 0 and |A_{ts}| >=0.1:

chi = \chi_{s, eff}

Vt = 0

else (as RAPTOR doesn't have Vt, this is never true in RAPTOR)

chi = 0

Vt = V_{s, t, eff}

Similar for the particle fluxes, if particle_fluxes * A_{ns} > 0 and |A_{ns}| >=0.1:

D = D_{s, eff}

Vp = 0

else (as RAPTOR doesn't have Vt, this is never true in RAPTOR)

D = 0

Vp = V_{s, p, eff}

  1. Using the electron D's/V's

Transport in transport codes

In general it depends on the transport equation being solved which transport coefficients QLKNN has to provide. In jetto this is for all ions and electrons:

TRANSPORT%chi
TRANSPORT%Vt
TRANSPORT%d
TRANSPORT%Vp
TRANSPORT%chimom
Clone repository
  • Background of QuaLiKiz
  • Developer best practices
  • Home
  • Input and output variables
  • Interfacing JETTO with standalone version of QuaLiKiz
  • Numerics of QuaLiKiz
  • Physics of QuaLiKiz
  • Published integrated simulations using QuaLiKiz
  • QLKNN
    • QLKNN hyper
      • QLKNN hyper overview
      • QLKNN hyper testing
      • QLKNN hyper usage
    • QLKNN overview
  • QuaLiKiz regression
  • Running with Pythontools in standalone
  • Scripting with Pythontools
View All Pages