scan_vmin_vmax_Dlh

PURPOSE ^

R5-X2 - Script for running the LUKE solver in scan mode for Tph parametric dependences with vmin, vmax and Dlh

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

R5-X2 - Script for running the LUKE solver in scan mode for Tph parametric dependences with vmin, vmax and Dlh

 Script for running the LUKE solver in scan mode for Tph parametric dependences with vmin, vmax and Dlh

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 %R5-X2 - Script for running the LUKE solver in scan mode for Tph parametric dependences with vmin, vmax and Dlh
0002 %
0003 % Script for running the LUKE solver in scan mode for Tph parametric dependences with vmin, vmax and Dlh
0004 %
0005 %by Y.Peysson CEA/IRFM <yves.peysson@cea.fr> and Joan Decker CEA/IRFM (joan.decker@cea.fr)
0006 %
0007 clear all
0008 clear mex
0009 clear functions
0010 close all
0011 warning off
0012 %
0013 %
0014 % ***********************This part must be specified by the user, run make files if necessary) *****************************
0015 %
0016 id_simul0 = 'LH_karney';%Simulation ID
0017 path_simul = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path
0018 %
0019 psin_S = [];%Normalized poloidal flux grid where calculations are performed (0 < psin_S < 1) (If one value: local calculation only, not used if empty)
0020 rho_S = [0.3,0.7];%Normalized radial flux grid where calculations are performed (0 < rho_S < 1) (If one value: local calculation only, not used if empty)
0021 %
0022 id_path = '';%For all paths used by DKE solver
0023 path_path = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path
0024 %
0025 id_equil = 'TScirc';%For plasma equilibrium
0026 path_equil = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path
0027 %
0028 id_dkeparam = 'NONUNIFORM10010020';%For DKE code parameters
0029 path_dkeparam = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path
0030 %
0031 id_display = 'PARTIAL_VISUAL';%For output code display
0032 path_display = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path
0033 %
0034 id_hxr = 'TScirc';%For HXR diagnostic configuration
0035 path_hxr = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path
0036 
0037 %
0038 %************************************************************************************************************************************
0039 %************************************************************************************************************************************
0040 %************************************************************************************************************************************
0041 %
0042 [dkepath,equil,dkeparam,dkedisplay,hxr,hxrparam] = load_structures_yp('dkepath',id_path,path_path,'equil',id_equil,path_equil,'dkeparam',id_dkeparam,path_dkeparam,'dkedisplay',id_display,path_display,'hxr',id_hxr,path_hxr);
0043 %
0044 %************************************************************************************************************************************
0045 %
0046 dkeparam.boundary_mode_f = 1;%Number of points where the Maxwellian distribution is enforced from p = 0 (p=0, free conservative mode but param_inv(1) must be less than 1e-4, otherwise 1e-3 is OK most of the time. Sensitive to the number of points in p)
0047 dkeparam.norm_mode_f = 0;%Local normalization of f0 at each iteration: (0) no, the default value when the numerical conservative scheme is correct, (1) yes
0048 %
0049 dkeparam.np_S = 201;
0050 dkeparam.nmhu_S = 201;
0051 dkeparam.pnmax_S = 30;
0052 %
0053 dkeparam.bounce_mode = 0;
0054 %
0055 if exist('dmumpsmex');dkeparam.invproc = -2;end
0056 %
0057 dkedisplay.display_mode = 0;
0058 %
0059 %
0060 % C3PO computing parameters
0061 %
0062 scanparam.clustermode.scanloop.scheduler.mode = 2;%MatLab distributed computing environment disabled (0), enabled with the dedicated toolbox (1), enabled with a private method (2)for the function main_C3PO_jd.m (MDC toolbox must be installed for option 1)
0063 scanparam.clustermode.scanloop.scheduler.timeout = 500;%MatLab distributed computing environment time out (s). after time out is reached, calculations are performed in a sequential mode on a single processor
0064 scanparam.clustermode.scanloop.scheduler.clustersize = 12;%MatLab distributed computing environment cluster size. Can be Inf is all the processors of the cluster are free for distributed calculations
0065 %
0066 vmin = [3,3.5];
0067 vmax = [5.5,6.5,7.5];
0068 D0 = logspace(-3,1,20);
0069 epsi = [0:0.005:0.02];
0070 Te = [6];
0071 %
0072 fieldside = NaN;%Distribution enforced corresponding to 'HFS' (theta = pi) or 'LFS' (theta = 0). If NaN, exact trapping effects of the magnetic equilibrium are considered.
0073 chordview = 0;%No heliticity enforced: 0 (perp), 1 (forward) or -1 (backward). If NaN, the exact heliticity of the magnetic equilibrium is considered.
0074 %
0075 disp('---------------------------------------------------------------------');
0076 [clusterparam] = clustermode_luke(scanparam.clustermode,'scanloop',dkepath);
0077 for iD0 = 1:length(D0),arg_range{iD0} = iD0;end
0078 [flag,norm,curr,Tph,Tph_star] = mdce_run(@loop_scan_vmin_vmax_Dlh,{iD0,vmin,vmax,D0,epsi,Te,rho_S,dkepath,equil,dkeparam,dkedisplay,hxr,hxrparam,fieldside,chordview},1,arg_range,clusterparam);
0079 %
0080 norm1 = cell2mat(norm);
0081 curr1 = cell2mat(curr);
0082 Tph1 = cell2mat(Tph);
0083 Tph_star1 = cell2mat(Tph_star);
0084 %
0085 for ivmin = 1:length(vmin),
0086     figure,graph1D_jd(D0,norm1(ivmin:length(vmin):end,:),1,0,'D0','norm',['v_{min}/v_{Ref} = ',num2str(vmin(ivmin))],NaN,[-1,10],[0.95,1.05],'-','none','r',2,20,gca,0.9,0.7,0.7);
0087     figure,graph1D_jd(D0,curr1(ivmin:length(vmin):end,:),1,0,'D0','curr',['v_{min}/v_{Ref} = ',num2str(vmin(ivmin))],NaN,[-1,10],[0,max(max(curr1(ivmin:length(vmin):end,:)))],'-','none','r',2,20,gca,0.9,0.7,0.7);
0088     figure,graph1D_jd(D0,Tph1(ivmin:length(vmin):end,:),1,0,'D0','Tph',['v_{min}/v_{Ref} = ',num2str(vmin(ivmin))],NaN,[-1,10],[0,70],'-','none','r',2,20,gca,0.9,0.7,0.7);
0089     figure,graph1D_jd(D0,Tph_star1(ivmin:length(vmin):end,:),1,0,'D0','Tph*',['v_{min}/v_{Ref} = ',num2str(vmin(ivmin))],NaN,[-1,10],[0,70],'-','none','r',2,20,gca,0.9,0.7,0.7);
0090 end
0091 %

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