This script generates the data file of an ideal circular equilibrium based on equilibrium profile parameters By J. Decker <joan.decker@cea.fr> and Y. Peysson <yves.peysson@cea.fr>
0001 function [] = make_equil_RTtest 0002 % 0003 % This script generates the data file of an ideal circular equilibrium based on 0004 % equilibrium profile parameters 0005 % 0006 % By J. Decker <joan.decker@cea.fr> and Y. Peysson <yves.peysson@cea.fr> 0007 % 0008 [qe,me,mp,mn,e0,mu0,re,mc2,clum] = pc_dke_yp; 0009 % 0010 npsi = 101;% number of points in psi grid 0011 ntheta = 65;% number of points in theta grid 0012 % 0013 % Equilibrium parameters 0014 % 0015 Rp = 3.0;% Plasma major radius on axis (m) 0016 ap = 0.3*Rp; 0017 Zp = 0.0; 0018 Ip = 1;% Signed value of the plasma current (MA) (with x,y,z direct) 0019 Bt = 3.0;% Signed value of the toroidal magnetic field on the magnetic axis (T) (with x,y,z direct) 0020 % 0021 Zi = [1,1,1,6];% Ion types: (1) H/D/T, (2) He, ..., (6) C [1,p] (WARNING: Zi must be [1,1,1,imp1,imp2] for hydrogen plasmas) 0022 mi = [1,2,3,12];% Ion mass (uma) [1,p] (WARNING: Zi must be [1,2,3,mimp1,mimp2] for hydrogen plasmas) 0023 fi = [0,1,0];% Hydrogen isotopic fraction (H/D/T) [1,3] (WARNING: only used when hydrogen plasmas are considered) 0024 % 0025 qmin_Rpap = 1/0.3;%Safety factor q0_Rpap at plasma center normalized to Rp/ap 0026 eq = 2;% Exponent for q_Rpap radial profile (q = (qmax - qmin)*(r/a).^eq + qmin, qmax calaculated by the Ampere's theorem at the plasma edge with a circular plasma cross-section) 0027 qopt = 1;%Option for q profile. 0028 % 0029 Te0 = 4.0;% Core electron temperature (keV) 0030 Tea = Te0/10;% Edge electron temperature (keV) 0031 eTe = 1.0;% Exponent for Te profile (Te(r) = (Te0-Tea)*(1-(r/a)^2)^eTe + Tea) 0032 % 0033 ne0 = 3.0e19;% Core electron density (m-3) 0034 nea = 1e-10;% Edge electron density (m-3) 0035 ene = 1.0;% Exponent for ne profile (ne(r) = (ne0-nea)*(1-(r/a)^2)^ene + nea) 0036 % 0037 Ti0 = Te0;% Core ion temperature (keV) 0038 Tia = Ti0/10;% Edge ion temperature (keV) 0039 eTi = 1.0;% Exponent for Ti profile (Ti(r) = (Ti0-Tia)*(1-(r/a)^2)^eTi + Tia) 0040 % 0041 Zeff0 = 1;% Core effective charge (a.u.) 0042 Zeffa = 1;% Edge effective charge (a.u.) 0043 eZeff = 0;% Exponent for the effective charge (Zeff(r) = (Zeff0-Zeffa)*(1-(r/a)^2)^eZeff + Zeffa) 0044 % 0045 % Plasma parameters 0046 % 0047 [prho,equil_prof.pTe,equil_prof.pne,equil_prof.pzTi,equil_prof.pzni,equil_prof.zZi,equil_prof.zmi,equil_prof.fi,pkin] = idealprof_yp(Zi,mi,fi,Te0,Tea,2,eTe,ne0,nea,2,ene,Ti0,Tia,2,eTi,Zeff0,Zeffa,eZeff,NaN,npsi);%Profiles 0048 % 0049 %Magnetic equilibrium 0050 % 0051 [ppsin,equil_mag.psi_apRp,equil_mag.theta,equil_mag.ptx,equil_mag.pty,equil_mag.ptBx,equil_mag.ptBy,equil_mag.ptBPHI,pBpp,pq_Rpap,pj,pmag,Ip_test] = idealequilcyl_yp(ap,Rp,Zp,Bt,Ip,qmin_Rpap,eq,qopt,npsi,ntheta);%Cylindrical magnetic equilibrium 0052 % 0053 equil_mag.Rp = Rp; 0054 equil_mag.Zp = Zp; 0055 % 0056 equil = conc_struct_jd(equil_mag,equil_prof); 0057 equil.id = 'RTtest';% 0058 % 0059 filename = ['EQUIL_',equil.id,'.mat']; 0060 % 0061 eval(['save ',filename,' equil']) 0062 % 0063 0064