0001
0002
0003
0004 clear all
0005 clear mex
0006 clear functions
0007 close all
0008 warning off
0009 global nfig
0010
0011 p_opt = 2;
0012
0013 permission = test_permissions_yp;
0014
0015 if ~permission
0016 disp('Please move the script to a local folder where you have write permission before to run it')
0017 return;
0018 end
0019
0020
0021
0022 id_simul = 'Runaway_norm';
0023 path_simul = '';
0024
0025 psin_S = [];
0026 rho_S = [0.5];
0027
0028 id_path = '';
0029 path_path = '';
0030
0031 id_equil = 'TScyl';
0032 path_equil = '';
0033
0034 id_dkeparam = 'UNIFORM10010020';
0035 path_dkeparam = '';
0036
0037 id_display = 'NO_DISPLAY';
0038 path_display = '';
0039
0040 id_ohm = '';
0041 path_ohm = '';
0042
0043 ids_wave = {''};
0044 paths_wave = {''};
0045
0046 id_transpfaste = '';
0047 path_transpfaste = '';
0048
0049 id_ripple = '';
0050 path_ripple = '';
0051
0052
0053
0054
0055
0056 [dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple] = 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,'waves',ids_wave,paths_wave,'transpfaste',id_transpfaste,path_transpfaste,'ripple',id_ripple,path_ripple);
0057
0058
0059
0060 if exist('dmumpsmex');dkeparam.invproc = -2;end
0061
0062 betath = 0.001;
0063
0064 [qe,me,mp,mn,e0,mu0,re,mc2] = pc_dke_yp;
0065
0066 equil.pTe = betath^2*mc2*ones(size(equil.pTe));
0067 equil.pzTi = 1e-10*ones(size(equil.pzTi));
0068
0069 dkeparam.coll_mode = 0;
0070 dkeparam.timevol = 1;
0071
0072 dkeparam.psin_S = psin_S;
0073 dkeparam.rho_S = rho_S;
0074
0075 dtn = 100;
0076 nit = 100;
0077 tn_max = dtn*nit;
0078
0079 epsi = 0.04;
0080
0081 ohm = ohm_flat(equil,epsi);
0082
0083 RR_kulsrud = 1.914*1e-6;
0084
0085
0086
0087 dkeparam.dtn = dtn;
0088 dkeparam.tn = tn_max;
0089
0090 dkeparam.boundary_mode_f = 0;
0091 dkeparam.norm_mode_f = 0;
0092
0093 [dummy,dummy,dummy,dke_out_0] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0094
0095 xRRv_0 = NaN(1,nit);
0096 xRRs_0 = NaN(1,nit);
0097 for it=1:nit,
0098 xRRv_0(it) = (dke_out_0.normf0{it}(1) - dke_out_0.normf0{it}(end))/dtn;
0099 xRRs_0(it) = dke_out_0.XxRR_fsav{it}(end,:);
0100 end
0101
0102 dkeparam.boundary_mode_f = 1;
0103 dkeparam.norm_mode_f = 0;
0104
0105 [dummy,dummy,dummy,dke_out_1] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0106
0107 xRRv_1 = NaN(1,nit);
0108 xRRs_1 = NaN(1,nit);
0109 for it=1:nit,
0110 xRRv_1(it) = (dke_out_1.normf0{it}(1) - dke_out_1.normf0{it}(end))/dtn;
0111 xRRs_1(it) = dke_out_1.XxRR_fsav{it}(end,:);
0112 end
0113
0114 dkeparam.boundary_mode_f = 0;
0115 dkeparam.norm_mode_f = 1;
0116
0117 [dummy,dummy,dummy,dke_out_2] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0118
0119 xRRv_2 = NaN(1,nit);
0120 xRRs_2 = NaN(1,nit);
0121 for it=1:nit,
0122 xRRv_2(it) = (dke_out_2.normf0{it}(1) - dke_out_2.normf0{it}(end))/dtn;
0123 xRRs_2(it) = dke_out_2.XxRR_fsav{it}(end,:);
0124 end
0125
0126
0127
0128 figure(1),clf
0129
0130 leg = {'Volumic losses','Boundary losses','Runaway losses'};
0131 xlim = [0,tn_max];
0132 ylim = [1.5e-6,2e-6];
0133 xlab = 't/\tau_c';
0134 ylab = '\Gamma_R';
0135 tit = '';
0136 siz = 20+14i;
0137
0138 graph1D_jd(dtn:dtn:tn_max,xRRv_0,0,0,xlab,ylab,tit,NaN,xlim,ylim,'-','none','r',2,siz,gca,0.9,0.7,0.7);
0139 graph1D_jd(dtn:dtn:tn_max,xRRs_0,0,0,'','','',NaN,xlim,ylim,'--','none','r',2,siz,gca);
0140 graph1D_jd(xlim,[RR_kulsrud,RR_kulsrud],0,0,'','','',leg,xlim,ylim,'--','none','k',2,siz,gca);
0141 graph1D_jd(dtn:dtn:tn_max,xRRv_1,0,0,'','','',NaN,xlim,ylim,'-','none','b',2,siz,gca);
0142 graph1D_jd(dtn:dtn:tn_max,xRRs_1,0,0,'','','',NaN,xlim,ylim,'--','none','b',2,siz,gca);
0143 graph1D_jd(dtn:dtn:tn_max,xRRv_2,0,0,'','','',NaN,xlim,ylim,'-','none','g',2,siz,gca);
0144 graph1D_jd(dtn:dtn:tn_max,xRRs_2,0,0,'','','',NaN,xlim,ylim,'--','none','g',2,siz,gca);
0145
0146 print_jd(p_opt,'fig_runaway_norm','./figures',1)
0147
0148
0149
0150 eval(['save ',path_simul,'DKE_RESULTS_',id_equil,'_',id_simul,'.mat']);
0151 info_dke_yp(2,['Data saved in ',path_simul,'DKE_RESULTS_',id_equil,'_',id_simul,'.mat']);