Contents
RAPTOR Tutorial 6: Time varying kinetic profiles
Example of how to input time-varying kinetic profiles ne,ni,ti,zeff These are provided externally to the simulation.5
addpath(fullfile(pwd,'..','RAPTOR_code'),'-end'); % add RAPTOR path % % load the default parameters, [~,params] = RAPTOR_config; % load default params [model,params] = RAPTOR_config(params); % generate model structure for these params. params.dispopts.iterdisp = 10; % display every 10 % simple inputs: constant current plasma U = 200e3*ones(size(params.grid.tgrid)); % input Ip trace % initial conditions [x0,g0,v0] = RAPTOR_initial_conditions(U(1),model,params); % Define the initial condition
Scaling Te initial condition to match edge value in params.BC.Te.value=(50)
time varying ne: scale it
ne0 = v0(model.ne.ind); V0 = repmat(v0,1,params.ntgrid); nefactor = linspace(1,3,params.ntgrid); nefactor(round(numel(nefactor)/2):end) = nefactor(round(numel(nefactor)/2)); V0(model.ne.ind,:) = bsxfun(@times,ne0,nefactor); simres = RAPTOR_predictive(x0,g0,V0,U,model,params);
istep telaps newt res t[ms] dt[ms] IpkA Icd[kA] Ibs[kA] Ioh[kA] qe qmin q0 Vl[V] Te0[keV] ne0[e19] Wi[kJ] We[kJ] f_ss
1 0.04 6 2.7e-14 0 1.0 199.9 0.00 11.86 188.17 6.36 2.70 2.70 1.1e+01 0.31 2.00 0.48 0.50 4.5e+01
11 0.29 4 9.0e-13 10 1.0 200.0 0.00 14.88 185.29 6.36 1.88 1.88 4.5e+00 0.58 2.80 0.79 0.73 1.5e+01
21 0.52 5 1.8e-13 20 1.0 200.0 0.00 15.06 185.12 6.36 1.20 1.20 4.1e+00 0.63 3.60 0.95 0.71 1.1e+01
31 0.76 5 1.5e-13 30 1.0 200.0 0.00 14.95 185.23 6.36 0.88 0.88 3.8e+00 0.67 4.00 1.06 0.70 7.2e+00
41 0.97 4 3.8e-13 40 1.0 200.0 0.00 14.63 185.55 6.36 0.73 0.73 3.5e+00 0.73 4.00 1.14 0.72 4.9e+00
51 1.17 4 1.8e-13 50 1.0 200.0 0.00 14.45 185.72 6.36 0.65 0.65 3.3e+00 0.77 4.00 1.20 0.74 3.4e+00
time varying Zeff
ze0 = v0(model.ze.ind); V0 = repmat(v0,1,params.ntgrid); % reset to old values zefactor = 1+linspace(1,0,numel(ze0))'*linspace(0,2,params.ntgrid); % Zeff ramp by factor 3 in core only, keep edge fixed V0(model.ze.ind,:) = bsxfun(@times,ze0,zefactor); simres = RAPTOR_predictive(x0,g0,V0,U,model,params); % end of tutorial
istep telaps newt res t[ms] dt[ms] IpkA Icd[kA] Ibs[kA] Ioh[kA] qe qmin q0 Vl[V] Te0[keV] ne0[e19] Wi[kJ] We[kJ] f_ss
1 0.04 6 2.7e-14 0 1.0 199.9 0.00 11.86 188.17 6.36 2.70 2.70 1.1e+01 0.31 2.00 0.48 0.50 4.5e+01
11 0.21 3 9.2e-14 10 1.0 199.9 0.00 13.68 186.48 6.36 1.99 1.99 4.1e+00 0.67 2.00 0.77 0.86 1.3e+01
21 0.37 3 4.4e-14 20 1.0 200.0 0.00 13.24 186.92 6.36 1.38 1.38 3.5e+00 0.86 2.00 0.90 0.97 8.5e+00
31 0.53 3 5.7e-14 30 1.0 200.0 0.00 13.23 186.92 6.36 1.07 1.07 3.2e+00 1.01 2.00 0.99 1.06 5.7e+00
41 0.68 3 1.6e-13 40 1.0 200.0 0.00 13.43 186.73 6.36 0.92 0.92 3.1e+00 1.14 2.00 1.05 1.14 3.8e+00
51 0.81 2 4.8e-13 50 1.0 200.0 0.00 13.70 186.46 6.36 0.83 0.83 3.0e+00 1.25 2.00 1.09 1.20 2.5e+00