imake_wave_EVE_jd

PURPOSE ^

SYNOPSIS ^

function wave = imake_wave_EVE_jd(basestr,equil,workdir,opt_gui)

DESCRIPTION ^

 this function reads the EVE output data and creates the wave structure
 for LUKE FW diffusion coefficient

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function wave = imake_wave_EVE_jd(basestr,equil,workdir,opt_gui)
0002 %
0003 % this function reads the EVE output data and creates the wave structure
0004 % for LUKE FW diffusion coefficient
0005 %
0006 wave = '';
0007 %
0008 if isfield(equil,'prof_src') && exist(equil.prof_src,'file'),
0009     %
0010     filename = equil.prof_src;
0011     %
0012 else
0013     %
0014     [data_file,data_path] = igetfile_jd(opt_gui,'*.*','Please select the EVE output file :',workdir);
0015     %
0016     if data_file == 0,
0017         return
0018     else
0019         filename = [data_path,data_file];
0020     end
0021     %
0022 end
0023 %
0024 load(filename,'eve');
0025 %
0026 disp(['EVE output data for ',basestr,' equilibrium loaded from file : ',filename])
0027 %
0028 % The coefficients are defined such that the diffusion coefficient in energy is :
0029 %
0030 % Dql = D_EE + uperp^2 D_EB + uperp^4 D_BB
0031 %
0032 % where uperp is normalized to sqrt(2T/m) (local temperature)
0033 %
0034 [qe,me,mp,mn,e0,mu0,re,mc2,clum] = pc_dke_yp;
0035 %
0036 % xupar_S = eve.upar;%parallel velocity normalized to sqrt(2T/m)
0037 xupar = eve.upar;%parallel velocity normalized to sqrt(2T/m)
0038 yrho_S = eve.sg;%radial grid, SR of normalized toroidal flux
0039 %
0040 %xupar = (xupar_S(1:end-1) + xupar_S(2:end))/2;
0041 yrho = (yrho_S(1:end-1) + yrho_S(2:end))/2;
0042 %
0043 % xyD_EE = (eve.D_EE(1:end-1,1:end-1) + eve.D_EE(1:end-1,2:end) + eve.D_EE(2:end,1:end-1) + eve.D_EE(2:end,2:end))/4;% EE diffusion coefficient (not normalized)
0044 % xyD_EB = (eve.D_EB(1:end-1,1:end-1) + eve.D_EB(1:end-1,2:end) + eve.D_EB(2:end,1:end-1) + eve.D_EB(2:end,2:end))/4;% EE diffusion coefficient (not normalized)
0045 % xyD_BB = (eve.D_BB(1:end-1,1:end-1) + eve.D_BB(1:end-1,2:end) + eve.D_BB(2:end,1:end-1) + eve.D_BB(2:end,2:end))/4;% EE diffusion coefficient (not normalized)
0046 %
0047 xyD_EE = (eve.D_EE(:,1:end-1) + eve.D_EE(:,2:end))/2;% EE diffusion coefficient (not normalized)
0048 xyD_EB = (eve.D_EB(:,1:end-1) + eve.D_EB(:,2:end))/2;% EE diffusion coefficient (not normalized)
0049 xyD_BB = (eve.D_BB(:,1:end-1) + eve.D_BB(:,2:end))/2;% EE diffusion coefficient (not normalized)
0050 yTe = (eve.Te(1:end-1) + eve.Te(2:end))/2;%;% electron temperature (keV);
0051 %
0052 % universal normalization
0053 %
0054 nx = length(xupar);
0055 %
0056 ybetath_eve = sqrt(2*yTe/mc2).';
0057 xybetath_eve = repmat(ybetath_eve,[nx,1]);
0058 %
0059 xyuparc = xupar*ybetath_eve;% parallel velocity normalized to c
0060 %xyuparc_S = xupar_S*ybetath_eve;% parallel velocity normalized to c
0061 %
0062 xyD_EE = xyD_EE/(me*clum^2)^2;% normalized to (mc2)^2
0063 xyD_EB = xyD_EB/(me*clum^2)^2./xybetath_eve.^2;
0064 xyD_BB = xyD_BB/(me*clum^2)^2./xybetath_eve.^4;
0065 %
0066 % D// and D_EE are related by : D_EE = upar^2 D//.
0067 %
0068 % Thus D// will be normalized to (mc)^2
0069 %
0070 wave.id = 'EVE';
0071 wave.equil_id = equil.id;
0072 wave.model = 'FW';
0073 %
0074 wave.Xvpar = xyuparc;
0075 %wave.Xvpar_S = xyuparc_S;
0076 %
0077 xyuparc(xyuparc == 0) = eps;
0078 wave.XDql_LD = xyD_EE./xyuparc.^2;
0079 wave.XDql_MX = xyD_EB./xyuparc.^2;
0080 wave.XDql_TT = xyD_BB./xyuparc.^2;
0081 %
0082 wave.rho = yrho;
0083 wave.rho_S = yrho_S;
0084 %
0085 wave.rhotype = 't';%square root of normalized toroidal flux
0086 %
0087 wave.pe_eve = eve.pe_eve;
0088 wave.pe_dql = eve.pe_dql;
0089 %
0090 
0091 
0092

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