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 = 'Ohm_Zi';
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 dkeparam.boundary_mode_f = 0;
0063 dkeparam.norm_mode_f = 1;
0064 dkeparam.tn = [50000,100000];
0065
0066 dkeparam.psin_S = psin_S;
0067 dkeparam.rho_S = rho_S;
0068
0069 epsi = 0.001;
0070 betath = 0.01;
0071
0072 Zi_list = [1:20];
0073
0074 [qe,me,mp,mn,e0,mu0,re,mc2] = pc_dke_yp;
0075
0076 equil.pTe = betath^2*mc2*ones(size(equil.pTe));
0077 equil.pzTi = betath^2*mc2*ones(size(equil.pzTi));
0078
0079
0080 ohm = ohm_flat(equil,epsi);
0081
0082 for iZi = 1:length(Zi_list),
0083
0084 Zi = Zi_list(iZi);
0085 equil.zZi = [1,1,1,Zi];
0086 equil.pzni = [0;0;0;1/Zi]*equil.pne;
0087
0088 dkeparam.coll_mode = 0;
0089 [dummy,Zcurr] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0090 sigma_0(iZi) = Zcurr.x_0/epsi;
0091
0092 dkeparam.coll_mode = 1;
0093 [dummy,Zcurr] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0094 sigma_1(iZi) = Zcurr.x_0/epsi;
0095
0096 dkeparam.coll_mode = 2;
0097 [Znorm,Zcurr,ZP0,dke_out] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0098 if dke_out.residu_f{end}(end) <= dkeparam.prec0_f,
0099 sigma_2(iZi) = Zcurr.x_0/epsi;
0100 else
0101 sigma_2(iZi) = NaN;
0102 end
0103
0104 sigma_Lor(iZi) = sqrt(2/pi)*16./Zi;
0105
0106 end
0107
0108 sigma_Z1s = 1/100*sqrt(me*qe/10)/(1.65*mu0*e0^2);
0109
0110 Zi_Karney = [1,2,5,10];
0111 sigma_Karney_0 = [3.773,2.824,1.660,0.998];
0112 sigma_Karney_1 = [2.837,2.310,1.489,0.938];
0113 sigma_Karney_2 = [7.429,4.377,2.078,1.133];
0114
0115
0116
0117 format
0118
0119 delete res_Zi
0120
0121 diary res_Zi
0122
0123 disp(['Comparison LUKE/Karney/Spitzer - NR calculations (betath = 0.01)'])
0124 disp(['----------------------'])
0125 disp(['--> Zi = 1'])
0126 disp(['Linearized operator : sigma = ',num2str(sigma_2(1)),'/',num2str(sigma_Karney_2(1))])
0127 disp(['Maxwellian operator : sigma = ',num2str(sigma_0(1)),'/',num2str(sigma_Karney_0(1))])
0128 disp(['High-Velocity operator : sigma = ',num2str(sigma_1(1)),'/',num2str(sigma_Karney_1(1))])
0129 disp(['----------------------'])
0130 disp(['--> Zi = 2'])
0131 disp(['Linearized operator : sigma = ',num2str(sigma_2(2)),'/',num2str(sigma_Karney_2(2))])
0132 disp(['Maxwellian operator : sigma = ',num2str(sigma_0(2)),'/',num2str(sigma_Karney_0(2))])
0133 disp(['High-Velocity operator : sigma = ',num2str(sigma_1(2)),'/',num2str(sigma_Karney_1(2))])
0134 disp(['----------------------'])
0135 disp(['--> Zi = 5'])
0136 disp(['Linearized operator : sigma = ',num2str(sigma_2(5)),'/',num2str(sigma_Karney_2(3))])
0137 disp(['Maxwellian operator : sigma = ',num2str(sigma_0(5)),'/',num2str(sigma_Karney_0(3))])
0138 disp(['High-Velocity operator : sigma = ',num2str(sigma_1(5)),'/',num2str(sigma_Karney_1(3))])
0139 disp(['----------------------'])
0140 disp(['--> Zi = 10'])
0141 disp(['Linearized operator : sigma = ',num2str(sigma_2(10)),'/',num2str(sigma_Karney_2(4))])
0142 disp(['Maxwellian operator : sigma = ',num2str(sigma_0(10)),'/',num2str(sigma_Karney_0(4))])
0143 disp(['High-Velocity operator : sigma = ',num2str(sigma_1(10)),'/',num2str(sigma_Karney_1(4))])
0144
0145 diary off
0146
0147 figure(1),clf
0148
0149 leg = {'Linearized','High v limit','Maxwellian'};
0150 xlim = [0,max(Zi_list)];
0151 ylim = [0,8];
0152 xlab = 'Z_i';
0153 ylab = '\sigma';
0154 tit = '';
0155 siz = 20+14i;
0156
0157 graph1D_jd(Zi_list,sigma_2,0,0,xlab,ylab,tit,NaN,xlim,ylim,'-','none','r',2,siz,gca,0.9,0.7,0.7);
0158 graph1D_jd(Zi_list,sigma_1,0,0,'','','',NaN,xlim,ylim,'-','none','b',2,siz,gca);
0159 graph1D_jd(Zi_list,sigma_0,0,0,'','','',leg,xlim,ylim,'-','none','g',2,siz,gca);
0160 graph1D_jd(Zi_Karney,sigma_Karney_2,0,0,'','','',NaN,xlim,ylim,'none','+','r',2,siz,gca);
0161 graph1D_jd(Zi_Karney,sigma_Karney_1,0,0,'','','',NaN,xlim,ylim,'none','+','b',2,siz,gca);
0162 graph1D_jd(Zi_Karney,sigma_Karney_0,0,0,'','','',NaN,xlim,ylim,'none','+','g',2,siz,gca);
0163 graph1D_jd(Zi_list,sigma_Lor,0,0,'','','',NaN,xlim,ylim,'--','none','k',2,siz,gca);
0164 graph1D_jd(1,sigma_Z1s,0,0,'','','',NaN,xlim,ylim,'none','x','k',2,siz,gca);
0165
0166 set(gca,'ytick',[0:2:10])
0167 set(gca,'xtick',[0:5:max(Zi_list)])
0168
0169 print_jd(2,'fig_sigma_Zi','./figures',1)
0170
0171
0172
0173 eval(['save ',path_simul,'DKE_RESULTS_',id_equil,'_',id_simul,'.mat']);
0174 info_dke_yp(2,['Data saved in ',path_simul,'DKE_RESULTS_',id_equil,'_',id_simul,'.mat']);