make_equil_ITER_Scen4

PURPOSE ^

script make_equil_ITER_Scen4

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

script make_equil_ITER_Scen4

 This script creates the equil strucure for CMOD to be used by DKE
   based on the eqdsk file and some profile data

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %script make_equil_ITER_Scen4
0002 %
0003 % This script creates the equil strucure for CMOD to be used by DKE
0004 %   based on the eqdsk file and some profile data
0005 %
0006 clear all
0007 close all
0008 %
0009 % ITER signs (clockwise from top)
0010 %
0011 basestr ='ITER';
0012 %
0013 signs.Ip = 1;
0014 signs.Bt = 1;
0015 %
0016 % path
0017 %
0018 id_dkepath = '';%For all paths used by DKE solver
0019 path_dkepath = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path
0020 %
0021 [dkepath] = load_structures_yp('dkepath',id_dkepath,path_dkepath);
0022 %
0023 % file name
0024 %
0025 id_equil = 'Scen4';
0026 source_path = 'Source_files/';
0027 %
0028 eqdsk_file = [id_equil,'.efit'];
0029 eqdsk_path = source_path;
0030 %
0031 profname = [eqdsk_path,id_equil,'.prof'];
0032 type = 0.2;
0033 Zeff = NaN;
0034 %
0035 display_mode = 0;
0036 p_opt = -1;
0037 dispname = 'ITER Scenario 4';
0038 savename = 'ITER_Scen4';
0039 %
0040 % RZ2PT options
0041 %
0042 opt.sfac = 10;% factor for (x,y) supergrid
0043 opt.axenforce = true;% option to enforce center position and psi value in supergrid
0044 %
0045 % --------------------------------------------------------------
0046 %
0047 [equil_magnetic,mrho,mspsin,mspsinT,mp_magnetic] = equil_magnetic_EFIT_jd([eqdsk_path,eqdsk_file],display_mode,p_opt,dispname,savename,opt);
0048 equil_prof = equil_prof_jd(profname,type,mrho,mspsin,mspsinT,display_mode,p_opt,dispname,savename,Zeff);
0049 %
0050 % signs
0051 %
0052 if signs.Ip*equil_magnetic.psi_apRp(end) < 0,
0053     equil_magnetic.psi_apRp = -equil_magnetic.psi_apRp;
0054     equil_magnetic.ptBx = -equil_magnetic.ptBx;
0055     equil_magnetic.ptBy = -equil_magnetic.ptBy;
0056 end
0057 %
0058 if signs.Bt*equil_magnetic.ptBPHI(1,1) < 0,
0059     equil_magnetic.ptBPHI = -equil_magnetic.ptBPHI;
0060 end
0061 %
0062 equil = conc_struct_jd(equil_magnetic,equil_prof);
0063 %
0064 equil.signs = signs;
0065 equil.id = [basestr,'_',id_equil];
0066 %
0067 savestr = ['EQUIL_',equil.id];
0068 save(savestr,'equil');
0069 disp(['equilibrium saved in file ',savestr,'.'])

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