make_wave_JETlikeECtest_rhomin

PURPOSE ^

script make_wave_test_RT

SYNOPSIS ^

function [] = make_wave_JETlikeECtest_rhomin

DESCRIPTION ^

 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>

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [] = make_wave_JETlikeECtest_rhomin
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 = 'JETlikeECtest_rhomin';
0012 flag_analytic = 2;
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 = 'JETliketest';%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 % Load structures
0025 %
0026 [equil,dkepath] = load_structures_yp('equil',id_equil,path_equil,'dkepath',id_dkepath,path_dkepath);
0027 %
0028 % =========================================================================
0029 %
0030 % initial ray conditions
0031 %
0032 freq_GHz = 110;
0033 %
0034 R_L = 5.0;
0035 Z_L = 0.1;
0036 phi_L = 0;
0037 %
0038 P_L = 1e-6;% [MW]
0039 %
0040 alpha_L = 165;% With respect to R axis
0041 beta_L = 92.7;% With respect to Z axis
0042 %
0043 rhomin = 0.01;
0044 %
0045 dNpar0 = 0.05;%spectral width
0046 ns = 1000;%discrtization parameter for free space propagation
0047 method = 'linear';%interpolation method for ray separatrix crossing
0048 %
0049 % C3PO computing parameters
0050 %
0051 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)
0052 %
0053 % Display parameters
0054 %
0055 C3POdisplay.ray = 1;
0056 C3POdisplay.equilibrium = 0;
0057 C3POdisplay.p_opt = -1;%Printing or saving option of the figures
0058 C3POdisplay.mdce = 1;%for distributed computing
0059 %
0060 % Wave parameters
0061 %
0062 waveparam.mmode = -1;%cold plasma mode [1] : (-1) O mode (1) X mode
0063 waveparam.kmode = 0;%(0:cold,1:warm,2:hot;3:weak realtivistic,4:full relativistic)
0064 %
0065 %Option parameter for FLR effects and cross-comparison between old FP code:
0066 %    - (0): all FLR effects
0067 %    - (1): small FLR effects and 1/vpar dependence
0068 %    - (2): small FLR effects and no 1/vpar dependence and old grid technique for DQL calculations (Karney, Shoucri) (see rfdiff_dke_jd)
0069 %
0070 waveparam.opt_rf = 1;
0071 %
0072 waveparam.dsmin = 0;%minimum size for ray fragments
0073 %
0074 waveparam.nd = 1;%Number of transverse distance positions for beamlets
0075 waveparam.nchi = 1;%Number of angular positions for beamlets
0076 %
0077 waveparam.n_rf_list = 1:2;
0078 waveparam.ns = 1;%ray smoothing parameter
0079 %
0080 waveparam.dsmin = NaN;%minimum size for ray fragments
0081 %
0082 % -------------------------------------------------------------------------
0083 %
0084 % Global parameters for the vectorial magnetic equilibrium
0085 %
0086 fitparam.equil.mode_equil = 1;%Magnetic equilibrium grid type: (1): (psi-theta), (2): (x-y)
0087 fitparam.equil.method = 'spline';%nearest,spline,pchip
0088 fitparam.equil.nharm = NaN;%Number of harmonics in the magnetic equilibrium interpolation (NaN, Inf or empty, nharm = ntheta-1)
0089 fitparam.equil.ngridresample = 1001;%Number of grid points for resampling the radial profile of magnetic equilibrium parameters
0090 %
0091 % Global parameters for the ray-tracing
0092 %
0093 rayparam.testmode = 0;
0094 rayparam.tensortype = 0;%(0:cold,1:warm,2:hot;3:weak realtivistic,4:full relativistic)
0095 rayparam.t0 = 0;
0096 rayparam.tfinal = 100000;
0097 rayparam.dt0 = 1.e-4;
0098 rayparam.dS = 1.e-4;
0099 rayparam.tol = 1e-9;%when tolerance is increased (less accurate calculation of D=0), tfinal must be increased accordingly
0100 rayparam.kmax = 100000;
0101 rayparam.ncyclharm = 3;%number of cyclotron harmonics (just for hot and relativistic dielectric tensors)
0102 rayparam.reflection = 0;%1:Enforce wave reflection at plasma boundary, 0: the code calculates itself if the ray must leave of not the plasma
0103 rayparam.rel_opt = 1;%option for (1) relativistic or (0) non-relativistic calculations
0104 rayparam.nperp = 1000;%number of points in pperp integration for damping calculations
0105 rayparam.pperpmax = 10;%maximum value of pperp in damping calculations
0106 rayparam.tau_lim = 20;%value of optical depth beyond which the wave is considered absorbed
0107 rayparam.kextra = 50;
0108 rayparam.rhomin = rhomin;
0109 %
0110 % launch structure
0111 %
0112 launch.id = id_wave;
0113 launch.type = 'EC';
0114 launch.omega_rf = [freq_GHz]*2*pi*1e9;%wave angular frequency (rad/s)
0115 %
0116 launch.yR_L = R_L;
0117 launch.yZ_L = Z_L;
0118 launch.yphi_L = phi_L;
0119 %
0120 launch.yalpha_L = alpha_L*pi/180;
0121 launch.ybeta_L = beta_L*pi/180;
0122 %
0123 launch.yP_L = P_L*1e6;
0124 %
0125 launch.dNpar0 = dNpar0;
0126 %
0127 launch.ns = ns;
0128 launch.method = method;
0129 %
0130 launch.w0 = NaN;
0131 launch.z_L = NaN;
0132 %
0133 % =========================================================================
0134 %
0135 % C3P0 ray tracing
0136 %
0137 equil_fit = fitequil_yp(equil,fitparam.equil.mode_equil,fitparam.equil.method,fitparam.equil.ngridresample,fitparam.equil.nharm);%Build vectorized magnetic equilibrium structure
0138 %
0139 info_dke_yp(2,['Vectorial form of the magnetic equilibrium ',equil.id,' is calculated.']);
0140 if C3POdisplay.equilibrium,testfitequil_yp(equil,equil_fit);end
0141 %
0142 % Ray init calculation from launch
0143 %
0144 rayinit = main_rayinit_launch_jd(equil,launch);
0145 %
0146 % --------------------------------------------------------------------------
0147 %
0148 % C3PO computing parameters
0149 %
0150 C3POparam.clustermode.main_C3PO_jd.scheduler.mode = mdce_mode_main_C3PO_jd;%MatLab distributed computing environment
0151 %
0152 % ray-tracing calculations
0153 %
0154 tstart = tic;
0155 wave = main_C3PO_jd(dkepath,[id_wave],equil,equil_fit,rayinit,waveparam,[],rayparam,C3POdisplay,C3POparam,[],[],0);clear mex;clear functions
0156 telapsed_ray = toc(tstart);
0157 %
0158 info_dke_yp(2,'Ray trajectories calculated (interpolated magnetic equilibrium)');
0159 %
0160 save_str = ['WAVE_',id_wave,'.mat'];
0161 save(save_str,'id_wave','wave');
0162 %
0163 info_dke_yp(2,'Wave parameters saved');
0164 %
0165 disp(['Elapsed time (s):',num2str(telapsed_ray),' for ray calculations (PCHIP interp. technique)']);
0166 %
0167 diary4cvs_C3PO_yp(id_wave,dkepath,wave);% diary some results for CVS validation
0168

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