R5-X2 - Test script for FEB calculations using the 3 temperatures model for the LH model Script for testing the dependencies of the Fast Electron Bremsstrahlung to the 3 temperatures model (Tpar, Tperp, Tback) for modeling the the LH wave. Two additional parameters may be considered, the fraction of non-thermal electrons and the upper limit cut-off (Ecut) by Y. Peysson (CEA/IRFM) (yves.peysson@cea.fr) and J. Decker (CEA/IRFM) (joan.decker@cea.fr)
0001 %R5-X2 - Test script for FEB calculations using the 3 temperatures model for the LH model 0002 % 0003 %Script for testing the dependencies of the Fast Electron Bremsstrahlung 0004 %to the 3 temperatures model (Tpar, Tperp, Tback) for modeling the the LH 0005 %wave. Two additional parameters may be considered, the fraction of 0006 %non-thermal electrons and the upper limit cut-off (Ecut) 0007 % 0008 %by Y. Peysson (CEA/IRFM) (yves.peysson@cea.fr) and J. Decker (CEA/IRFM) (joan.decker@cea.fr) 0009 % 0010 clear all 0011 clear mex 0012 clear functions 0013 close all 0014 warning off 0015 % 0016 % 0017 % ***********************This part must be specified by the user, run make files if necessary) ***************************** 0018 % 0019 id_simul0 = '3Tmodel';%Simulation ID 0020 path_simul = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0021 % 0022 psin_S = [];%Normalized poloidal flux grid where calculations are performed (0 < psin_S < 1) (If one value: local calculation only, not used if empty) 0023 rho_S = [0.3,0.7];%Normalized radial flux grid where calculations are performed (0 < rho_S < 1) (If one value: local calculation only, not used if empty) 0024 % 0025 id_path = '';%For all paths used by DKE solver 0026 path_path = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0027 % 0028 id_equil = 'TScirc';%For plasma equilibrium 0029 path_equil = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0030 % 0031 id_dkeparam = 'NONUNIFORM10010020';%For DKE code parameters 0032 path_dkeparam = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0033 % 0034 id_display = 'PARTIAL_VISUAL';%For output code display 0035 path_display = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0036 % 0037 id_ohm = '';%For Ohmic electric contribution 0038 path_ohm = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0039 % 0040 ids_wave = {''};%For RF waves contribution (put all the type of waves needed) 0041 paths_wave = {''};%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0042 % 0043 id_transpfaste = '';%For fast electron radial transport 0044 path_transpfaste = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0045 % 0046 id_ripple = '';%For fast electron magnetic ripple losses 0047 path_ripple = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0048 % 0049 id_hxr = 'TScirc';%For HXR diagnostic configuration 0050 path_hxr = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0051 0052 % 0053 %************************************************************************************************************************************ 0054 %************************************************************************************************************************************ 0055 %************************************************************************************************************************************ 0056 % 0057 [dkepath,equil,dkeparam,dkedisplay,ohm,transpfaste,ripple,hxr,hxrparam] = load_structures_yp('dkepath',id_path,path_path,'equil',id_equil,path_equil,'dkeparam',id_dkeparam,path_dkeparam,'dkedisplay',id_display,path_display,'ohm',id_ohm,path_ohm,'transpfaste',id_transpfaste,path_transpfaste,'ripple',id_ripple,path_ripple,'hxr',id_hxr,path_hxr); 0058 % 0059 %************************************************************************************************************************************ 0060 % 0061 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) 0062 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 0063 % 0064 dkeparam.np_S = 61; 0065 dkeparam.nmhu_S = 51; 0066 dkeparam.pnmax_S = 30; 0067 % 0068 dkeparam.bounce_mode = 0; 0069 % 0070 dkeparam.psin_S = psin_S; 0071 dkeparam.rho_S = rho_S; 0072 % 0073 if exist('dmumpsmex');dkeparam.invproc = -2;end 0074 % 0075 dkedisplay.display_mode = 0; 0076 % 0077 % 0078 % C3PO computing parameters 0079 % 0080 scanparam.clustermode.scanloop.mode = 2;%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) 0081 scanparam.clustermode.scanloop.timeout = 500;%MatLab distributed computing environment time out (s). after time out is reached, calculations are performed in a sequential mode on a single processor 0082 scanparam.clustermode.scanloop.size = 4;%MatLab distributed computing environment cluster size. Can be Inf is all the processors of the cluster are free for distributed calculations 0083 % 0084 frac = 1e-3; 0085 Ecut = 500;%[100,200,500,1000]; 0086 Tpar = 200;%logspace(1,3,5); 0087 Tperp = 100;%[10,20,50,100,200,500,1000]; 0088 Tback = Tperp; 0089 % 0090 fieldside = NaN;%Distribution enforced corresponding to 'HFS' (theta = pi) or 'LFS' (theta = 0). If NaN, exact trapping effects of the magnetic equilibrium are considered. 0091 chordview = 0;%No heliticity enforced: 0 (perp), 1 (forward) or -1 (backward). If NaN, the exact heliticity of the magnetic equilibrium is considered. 0092 % 0093 disp('---------------------------------------------------------------------'); 0094 % 0095 [Znorm,Zcurr,ZP0,dke_out,radialDKE,equilDKE,momentumDKE,gridDKE,Zmomcoef,Zbouncecoef,Zmripple,mksa] = main_dke_yp('test',dkepath,equil,dkeparam,dkedisplay,ohm,[],transpfaste,[],[],[]); 0096 return 0097 % 0098 for iEcut = 1:length(iEcut),arg_range{iEcut} = iEcut;end 0099 [flag,norm,curr,Tph,Tph_star] = mdce_run(@loop_scan_3Tmodel,{iEcut,frac,Ecut,Tpar,Tperp,Tback,Znorm,Zcurr,ZP0,dke_out,radialDKE,equilDKE,momentumDKE,gridDKE,Zmomcoef,Zbouncecoef,hxr,hxrparam,fieldside,chordview},1,arg_range,clusterparam); 0100 % 0101 norm1 = cell2mat(norm); 0102 curr1 = cell2mat(curr); 0103 Tph1 = cell2mat(Tph); 0104 Tph_star1 = cell2mat(Tph_star); 0105 % 0106 for ivmin = 1:length(vmin), 0107 figure,graph1D_jd(D0,Tph1(ivmin:length(vmin):end,:),1,0,'D0','Tph',['v_{min}/v_{Ref} = ',num2str(vmin(ivmin))],NaN,[-1,4],[0,70],'-','none','r',2,20,gca,0.9,0.7,0.7); 0108 figure,graph1D_jd(D0,Tph_star1(ivmin:length(vmin):end,:),1,0,'D0','Tph',['v_{min}/v_{Ref} = ',num2str(vmin(ivmin))],NaN,[-1,4],[0,70],'-','none','r',2,20,gca,0.9,0.7,0.7); 0109 end 0110 %