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 = 'Thermal';
0023 path_simul = '';
0024
0025 id_path = '';
0026 path_path = '';
0027
0028 psin_S = [0.001];
0029 rho_S = [];
0030
0031 id_equil = 'TScirc';
0032 path_equil = '';
0033
0034 id_dkeparam = '';
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 nit = 20;
0057 boundary_mode_f = 1;
0058 coll_mode = 2;
0059
0060 id_dkeparam = 'UNIFORM10010020';
0061 path_dkeparam = '';
0062 [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);
0063 dkeparam.boundary_mode_f = boundary_mode_f;
0064 dkeparam.coll_mode = coll_mode;
0065 dkeparam.dtn = dkeparam.tn;
0066
0067 dkeparam.psin_S = psin_S;
0068 dkeparam.rho_S = rho_S;
0069
0070 if exist('dmumpsmex');dkeparam.invproc = -2;end
0071
0072 [Znorm_u,Zcurr_u,ZP0_u,dke_out_u,radialDKE_u,equilDKE_u,momentumDKE_u,gridDKE_u,Zmomcoef_u,Zbouncecoef_u,Zmripple_u,mksa,XXsinksource_u] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0073 ne_u(1) = Znorm_u.x_0_fsav;
0074 for i = 2:nit,
0075 [Znorm_u,Zcurr_u,ZP0_u,dke_out_u] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,dke_out_u.XXf0,[]);
0076 ne_u(i) = Znorm_u.x_0_fsav;
0077 end
0078
0079 id_dkeparam = 'NONUNIFORM10010020';
0080 path_dkeparam = '';
0081 [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);
0082 dkeparam.boundary_mode_f = boundary_mode_f;
0083 dkeparam.coll_mode = coll_mode;
0084 dkeparam.dtn = dkeparam.tn;
0085
0086 dkeparam.psin_S = psin_S;
0087 dkeparam.rho_S = rho_S;
0088
0089 if exist('dmumpsmex');dkeparam.invproc = -2;end
0090
0091 [Znorm,Zcurr,ZP0,dke_out,radialDKE,equilDKE,momentumDKE,gridDKE,Zmomcoef,Zbouncecoef,Zmripple,mksa,XXsinksource] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0092 ne(1) = Znorm.x_0_fsav;
0093 for i = 2:nit,
0094 [Znorm,Zcurr,ZP0,dke_out] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,dke_out.XXf0,[]);
0095 ne(i) = Znorm.x_0_fsav;
0096 end
0097
0098 figure(1),clf,
0099 graph1D_jd([1:nit]*dkeparam.dtn,ne_u*mksa.ne_ref,0,0,'Integration time step (t_{coll})','Electron density (10^{+19} m^{-3)}',['Maxwellian distr., dtn = ',int2str(dkeparam.dtn)],NaN,'','','-','+','r',2,20,gca,1,0.6,0.6);hold on
0100 graph1D_jd([1:nit]*dkeparam.dtn,ne*mksa.ne_ref,0,0,'Integration time step (\tau_{coll})','Electron density (10^{+19} m^{-3)}',['Maxwellian distr., dtn = ',int2str(dkeparam.dtn)],NaN,'','','-','o','b',2,20,gca,1,0.6,0.6);
0101 axis([0,nit*dkeparam.dtn,mksa.ne_ref*0.98,mksa.ne_ref*1.02])
0102 line([0,20]*dkeparam.dtn,[mksa.ne_ref,mksa.ne_ref],'Color','red')
0103 legend('Uniform','Non-uniform','Location','SouthWest');
0104
0105
0106
0107 id_dkeparam = 'UNIFORM10010020';
0108 path_dkeparam = '';
0109 [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);
0110 equil.pzTi = equil.pzTi/2;
0111 dkeparam.boundary_mode_f = boundary_mode_f;
0112 dkeparam.coll_mode = coll_mode;
0113 dkeparam.dtn = dkeparam.tn;
0114
0115 dkeparam.psin_S = psin_S;
0116 dkeparam.rho_S = rho_S;
0117
0118 if exist('dmumpsmex');dkeparam.invproc = -2;end
0119
0120 [Znorm_u1,Zcurr_u1,ZP0_u1,dke_out_u1,radialDKE_u1,equilDKE_u1,momentumDKE_u1,gridDKE_u1,Zmomcoef_u1,Zbouncecoef_u1,Zmripple_u1,mksa,XXsinksource_u1] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0121 ne_u1(1) = Znorm_u1.x_0_fsav;
0122 for i = 2:nit,
0123 [Znorm_u1,Zcurr_u1,ZP0_u1,dke_out_u1] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,dke_out_u1.XXf0,[]);
0124 ne_u1(i) = Znorm_u1.x_0_fsav;
0125 end
0126
0127 id_dkeparam = 'NONUNIFORM10010020';
0128 path_dkeparam = '';
0129 [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);
0130 equil.pzTi = equil.pzTi/2;
0131 dkeparam.boundary_mode_f = boundary_mode_f;
0132 dkeparam.coll_mode = coll_mode;
0133 dkeparam.dtn = dkeparam.tn;
0134
0135 dkeparam.psin_S = psin_S;
0136 dkeparam.rho_S = rho_S;
0137
0138 if exist('dmumpsmex');dkeparam.invproc = -2;end
0139
0140 [Znorm1,Zcurr1,ZP01,dke_out1,radialDKE1,equilDKE1,momentumDKE1,gridDKE1,Zmomcoef1,Zbouncecoef1,Zmripple1,mksa,XXsinksource1] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,[],[]);
0141 ne1(1) = Znorm1.x_0_fsav;
0142 for i = 2:nit,
0143 [Znorm1,Zcurr1,ZP01,dke_out1] = main_dke_yp(id_simul,dkepath,equil,dkeparam,dkedisplay,ohm,waves,transpfaste,ripple,dke_out1.XXf0,[]);
0144 ne1(i) = Znorm1.x_0_fsav;
0145 end
0146
0147 figure(2),clf,graph1D_jd([1:nit]*dkeparam.dtn,ne_u1*mksa.ne_ref,0,0,'Integration time step (t_{coll})','Electron density (10^{+19} m^{-3)}',['Maxwellian distr., dtn = ',int2str(dkeparam.dtn)],NaN,'','','-','+','r',2,20,gca,1,0.6,0.6);
0148 graph1D_jd([1:nit]*dkeparam.dtn,ne1*mksa.ne_ref,0,0,'Integration time step (\tau_{coll})','Electron density (10^{+19} m^{-3)}',['Ti = Te/2, Maxwellian distr., dtn = ',int2str(dkeparam.dtn)],NaN,'','','-','o','b',2,20,gca,1,0.6,0.6);
0149 axis([0,nit*dkeparam.dtn,mksa.ne_ref*0.97,mksa.ne_ref*1.03])
0150 line([0,20]*dkeparam.dtn,[mksa.ne_ref,mksa.ne_ref],'Color','red')
0151 legend('Uniform','Non-uniform','Location','SouthWest');
0152
0153 print_jd(p_opt,'thermaldensity','./figures',1)
0154
0155
0156 eval(['save ',path_simul,'DKE_RESULTS_',id_equil,'_',id_simul,'.mat']);
0157 info_dke_yp(2,['Data saved in ',path_simul,'DKE_RESULTS_',id_equil,'_',id_simul,'.mat']);