make_dkeparam_UNIFORM10010020

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 = 'UNIFORM10010020';%Set here the name (identifier) of the drift kinetic code parameters
0009 %
0010 %Mesh size calculation
0011 %
0012 dkeparam.grid_uniformity = 1;%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 %
0018 %Pitch-angle grid
0019 %
0020 dkeparam.sfac0 = 1; % reduction factor for fine grid near mhu = 0
0021 dkeparam.sfac1 = 1; % reduction factor for fine grid near abs(mhu) = 1
0022 dkeparam.sfact = 1; % reduction factor for fine grid near abs(mhu) = mhut
0023 %
0024 dkeparam.snmhu0 = 1; % number of fine grid points near mhu = 0
0025 dkeparam.snmhu1 = 1; % number of fine grid points near abs(mhu) = 1
0026 dkeparam.snmhut = 1; % number of fine grid points near abs(mhu) = mhut
0027 %
0028 dkeparam.grid_power = 1.5; % power for mhu grid step varations (grid_power > 1) (Note: for grid_method = 1 only)
0029 %
0030 %Momentum grid
0031 %
0032 dkeparam.np_S_ref = 20;%position in the mpomentum grid where dpn_S is twice the minimum value(must be ajusted with snp parameter)
0033 dkeparam.snp = 1;%pgridfactor (Uniform grid: pgridfactor = 1, non-uniform grid: pgridfactor > 1)
0034 dkeparam.spfac = 20;%reduction factor for the momentum supergrid used in collision integrals
0035 %
0036 %Normalized radii at which the distribution is calculated (DKE or FP)
0037 %The syntax rho='all' may be also used if all mhu values are considered.
0038 %
0039 dkeparam.dpsin_dke = 0.01;%maximum difference between two consecutive positions used for radial derivatives
0040 %
0041 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)
0042 %
0043 % Dql and collision operator
0044 %
0045 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
0046 %
0047 % Ray-tracing and RF waves
0048 %
0049 dkeparam.rt_mode = 0;%RT-DKE power consistency
0050 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)
0051 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)
0052 dkeparam.prec_rf = 1e-4;%relative precision in RT-DKE iterations
0053 dkeparam.n_rf_list = 0;%List of harmonics in the Dql calculations
0054 dkeparam.delta_rt = 0;%smoothering parameter of quasilinear iterations
0055 dkeparam.Dparparmax = Inf;%Upper limit of the quasilinear diffusion coefficient. Important for low temperature plasmas et high power level for stability of the code
0056 dkeparam.npresmin = 1;% minimum number of resonant points for each ray and position
0057 dkeparam.nk_abs = 1;%maximum number of iterations on a_sdNpar for full absorption (%%%%%%TODO%%%%%%% for what ?)
0058 %
0059 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)
0060 %
0061 % Current prescription mode : (nit_ohm > 1)
0062 %
0063 % - first target is Itot_ohm
0064 % - if Itot_ohm == NaN, target is Jtot_ohm
0065 % - if Jtot_ohm == NaN, target is the current calculated from XXfinit
0066 %
0067 % Note : The use of Itot_ohm or Jtot_ohm makes sense only in the search of a time-asymptotic solution
0068 %
0069 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
0070 dkeparam.tol_ohm = 1e-3;% tolerance for converge on the current prescription
0071 dkeparam.efield_ohm = 1e-2;% [V/m] initial (uniform) efield guess for convergence. used if ohm is empty or any(ohm.epsi == 0)
0072 dkeparam.Itot_ohm = NaN;% [MA] scalar target for generated current. In this mode, vloop is uniform
0073 dkeparam.Jtot_ohm = NaN;% [MA/m^2] target current profile
0074 dkeparam.rho_ohm = NaN;% (LFS midplane x/a) corresponding rho grid
0075 %
0076 %dkeparam.w_mask = ;%%%%%%TODO%%%%%%%
0077 %dkeparam.rho0 = ;%%%%%%TODO%%%%%%%
0078 %dkeparam.seekparam.submode = ;%%%%%%TODO%%%%%%%
0079 %dkeparam.seekparam.f_sdNpar_in = ;%%%%%%TODO%%%%%%%
0080 %dkeparam.seekparam.f_step = ;%%%%%%TODO%%%%%%%
0081 %dkeparam.seekparam.a_sdNpar_in = ;%%%%%%TODO%%%%%%%
0082 %dkeparam.seekparam.a_step = ;%%%%%%TODO%%%%%%%
0083 %
0084 % Run mode
0085 %
0086 dkeparam.bounce_mode = 0;%Bounce averaging option: (0) no bounce averaging, (1) bounce averaging full implicit method with 15 diagonals
0087 dkeparam.dke_mode = 0;%Fokker-Planck equation (0), Drift Kinetic equation (1)
0088 dkeparam.equil_mode = 1;%Equilibrium option: (0) circular concentric flux-surfaces, (1) numerical equilibrium
0089 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)
0090 %
0091 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
0092 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)
0093 dkeparam.prec0_f = 1e-15;%Convergence level of the residu. If NaN, dkeparam.nit_f calculations are performed, whatever the level of the residu.
0094 dkeparam.nit_f = 50;%Maximum number of iterations for f (> 1)
0095 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
0096 dkeparam.initfile_f = '';%If initguess_f = 2. The file must be in the directory Project_DKE, and created by dke_4_1yp.m
0097 %
0098 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)
0099 dkeparam.prec0_g = 1e-15;%Convergence level of the residu (if NaN, iterations stop with nit_g)
0100 dkeparam.nit_g = 50;%Maximum number of iterations for g
0101 %
0102 dkeparam.tn = 100000;%LUKE time step (1/nhuth_ref)
0103 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)
0104 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.
0105 %
0106 dkeparam.invproc = 1;%Iterative matrix inversion methods
0107 % (3) Matlab built-in qmr iterative method (MatLab built-in partial LU factorization used)
0108 % (2) Matlab built-in bicg iterative method (MatLab built-in partial LU factorization used)
0109 % (1) Matlab built-in cgs iterative method (MatLab built-in partial LU factorizsation used)
0110 % (0) Matlab built-in direct inversion without any LU factorization (NOT RECOMMANDED !)
0111 % (-1): MUMPS parallel (or sequential) fortran 95 direct inversion (LU matrix factorization done for each time a matrix inversion is called)
0112 % (-2): MUMPSMEX sequential fortran 95 inversion using MUMPS LU matrix factorization
0113 % (-3): SUPERLUMEX sequential direct matrix inversion (LU matrix factorization done for each time a matrix inversion is called)
0114 % (-4) PETSc interface (see data structure below)
0115 dkeparam.ludroptol = 1e-8;%Drop tolerance for the built-in MatLab partial LU decomposition (recipes: droptol = max(1/dtn/nr,param_inv(1)))
0116 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.
0117 dkeparam.mlprecinv = 1e-8;%Accuracy for the MatLab build-in matrix inversion.
0118 dkeparam.MUMPSparam.nproc = 1;%number of processor used by MUMPS (depends of the computer framework). Default is 1
0119 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.
0120 dkeparam.MUMPSparam.precinv = '';%Accuracy for the MUMPS matrix inversion.(default MUMPS: NaN or empty or field not existing). Only for the solve phase.
0121 dkeparam.PETScparam.nproc = 1;%number of processor used by PETSc (depends of the computer framework). Default is 1
0122 dkeparam.PETScparam.matrixtype = ' ';%Matrix type used by PETSc. For SUPERLU use '-matload_type superlu_dist' otherwise ' '. See PETSc documentation
0123 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
0124 dkeparam.PETScparam.pcmethod = ' ';%Preconditioning method used by PETSc. '-pc_type lu' for SUPERLU or '-pc-type hypre' for HYPRE.  See PETSc documentation
0125 dkeparam.PETScparam.cloop = 0;%First order collision selfconsistency is done internaly in C (1) or in MatLab (0)
0126 %
0127 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)
0128 dkeparam.clustermode.coll_dke_jd.scheduler.memory = 500;%required memory (in mb)
0129 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)
0130 dkeparam.clustermode.eecoll_dke_yp.scheduler.memory = 500;%required memory (in mb)
0131 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)
0132 dkeparam.clustermode.wave_solver_yp.scheduler.memory = 500;%required memory (in mb)
0133 %
0134 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
0135 dkeparam.store_mode = 0;%Temporary storing option for sparse matrices calculations (in RAM: 0, in disk file 1) when memory space is tight
0136 dkeparam.opt_save = 0;%Save intermediate calculations
0137 dkeparam.opt_load = 0;%Load intermediate calculations
0138 dkeparam.timevol = 0;% save results at intermediate times
0139 %
0140 dkeparam.method = 'spline';%For the pitch-angle interpolation in the prjectioon of the electron velocity distribution on the Legendre polynomial basis
0141 dkeparam.n_gauleg = 35;%Number of Legendre polynomials for projections of the electron velocity distribution
0142 dkeparam.epsi_gauleg = 1e-14;%Accuracy of the Legendre projection
0143 %
0144 eval(['save DKEPARAM_',dkeparam.id,'.mat dkeparam']);

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