make_dkeparam_NONUNIFORM10010020

PURPOSE ^

************************************** DRIFT KINETIC CODE PARAMETERS ********************************************

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

************************************** DRIFT KINETIC CODE PARAMETERS ********************************************
******************************************************************************************************************
 Create the local file DKEPARAM_dkeparam_id.mat
 
by Y.Peysson CEA-DRFC <yves.peysson@cea.fr> and Joan Decker MIT-RLE (jodecker@mit.edu)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %************************************** DRIFT KINETIC CODE PARAMETERS ********************************************
0002 %******************************************************************************************************************
0003 % Create the local file DKEPARAM_dkeparam_id.mat
0004 %
0005 %by Y.Peysson CEA-DRFC <yves.peysson@cea.fr> and Joan Decker MIT-RLE (jodecker@mit.edu)
0006 %
0007 clear all
0008 dkeparam.id = 'NONUNIFORM10010020';%Set here the name (identifier) of the drift kinetic code parameters
0009 %
0010 %Mesh size calculation
0011 %
0012 dkeparam.grid_uniformity = 0;%Pitch-angle and momentum grids uniformity: (0) no, (1) yes (-1 for specific test for DKE, transient and pitch-angle grid only)
0013 dkeparam.grid_method = 1;%Pitch-angle grid calculation technique: (0): old method, (1) new method
0014 dkeparam.nmhu_S = 101;%Number of angular values for the flux grid (WARNING: odd number) (>100 recommended for accurate run)
0015 dkeparam.np_S = 101;%Number of momentum values for the flux grid (pnmax/np < 0.1 highly recommended for accurate run) WARNING: must be adjusted so that effective momentum point number is larger than thepitch-angle one.
0016 dkeparam.pnmax_S = 20;%Maximum value of the flux momentum grid (pth_ref)
0017 dkeparam.rho_S = 20;% number of points for radial grid calculation
0018 dkeparam.psin_S = [];% number of points for radial grid calculation
0019 %
0020 %Pitch-angle grid
0021 %
0022 dkeparam.sfac0 = 1; % reduction factor for fine grid near mhu = 0
0023 dkeparam.sfac1 = 1; % reduction factor for fine grid near abs(mhu) = 1
0024 dkeparam.sfact = 1; % reduction factor for fine grid near abs(mhu) = mhut
0025 %
0026 dkeparam.snmhu0 = 1; % number of fine grid points near mhu = 0
0027 dkeparam.snmhu1 = 1; % number of fine grid points near abs(mhu) = 1
0028 dkeparam.snmhut = 1; % number of fine grid points near abs(mhu) = mhut
0029 %
0030 dkeparam.grid_power = 1.5; % power for mhu grid step varations (grid_power > 1) (Note: for grid_method = 1 only)
0031 %
0032 %Momentum grid
0033 %
0034 dkeparam.np_S_ref = 20;%position in the mpomentum grid where dpn_S is twice the minimum value(must be ajusted with snp parameter)
0035 dkeparam.snp = 1;%pgridfactor (Uniform grid: pgridfactor = 1, non-uniform grid: pgridfactor > 1)
0036 dkeparam.spfac = 20;%reduction factor for the momentum supergrid used in collision integrals
0037 %
0038 %Normalized radii at which the distribution is calculated (DKE or FP)
0039 %The syntax rho='all' may be also used if all mhu values are considered.
0040 %
0041 dkeparam.dpsin_dke = 0.01;%maximum difference between two consecutive positions used for radial derivatives
0042 %
0043 dkeparam.ref_mode = 0;%Reference values: (0) from core Te and ne, (1) from Te and ne at the normalized radius (paramater only active for a single radial value, otherwise ref_mode = 0)
0044 %
0045 % Dql and collision operator
0046 %
0047 dkeparam.coll_mode = 2;%No collision operator (space plasmas): (-1), Relativistic collision operator: (0), Relativistic Maxwellian background, (1) High-velocity limit, (2) Linearized Belaiev-Budker (3) Non-relativistic Lorentz model, (4) Non-relativistic Maxwellian background
0048 %
0049 % Ray-tracing and RF waves
0050 %
0051 dkeparam.rt_mode = 0;%RT-DKE power consistency
0052 dkeparam.abs_lim = 0.95;%Relative level of RF power absorption that is accpeted for in the quasilinear convergence loop (0: no threshold, 1: full absorption)
0053 dkeparam.nit_rf = 20;%Maximum number of iteration in ray-tracing. Works only if rt_mode = 1 and more than one radial point (default = 1)
0054 dkeparam.prec_rf = 1e-2;%relative precision in RT-DKE iterations
0055 dkeparam.n_rf_list = 0;%List of harmonics in the Dql calculations
0056 dkeparam.delta_rt = 0;%smoothering parameter of quasilinear iterations
0057 dkeparam.Dparparmax = Inf;%Upper limit of the quasilinear diffusion coefficient. Important for low temperature plasmas et high power level for stability of the code
0058 dkeparam.npresmin = 1;% minimum number of resonant points for each ray and position
0059 dkeparam.nk_abs = 1;%maximum number of iterations on a_sdNpar for full absorption (%%%%%%TODO%%%%%%% for what ?)
0060 %
0061 dkeparam.Nfluct = 1;%-log(sqrt(0.01));%ratio of LUKE to FLUCT time to reset phases (-log(sqrt(tol)) where tol is the tolerance on decorrelation)
0062 %
0063 % Current prescription mode : (nit_ohm > 1)
0064 %
0065 % - first target is Itot_ohm
0066 % - if Itot_ohm == NaN, target is Jtot_ohm
0067 % - if Jtot_ohm == NaN, target is the current calculated from XXfinit
0068 %
0069 % Note : The use of Itot_ohm or Jtot_ohm makes sense only in the search of a time-asymptotic solution
0070 %
0071 dkeparam.nit_ohm = 1;% max number of iterations to converge on the current prescription (nit_ohm > 1). If nit_ohm == 1, frozen current mode is off
0072 dkeparam.tol_ohm = 1e-3;% tolerance for converge on the current prescription
0073 dkeparam.efield_ohm = 1e-2;% [V/m] initial (uniform) efield guess for convergence. used if ohm is empty or any(ohm.epsi == 0)
0074 dkeparam.Itot_ohm = NaN;% [MA] scalar target for generated current. In this mode, vloop is uniform
0075 dkeparam.Jtot_ohm = NaN;% [MA/m^2] target current profile
0076 dkeparam.rho_ohm = NaN;% (LFS midplane x/a) corresponding rho grid
0077 %
0078 %dkeparam.w_mask = ;%%%%%%TODO%%%%%%%
0079 %dkeparam.rho0 = ;%%%%%%TODO%%%%%%%
0080 %dkeparam.seekparam.submode = ;%%%%%%TODO%%%%%%%
0081 %dkeparam.seekparam.f_sdNpar_in = ;%%%%%%TODO%%%%%%%
0082 %dkeparam.seekparam.f_step = ;%%%%%%TODO%%%%%%%
0083 %dkeparam.seekparam.a_sdNpar_in = ;%%%%%%TODO%%%%%%%
0084 %dkeparam.seekparam.a_step = ;%%%%%%TODO%%%%%%%
0085 %
0086 % Run mode
0087 %
0088 dkeparam.bounce_mode = 1;%Bounce averaging option: (0) no bounce averaging, (1) bounce averaging full implicit method with 15 diagonals
0089 dkeparam.dke_mode = 0;%Fokker-Planck equation (0), Drift Kinetic equation (1)
0090 dkeparam.equil_mode = 1;%Equilibrium option: (0) circular concentric flux-surfaces, (1) numerical equilibrium
0091 dkeparam.syn_mode = 0;%Synergy calculation: (0) none, (1) yes: the code runs twice, including once without RF or electric fields. (only if dke_mode = 1)
0092 %
0093 dkeparam.norm_mode_f = 0;%Local normalization of f0 at each iteration: (0) no, the default value when the numerical conservative scheme is correct, (1) yes
0094 dkeparam.boundary_mode_f = 1;%Number of points where the Maxwellian distribution is enforced from p = 0 (p=0, free conservative mode but param_inv(1) must be less than 1e-4, otherwise 1e-3 is OK most of the time. Sensitive to the number of points in p)
0095 dkeparam.prec0_f = 1e-15;%Convergence level of the residu. If NaN, dkeparam.nit_f calculations are performed, whatever the level of the residu.
0096 dkeparam.nit_f = 50;%Maximum number of iterations for f (> 1)
0097 dkeparam.initguess_f = 0;%Initial guess for the distribution function: (0) Maxwellian, (1) Fuchs model with Tperp for LH current drive only, (2) from a file
0098 dkeparam.initfile_f = '';%If initguess_f = 2. The file must be in the directory Project_DKE, and created by dke_4_1yp.m
0099 %
0100 dkeparam.boundary_mode_g = 0;%Number of points where the first distribution function for the Lorentz model is enforced from p = 0 (p=0, free conservative mode but param_inv(1) must be less than 1e-4, otherwise 1e-3 is OK most of the time. Sensitive to the number of points in p)
0101 dkeparam.prec0_g = 1e-15;%Convergence level of the residu (if NaN, iterations stop with nit_g)
0102 dkeparam.nit_g = 50;%Maximum number of iterations for g
0103 %
0104 dkeparam.tn = 100000;%LUKE time step (1/nhuth_ref)
0105 dkeparam.dtn = NaN;%Integration time step (1/nhuth_ref) (dtn > 0: fully implicit time differencing scheme , dtn < 0: Crank-Nicholson time differencing scheme) (WARNING: dtn less than 1 when fast electron radial transport is considered)
0106 dkeparam.opsplit = 0;%Operator splitting between momentum and radial dynamics (for tests only) (opsplit = 0: no operator splitting , opsplit = 1: operator splitting). If this field does not exist, it is equivalent to dkeparam.opsplit = 0.
0107 %
0108 dkeparam.invproc = 1;%Iterative matrix inversion methods
0109 % (3) Matlab built-in qmr iterative method (MatLab built-in partial LU factorization used)
0110 % (2) Matlab built-in bicg iterative method (MatLab built-in partial LU factorization used)
0111 % (1) Matlab built-in cgs iterative method (MatLab built-in partial LU factorizsation used)
0112 % (0) Matlab built-in direct inversion without any LU factorization (NOT RECOMMANDED !)
0113 % (-1): MUMPS parallel (or sequential) fortran 95 direct inversion (LU matrix factorization done for each time a matrix inversion is called)
0114 % (-2): MUMPSMEX sequential fortran 95 inversion using MUMPS LU matrix factorization
0115 % (-3): SUPERLUMEX sequential direct matrix inversion (LU matrix factorization done for each time a matrix inversion is called)
0116 % (-4) PETSc interface (see data structure below)
0117 dkeparam.ludroptol = 1e-8;%Drop tolerance for the built-in MatLab partial LU decomposition (recipes: droptol = max(1/dtn/nr,param_inv(1)))
0118 dkeparam.mlmaxitinv = 20;%Maximum number of iterations for iterative built-in MatLab matrix inversion method (between 1 and 20 usualy, if empty, mlmaxitinv = min(matrixdim,20). See matlab documentation.
0119 dkeparam.mlprecinv = 1e-8;%Accuracy for the MatLab build-in matrix inversion.
0120 dkeparam.MUMPSparam.nproc = 1;%number of processor used by MUMPS (depends of the computer framework). Default is 1
0121 dkeparam.MUMPSparam.thresholdpivoting = '';%Relative threshold for numerical pivoting in the MUMPS partial LU decomposition (default MUMPS = 1e-2: NaN or empty or field not existing). Increasing this parameter will reduce sparcity. Less than 1.
0122 dkeparam.MUMPSparam.precinv = '';%Accuracy for the MUMPS matrix inversion.(default MUMPS: NaN or empty or field not existing). Only for the solve phase.
0123 dkeparam.PETScparam.nproc = 1;%number of processor used by PETSc (depends of the computer framework). Default is 1
0124 dkeparam.PETScparam.matrixtype = ' ';%Matrix type used by PETSc. For SUPERLU use '-matload_type superlu_dist' otherwise ' '. See PETSc documentation
0125 dkeparam.PETScparam.kspmethod = ' ';%KSP method used by PETSc. '-ksp_type preonly': no iteration, direct matrix solve. Otherwise '-ksp_type bicg' or '-ksp_type bcgs'  for example. See PETSc documentation
0126 dkeparam.PETScparam.pcmethod = ' ';%Preconditioning method used by PETSc. '-pc_type lu' for SUPERLU or '-pc-type hypre' for HYPRE.  See PETSc documentation
0127 dkeparam.PETScparam.cloop = 0;%First order collision selfconsistency is done internaly in C (1) or in MatLab (0)
0128 %
0129 dkeparam.clustermode.coll_dke_jd.scheduler.mode = 0;%MatLab distributed computing environment disabled (0), enabled with the dedicated toolbox (1), enabled with a private method (2) for the function coll_dke_jd.m (MDC toolbox must be installed for option 1)
0130 dkeparam.clustermode.coll_dke_jd.scheduler.memory = 500;%required memory (in mb)
0131 dkeparam.clustermode.eecoll_dke_yp.scheduler.mode = 0;%MatLab distributed computing environment disabled (0), enabled with the dedicated toolbox (1), enabled with a private method (2) for the function coll_dke_jd.m (MDC toolbox must be installed for option 1)
0132 dkeparam.clustermode.eecoll_dke_yp.scheduler.memory = 500;%required memory (in mb)
0133 dkeparam.clustermode.wave_solver_yp.scheduler.mode = 0;%MatLab distributed computing environment disabled (0), enabled with the dedicated toolbox (1), enabled with a private method (2) for the function coll_dke_jd.m (MDC toolbox must be installed for option 1)
0134 dkeparam.clustermode.wave_solver_yp.scheduler.memory = 500;%required memory (in mb)
0135 %
0136 dkeparam.opt_struct = 0;% (0) select only main fields from output structures (1) select all fields except ZXYD_rf and gridindex_rf (2) also select ZXYD_rf and gridindex_rf
0137 dkeparam.store_mode = 0;%Temporary storing option for sparse matrices calculations (in RAM: 0, in disk file 1) when memory space is tight
0138 dkeparam.opt_save = 0;%Save intermediate calculations
0139 dkeparam.opt_load = 0;%Load intermediate calculations
0140 dkeparam.timevol = 0;% save results at intermediate times
0141 %
0142 dkeparam.method = 'spline';%For the pitch-angle interpolation in the prjectioon of the electron velocity distribution on the Legendre polynomial basis
0143 dkeparam.n_gauleg = 35;%Number of Legendre polynomials for projections of the electron velocity distribution
0144 dkeparam.epsi_gauleg = 1e-14;%Accuracy of the Legendre projection
0145 %
0146 eval(['save DKEPARAM_',dkeparam.id,'.mat dkeparam']);

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.