loop_scan_vmin_vmax_Dlh

PURPOSE ^

R5-X2 - Loop function for running the LUKE solver in scan mode for Tph parametric dependences with vmin, vmax, Dlh, epsi and Te (flat profiles)

SYNOPSIS ^

function [norm,curr,Tph,Tph_star] = loop_scan_vmin_vmax_Dlh(iD0,vmin,vmax,D0,epsi,Te,rho_S,dkepath,equil,dkeparam,dkedisplay,hxr,hxrparam,fieldside,chordview)

DESCRIPTION ^

R5-X2 - Loop function for running the LUKE solver in scan mode for Tph parametric dependences with vmin, vmax, Dlh, epsi and Te (flat profiles)

 Loop function for running the LUKE solver in scan mode for Tph parametric dependences with vmin, vmax, Dlh, epsi and Te (flat profiles)

by Y.Peysson CEA/IRFM <yves.peysson@cea.fr> and Joan Decker CEA/IRFM (joan.decker@cea.fr)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [norm,curr,Tph,Tph_star] = loop_scan_vmin_vmax_Dlh(iD0,vmin,vmax,D0,epsi,Te,rho_S,dkepath,equil,dkeparam,dkedisplay,hxr,hxrparam,fieldside,chordview)
0002 %R5-X2 - Loop function for running the LUKE solver in scan mode for Tph parametric dependences with vmin, vmax, Dlh, epsi and Te (flat profiles)
0003 %
0004 % Loop function for running the LUKE solver in scan mode for Tph parametric dependences with vmin, vmax, Dlh, epsi and Te (flat profiles)
0005 %
0006 %by Y.Peysson CEA/IRFM <yves.peysson@cea.fr> and Joan Decker CEA/IRFM (joan.decker@cea.fr)
0007 %
0008 norm = zeros(length(vmin),length(vmax),length(epsi),length(Te));
0009 curr = zeros(length(vmin),length(vmax),length(epsi),length(Te));
0010 Tph = zeros(length(vmin),length(vmax),length(epsi),length(Te));
0011 Tph_star = zeros(length(vmin),length(vmax),length(epsi),length(Te));
0012 %
0013 for iTe = 1:length(Te),
0014     for iepsi = 1:length(epsi),
0015         for ivmin = 1:length(vmin),
0016             for ivmax = 1:length(vmax),
0017                 wavestruct.omega_lh = [4]*2*pi*1e9; %(GHz -> rad/s). Wave frequency [1,1] Indicative, no effect in small FLR limit opt_lh > 0
0018                 %Option parameter for cross-comparison between old LH code:
0019                 %    - (1): 1/vpar dependence
0020                 %    - (2): no 1/vpar dependence and old grid technique for Dlh calculations (Karney, Shoucri) (see rfdiff_dke_jd)
0021                 wavestruct.opt_lh = 2; % [1,1]
0022                 %
0023                 % Choose (vparmin_lh,vparmax_lh) or (Nparmin_lh,Nparmax_lh) for square n// LH wave power spectrum,
0024                 % or (Npar_lh,dNpar_lh) for Gaussian shape
0025                 %
0026                 wavestruct.norm_ref = 1;%Normalization procedure for the LH quasilinear diffusion coefficient and spectrum boundaries
0027                 %
0028                 wavestruct.yvparmin_lh = [vmin(ivmin)];%LH wave square N// Spectrum: Lower limit of the plateau (vth_ref or vth) [1,n_scenario_lh]
0029                 wavestruct.yvparmax_lh = [vmax(ivmax)];%LH wave square N// Spectrum: Upper limit of the plateau (vth_ref or vth) [1,n_scenario_lh]
0030                 %
0031                 wavestruct.yNparmin_lh = [NaN];%LH wave square N// Spectrum: Lower limit [1,n_scenario_lh]
0032                 wavestruct.yNparmax_lh = [NaN];%LH wave square N// Spectrum: Upper limit [1,n_scenario_lh]
0033                 wavestruct.yNpar_lh = [NaN];%LH wave Gaussian N// Spectrum: peak [1,n_scenario_lh]
0034                 wavestruct.ydNpar_lh = [NaN];%LH wave Gaussian N// Spectrum: width [1,n_scenario_lh]
0035                 %
0036                 %   Note: this diffusion coefficient is different from the general QL D0. It has a benchmarking purpose only
0037                 wavestruct.yD0_in_c_lh = [D0(iD0)];%Central LH QL diffusion coefficient (nhuth_ref*pth_ref^2 or nhuth*pth^2) [1,n_scenario_lh]
0038                 %
0039                 wavestruct.yD0_in_lh_prof = [0];%Quasilinear diffusion coefficient radial profile: (0) uniform, (1) gaussian radial profile [1,n_scenario_lh]
0040                 wavestruct.ypeak_lh = [0.4];%Radial peak position of the LH quasi-linear diffusion coefficient (r/a on midplane) [1,n_scenario_lh]
0041                 wavestruct.ywidth_lh = [0.2];%Radial width of the LH quasi-linear diffusion coefficient (r/a on midplane) [1,n_scenario_lh]
0042                 %
0043                 wavestruct.ythetab_lh = [0]*pi/180;%(deg -> rad). Poloidal location of LH beam [0..2pi] [1,n_scenario_lh]
0044                 %               (0) from local values Te and ne, (1) from central values Te0 and ne0
0045                 %
0046                 %************************************************************************************************************************************
0047                 %
0048                 equil.pTe = equil.pTe*0 + Te(iTe);
0049                 equil.pzTi = equil.pzTi*0 + Te(iTe);
0050                 %
0051                 waves{1} = make_idealLHwave_jd(equil,wavestruct);
0052                 %
0053                 ohm = ohm_profile_yp(equil,epsi(iepsi));
0054                 %
0055                 dkeparam.rho_S = rho_S;
0056                 %
0057                 [Znorm,Zcurr,ZP0,dke_out,radialDKE,equilDKE,momentumDKE,gridDKE,Zmomcoef,Zbouncecoef,Zmripple,mksa] = main_dke_yp(dkepath,'test',equil,dkeparam,dkedisplay,ohm,waves,[],[],[],[]);
0058                 %
0059                 dt = 1;%integration time step (s)
0060                 %
0061                 [Zbremchord,equilHXR] = bremchord_dke_yp(dkeparam,dkedisplay,equil,radialDKE,Zcurr,hxr,hxrparam);
0062                 [Zbremplasma] = bremsstrahlung_dke_yp(dkeparam,dkedisplay,equilHXR,radialDKE,mksa,momentumDKE,dke_out,Zbremchord,hxr,hxrparam,fieldside,chordview);%No magnetic field line effect (perp view)
0063                 [Zbremdiag] = bremdiag_dke_yp(Zbremplasma,hxr,hxrparam,dt);
0064                 %
0065                 norm(ivmin,ivmax,iepsi,iTe) = Znorm.x_0(1);
0066                 curr(ivmin,ivmax,iepsi,iTe) = Zcurr.x_0(1);
0067                 Tph(ivmin,ivmax,iepsi,iTe) = Zbremdiag.tphot_plasma;
0068                 Tph_star(ivmin,ivmax,iepsi,iTe) = Zbremdiag.tphot_plasma_exp;
0069             end
0070         end
0071     end
0072 end
0073

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