make_ripple_TScirc

PURPOSE ^

**************************************************************************************************************

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

**************************************************************************************************************
************************************** MAGNETIC RIPPLE PARAMETERS ********************************************
**************************************************************************************************************
 Create the local file RIPPLE_id_equil.mat
 
by Y.Peysson CEA-DRFC <yves.peysson@cea.fr> and Joan Decker MIT-RLE (jodecker@mit.edu)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %**************************************************************************************************************
0002 %************************************** MAGNETIC RIPPLE PARAMETERS ********************************************
0003 %**************************************************************************************************************
0004 % Create the local file RIPPLE_id_equil.mat
0005 %
0006 %by Y.Peysson CEA-DRFC <yves.peysson@cea.fr> and Joan Decker MIT-RLE (jodecker@mit.edu)
0007 %
0008 clear all
0009 close all
0010 %
0011 display_mode = 0;%2i;%display option (0) no disply (1) text only (2) figrues (2i) figures with flux-surfaces spaced out
0012 p_opt = -1;%2;%print optiopn (-1) nothing (0) print (1) print & save (2) save only
0013 %
0014 id_equil = 'TScirc';
0015 id_ripple = 'TSspecific';
0016 %
0017 ripple.id = id_ripple;
0018 ripple.equil_id = id_equil;
0019 %
0020 %For the magnetic  ripple losses, the loss frequency must be very large compared to the reference frequency. Therefore it is always enforced in the code to 1000*nhu_ref
0021 %Consequently, the ripple parameter is just a flag which indicates if magnetic ripple calculations are considered or not. Calculations are only valid for Tore Supra tokamak
0022 %so the first two letters must be TS to be recognized in the calculations. See main_dke_yp.m
0023 %
0024 ripple.mode = 1;%No magnetic ripple if empty
0025 %
0026 ripple.N = 18;%Number of toroidal magnetic field coils
0027 %
0028 % For the Yushmanov model in Reviews of Plasma Physics, p.117-241, "Diffusive Transport Processes Caused by Ripple in Tokamaks" by P.N. Yushmanov, 1990.
0029 %
0030 ripple.B0 = 3.2;%Vacuum toroidal magnetic field on the toroidal axis, (signed value as BPHI) (T)
0031 ripple.R0 = 2.4;%Toroidal major radius of the toroidal magnetic field windings(m)
0032 ripple.rn = 1.0;%Inner radius of the toroidal magnetic field windings (m)
0033 ripple.rx = 1.48;%Outer radius of the toroidal magnetic field windings (m)
0034 %
0035 %*************************************************************************************************************
0036 %
0037 eval(['save RIPPLE_',id_equil,'_',id_ripple,'.mat ripple']);
0038 %
0039 % DIsplay some results
0040 %
0041 load ../EQUIL_files/EQUIL_TScirc.mat
0042 [equilDKE] = equilibrium_jd(equil,NaN,display_mode);%magnetic equilibrium for LUKE
0043 ripple_model = 3;%Yushmanov model
0044 %
0045 [aBx,aBy,aBz,delta_rho,delta_theta,delta_phi] = bripfield_yp(ripple,equilDKE,ripple_model);
0046 %
0047 imidradius = find(equilDKE.xrho==0.5);%mid radius index
0048 ipi = find(equilDKE.mtheta==pi);%indiex for theta = pi
0049 %
0050 if abs(display_mode) >= 2, 
0051     figure('Name','Radial magnetic ripple perturbation')
0052     graph1D_jd(equilDKE.mtheta(1:ipi),delta_rho(end,1:ipi),0,0,'\theta [rd]','\delta_{\rho}','Toroidal magnetic ripple (Tore Supra)',NaN,[0,pi],'','-','none','r',2,20,gca,0.9,0.7,0.7);
0053     graph1D_jd(equilDKE.mtheta(1:ipi),delta_rho(imidradius,1:ipi),0,0,'\theta [rd]','\delta_{\rho}','Toroidal magnetic ripple (Tore Supra)',NaN,[0,pi],'','--','none','b',2,20,gca,0.9,0.7,0.7);
0054     legend('Plasma edge','Mid radius','Location','NorthEast');
0055     print_jd(p_opt,[id_equil,'_',id_ripple,'_delta_rho'],'Figures');
0056     %
0057     figure('Name','Poloidal magnetic ripple perturbation')
0058     graph1D_jd(equilDKE.mtheta(1:ipi),delta_theta(end,1:ipi),0,0,'\theta [rd]','\delta_{\theta}','Toroidal magnetic ripple (Tore Supra)',NaN,[0,pi],'','-','none','r',2,20,gca,0.9,0.7,0.7);
0059     graph1D_jd(equilDKE.mtheta(1:ipi),delta_theta(imidradius,1:ipi),0,0,'\theta [rd]','\delta_{\theta}','Toroidal magnetic ripple (Tore Supra)',NaN,[0,pi],'','--','none','b',2,20,gca,0.9,0.7,0.7);
0060     legend('Plasma edge','Mid radius','Location','NorthEast');
0061     print_jd(p_opt,[id_equil,'_',id_ripple,'_delta_theta'],'Figures');
0062     %
0063     figure('Name','Toroidal magnetic ripple perturbation')
0064     graph1D_jd(equilDKE.mtheta(1:ipi),delta_phi(end,1:ipi),0,0,'\theta [rd]','\delta_{\phi}','Toroidal magnetic ripple (Tore Supra)',NaN,[0,pi],'','-','none','r',2,20,gca,0.9,0.7,0.7);
0065     graph1D_jd(equilDKE.mtheta(1:ipi),delta_phi(imidradius,1:ipi),0,0,'\theta [rd]','\delta_{\phi}','Toroidal magnetic ripple (Tore Supra)',NaN,[0,pi],'','--','none','b',2,20,gca,0.9,0.7,0.7);
0066     legend('Plasma edge','Mid radius','Location','NorthEast');
0067     print_jd(p_opt,[id_equil,'_',id_ripple,'_delta_phi'],'Figures');
0068     %
0069     nphi = linspace(0,2*pi,ripple.N*100);
0070     %
0071     figure('Name','Toroidal magnetic ripple perturbation')
0072     graph1D_jd(nphi,aBz(end,1)*cos(ripple.N*nphi)+ equilDKE.XBphi(end,1),0,0,'\phi [rd]','B_{\phi} [T]','Toroidal magnetic ripple (Tore Supra)',NaN,[0,2*pi],[min(equilDKE.XBphi(end,:))*0.5,max(equilDKE.XBphi(end,:))*1.5],'-','none','r',2,20,gca,0.9,0.7,0.7);
0073     graph1D_jd(nphi,aBz(end,ipi)*cos(ripple.N*nphi)+ equilDKE.XBphi(end,ipi),0,0,'\phi [rd]','B_{\phi} [T]','Toroidal magnetic ripple (Tore Supra)',NaN,[0,2*pi],[min(equilDKE.XBphi(end,:))*0.5,max(equilDKE.XBphi(end,:))*1.5],'--','none','b',2,20,gca,0.9,0.7,0.7);
0074     legend('Plasma edge (LFS)','Plasma edge (HFS)','Location','NorthEast');
0075     print_jd(p_opt,[id_equil,'_',id_ripple,'_B_phi'],'Figures');
0076     %
0077     %%%%%%%%%% Calcul des isoripple en courbes bleues et fines sur fond de courbes isoflux
0078     %
0079     figure(1),
0080     %
0081     xmin = min(min(equil.ptx));
0082     xmax = max(max(equil.ptx));
0083     ymin = min(min(equil.pty));
0084     ymax = max(max(equil.pty));
0085     %
0086     hold on
0087     graph2D_jd(equilDKE.Xx,equilDKE.Xy,log(delta_phi).','','','',[xmin,xmax],[ymin,ymax],0,NaN,NaN,0,'-','b',2,20);
0088     hold off
0089     print_jd(p_opt,[id_equil,'_',id_ripple,'_isoripple'],'Figures');
0090 end

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