script make_wave_test_RT Parameters for test mode ray-tracing calculations This function has a benchmarking purpose only by Y. Peysson (DRFC/DSM/CEA) <yves.peysson@cea.fr> and J. Decker (DRFC/DSM/CEA) <joan.decker@cea.fr>
0001 function [] = make_wave_RTtest 0002 % script make_wave_test_RT 0003 % 0004 % Parameters for test mode ray-tracing calculations 0005 % This function has a benchmarking purpose only 0006 % 0007 % by Y. Peysson (DRFC/DSM/CEA) <yves.peysson@cea.fr> and J. Decker (DRFC/DSM/CEA) <joan.decker@cea.fr> 0008 % 0009 close all 0010 % 0011 id_wave = 'RTtest'; 0012 flag_analytic = 1; 0013 % 0014 % Path parameters 0015 % 0016 id_dkepath = '';%For all paths used by DKE solver 0017 path_dkepath = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0018 % 0019 % Equilibrium parameters 0020 % 0021 id_equil = 'RTtest';%For plasma equilibrium 0022 path_equil = '../EQUIL/';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0023 % 0024 % initial ray conditions 0025 % 0026 omega_rf = [3.7]*2*pi*1e9; 0027 % 0028 rho0 = 0.98; 0029 theta0 = 0.0; 0030 phi0 = 0.0; 0031 % 0032 m0 = 0; 0033 n0 = NaN; 0034 Npar0 = 2.0;%initial index of refraction 0035 % 0036 dNpar0 = NaN; 0037 P0_2piRp = NaN; 0038 % 0039 % C3PO computing parameters 0040 % 0041 mdce_mode_main_C3PO_jd = 0;%MatLab distributed computing environment disabled (0), enabled with the dedicated toolbox (1), enabled with a private method (2)for the function main_C3PO_jd.m (MDC toolbox must be installed for option 1) 0042 % 0043 % Display parameters 0044 % 0045 C3POdisplay.ray = 1; 0046 C3POdisplay.equilibrium = 0; 0047 C3POdisplay.p_opt = 2;%Printing or saving option of the figures 0048 % 0049 % Wave parameters 0050 % 0051 waveparam.mmode = -1;%cold plasma mode [1] : (-1) m (1) p, p is the slow mode when kperp > 0 (ex : LH slow wave) 0052 waveparam.kmode = 0;%(0:cold,1:warm,2:hot;3:weak realtivistic,4:full relativistic) 0053 % 0054 %Option parameter for FLR effects and cross-comparison between old FP code: 0055 % - (0): all FLR effects 0056 % - (1): small FLR effects and 1/vpar dependence 0057 % - (2): small FLR effects and no 1/vpar dependence and old grid technique for DQL calculations (Karney, Shoucri) (see rfdiff_dke_jd) 0058 % 0059 waveparam.opt_rf = NaN; 0060 % 0061 waveparam.dsmin = NaN;%minimum size for ray fragments 0062 % 0063 % ------------------------------------------------------------------------- 0064 % 0065 % Global parameters for the vectorial magnetic equilibrium 0066 % 0067 fitparam.mode_equil = 1;%Magnetic equilibrium grid type: (1): (psi-theta), (2): (x-y) 0068 fitparam.method = 'spline';%nearest,spline,pchip,cubic 0069 fitparam.nharm = NaN;%Number of harmonics in the magnetic equilibrium interpolation (NaN, Inf or empty, nharm = ntheta-1) 0070 fitparam.ngridresample = 1001;%Number of grid points for resampling the radial profile of magnetic equilibrium parameters 0071 % 0072 % Global parameters for the ray-tracing 0073 % 0074 rayparam.testmode = 0; 0075 rayparam.tensortype = waveparam.kmode;%(0:cold,1:warm,2:hot;3:weak realtivistic,4:full relativistic) 0076 rayparam.t0 = 0; 0077 rayparam.tfinal = 10000; 0078 rayparam.dt0 = 1.e-4; 0079 rayparam.dS = 1.e-4; 0080 rayparam.tol = 1e-12;%when tolerance is increased (less accurate calculation of D=0), tfinal must be increased accordingly 0081 rayparam.kmax = 60000; 0082 rayparam.ncyclharm = 3;%number of cyclotron harmonics (just for hot and relativistic dielectric tensors) 0083 rayparam.reflection = 0;%1:Enforce wave reflection at plasma boundary, 0: the code calculates itself if the ray must leave of not the plasma 0084 rayparam.rel_opt = 1;%option for (1) relativistic or (0) non-relativistic calculations 0085 rayparam.nperp = 1000;%number of points in pperp integration for damping calculations 0086 rayparam.pperpmax = 10;%maximum value of pperp in damping calculations 0087 rayparam.tau_lim = 20;%value of optical depth beyond which the wave is considered absorbed 0088 % 0089 % ------------------------------------------------------------------------- 0090 % 0091 % Load structures 0092 % 0093 [equil,dkepath] = load_structures_yp('equil',id_equil,path_equil,'dkepath',id_dkepath,path_dkepath); 0094 % 0095 % ========================================================================= 0096 % 0097 % C3P0 ray tracing 0098 % 0099 rayinit.omega_rf = omega_rf; 0100 rayinit.yrho0 = rho0;%Initial radial position at launch 0101 rayinit.ytheta0 = theta0;%Initial poloidal position at launch 0102 rayinit.yphi0 = phi0;%Initial toroidal position at launch 0103 rayinit.ym0 = m0;%Initial poloidal mode number 0104 rayinit.yn0 = n0;%Initial toroidal mode number 0105 rayinit.yNpar0 = Npar0;%Initial index of refraction 0106 rayinit.ydNpar0 = dNpar0;%initial Ray spectral width 0107 rayinit.yP0_2piRp = P0_2piRp;%Lineic initial power density initial power in the ray (W/m) 0108 % 0109 % ------------------------------------------------------------------------- 0110 % 0111 % C3PO computing parameters 0112 % 0113 C3POparam.clustermode.main_C3PO_jd.scheduler.mode = mdce_mode_main_C3PO_jd;%MatLab distributed computing environment 0114 % 0115 % Ray-tracing calculations 0116 % 0117 wave_numeric = main_C3PO_jd(dkepath,[id_wave,'_numeric'],equil,'',rayinit,waveparam,fitparam,rayparam,C3POdisplay,C3POparam,[],[],0); 0118 % 0119 info_dke_yp(2,'Ray trajectories calculated (interpolated magnetic equilibrium)'); 0120 % 0121 rayparam.tfinal = 100000; 0122 rayparam.kmax = 60000; 0123 wave_analytic = main_C3PO_jd(dkepath,[id_wave,'_analytic'],equil,'',rayinit,waveparam,fitparam,rayparam,C3POdisplay,C3POparam,[],[],flag_analytic); 0124 % 0125 info_dke_yp(2,'Ray trajectories calculated (analytic magnetic equilibrium)'); 0126 % 0127 save_str = ['WAVE_',id_wave,'.mat']; 0128 save(save_str,'id_wave','wave_numeric','wave_analytic'); 0129 % 0130 info_dke_yp(2,'Wave parameters saved'); 0131 % 0132 % --- display results --- 0133 % 0134 waves = {wave_numeric,wave_analytic}; 0135 rays = {wave_numeric.rays{1},wave_analytic.rays{1}}; 0136 % 0137 legs = {'Numeric','Analytic'}; 0138 % 0139 filename = ['Fig_',id_wave]; 0140 % 0141 opt.p_opt = C3POdisplay.p_opt; 0142 opt.ntheta_fit = 65; 0143 opt.nrho_fit = 15; 0144 opt.propvar = 1; 0145 % 0146 graph_comp_RT_jd(rays,legs,'',filename,opt) 0147 % 0148 diary4cvs_C3PO_yp(id_wave,dkepath,waves);% diary some results for CVS validation