make_wave_JETlikeECtest_cyl

PURPOSE ^

script make_wave_test_RT

SYNOPSIS ^

function [] = make_wave_JETlikeECtest_cyl

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

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