forked from arichar6/raycon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdata.m
411 lines (393 loc) · 20.5 KB
/
data.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
function promptStr = data(type)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DATA -- User input modifying preset values
% Part of the RAYcON package
%
% A. JAUN, Alfven Laboratory, KTH, 100 44 Stockholm, Sweden
% A.N. KAUFMAN, Lawrence Berkeley Laboratory, Berkeley, CA 94720, USA
% E.R. TRACY, College of William & Mary, Williamsburg, VA 23187-8795, USA
%
% (C) Version 7.0, 14-Aug-2006. All Rights Reserved.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global ... % Dimensions and flow control
plasma ... % plasma configuration, fields, temperature, antenna, etc
cnst...
rays
%
% ----- Editable textfields
%
if strcmp(type,'MS simple ')
str=strvcat( ...
' %===== SIMPLE TEST WITH 4D MODEL IN LARGE ASPECT RATIO GEOMETRY ===================',...
' global EQ NS NT b0 elong iaspr q0 r0 n0 na nb t0 ta tb acharge amass',...
' global MODEL TYPE NRAY freq kant sant thant timespan',...
' ',...
' % ----- Equilibrium',...
' EQ= ''Solovev''; % Analytical Solovev equilibrium',...
' NS=21; NT=21; % spatial mesh points',...
' b0=4.; % axis magnetic field [Tesla]',...
' r0=1000.; % axis major radius [m]',...
' q0=100.; % axis safety factor',...
' iaspr=0.001; % inverse aspect ratio',...
' elong=1.; % elongation',...
' ',...
' % ----- Plasma species and response',...
' MODEL=''MSwave''; % tensor (cld1x1, cld2x2, cld3x3)',...
' amass=[1/1836 2]; % atomic mass [a.u.]',...
' acharge=[-1 1]; % atomic charge [a.u.]',...
' n0=[1. 1.]*3E19; % densities on axis [1/m^3]',...
' na=[1 .9 .9]; nb=[1 1 1]; % density profile factors',...
' t0=[1 1 1]; % temperature on axis [keV]',...
' ta=[1 1 1]; tb=[1 1 1]; % temperature profile factors',...
' % ----- Rays',...
' NRAY = 1; % number of rays to trace',...
' sant=.5; thant=[pi; pi/4]; % antenna position in (s,theta)',...
' freq = 40E+6; % antenna frequency [Hz]',...
' kant = [0 5 0]; % wave vector in (r,phi,z) [1/m]',...
' timespan = 10; % Evolution time span',...
' TYPE=''Trj''; % calculation (Trj,Con,Amp)',...
' ');
%
%
elseif strcmp(type,'MS tokamak ')
str=strvcat( ...
' %===== MAGNETOSONIC RAY IN A CONVENTIONAL TOKAMAK =================================',...
' global EQ NS NT b0 elong iaspr q0 r0 n0 na nb t0 ta tb acharge amass',...
' global MODEL TYPE NRAY freq kant sant thant timespan',...
' ',...
' % ----- Equilibrium',...
' EQ = ''Solovev''; % analytical Solovev',...
' NS = 21; NT = 21; % spatial mesh points',...
' b0 = 3.; % axis magnetic field [Tesla]',...
' r0 = 3.; % axis major radius [m]',...
' q0 = 1.1; % axis safety factor',...
' iaspr = 0.33; % inverse aspect ratio',...
' elong = 1.35; % elongation',...
' ',...
' % ----- Plasma species and response',...
' MODEL = ''cld2x2''; % tensor (cld1x1, cld2x2, cld3x3)',...
' amass = [1/1836 2 1]; % atomic mass [a.u.]',...
' acharge = [-1 1 1]; % atomic charge [a.u.]',...
' n0 = [1. 1. 0.]*1E19; % densities on axis [1/m^3]',...
' na=[1 .9 .9]; nb=[1 1 1]; % density profile factors',...
' t0=[1 1 1]; % temperature on axis [keV]',...
' ta=[1 1 1]; tb=[1 1 1]; % temperature profile factors',...
' % ----- Rays',...
' NRAY = 3; % number of rays to trace',...
' sant = 0.8; thant = [-pi/4; pi/4]; % antenna position in (s,theta)',...
' freq = 60E+6; % antenna frequency [Hz]',...
' kant = [-9 6 0]; % wave vector in (r,phi,z) [1/m]',...
' timespan = 10; % Evolution time span',...
' TYPE=''Trj''; % calculation (Trj,Con,Amp)',...
' ',...
' % thant(1)=pi; kant=[3 0 0];',...
' ');
%
%
elseif strcmp(type,'MC tokamak ')
str=strvcat( ...
' %===== DEFAULT PARAMETERS DEFINED IN ''data.m'' ===================================',...
' global EQ NS NT b0 elong iaspr q0 r0 n0 na nb t0 ta tb acharge amass',...
' global PROBL MODEL TYPE NRAY freq kant sant thant timespan',...
' ',...
' % ----- Equilibrium',...
' EQ = ''Solovev''; % analytical Solovev',...
' NS = 32; NT = 18; % spatial mesh points',...
' b0 = 3.; % axis magnetic field [Tesla]',...
' r0 = 3.; % axis major radius [m]',...
' q0 = 1.1; % axis safety factor',...
' iaspr = 0.33; % inverse aspect ratio',...
' elong = 1.35; % elongation',...
' ',...
' % ----- Plasma species and response',...
' MODEL = ''cld3x3''; % tensor (cld1x1, cld2x2, cld3x3)',...
' amass = [1/1836 2 1]; % atomic mass [a.u.]',...
' acharge = [-1 1 1]; % atomic charge [a.u.]',...
' n0 = [1 0.10 0.90]*1E19; % densities on axis [1/m^3]',...
' na=[1 .9 .9]; nb=[1 1 1]; % density profile factors',...
' t0=[1 1 1]; % temperature on axis [keV]',...
' ta=[1 1 1]; tb=[1 1 1]; % temperature profile factors',...
' % ----- Rays',...
' NRAY = 3; % number of rays to trace',...
' sant = 0.6; thant = [-pi/4; pi/4]; % antenna position in (s,theta)',...
' freq = 28E+6; % antenna frequency [Hz]',...
' kant = [-5 4 3]; % wave vector in (r,phi,z) [1/m]',...
' timespan = 10; % Evolution time span',...
' TYPE=''Trj''; % calculation (Trj,Con,Amp)',...
' ',...
' ');
%
% ===== Datasets not embedded into window GUI ===============================
%
% ----- Alcator C-MOD (Courtesy P. Bonoli 2003)
% Modified by Steve Richardson 2008 to match simulation reported in
% Physics of Plasmas Vol. 11, No. 5, May 2004, p. 2473
%
elseif strcmp(type,'cmod')
plasma.EQ= 'Solovev'; % Analytical Solovev equilibrium
plasma.NS=40; plasma.NT=45; % spatial mesh points
plasma.NK=20;
plasma.b0=7.9; % axis magnetic field [Tesla]
%plasma.b0=5.4;
plasma.r0=0.67; % axis major radius [m]
plasma.q0=2.0E+0; % axis safety factor
plasma.iaspr=0.22/0.67; % inverse aspect ratio
plasma.elong=1.6; % elongation
% Plasma species and response
plasma.PROBL='tok';
plasma.MODEL='cld2x2'; % tensor (MSwave, cld2x2, cld3x3)
plasma.amass=[1/1836 2 3]; % atomic mass [a.u.]
plasma.acharge=[-1 1 2]; % atomic charge [a.u.]
% plasma.n0=[10. 9 .5]*1E19; % densities on axis [1/m^3]
plasma.n0=[10. 5.2 2.4]*1E19; % densities on axis [1/m^3]
% plasma.n0=[10. 8 1]*1E19; % densities on axis [1/m^3]
% plasma.amass=[1/1836 1 2]; % atomic mass [a.u.]
% plasma.acharge=[-1 1 1]; % atomic charge [a.u.]
% plasma.n0=[10. 1 9]*1E19; % densities on axis [1/m^3]
% plasma.na=[1 .9 .9]; plasma.nb=[3 3 3]; % density profile factors
plasma.na=[1 .7 .7]; plasma.nb=[3 3 3]; % density profile factors
plasma.t0=[3 3 3]; % temperatures on axis [keV]
plasma.ta=[1 1 1]; plasma.tb=[1 1 1]; % temperatures profile factors
plasma.sant=.4;
plasma.thant=[-.61; .6]; % antenna ray pencil in (s,theta)
plasma.freq = 80E+6; % antenna frequency [Hz]
%plasma.freq = 70E+6; % this is to get rid of IC resonance
plasma.kant = [-31.5 10 0.]; % wave vector in (r,phi,z) [1/m]
% Set values of parameters derived from the above data
plasma.psin=0.5*plasma.b0/plasma.q0* ...
plasma.elong*(plasma.r0*plasma.iaspr)^2; % magnetic flux at edge
plasma.omega = 2*pi*plasma.freq; % circular frequency [rad/sec]
plasma.depo=zeros(20,length(plasma.amass)); % Deposition profiles
% why is this 20? Probably #bins in s, but why not NS?
str=type;
%
% ----- Alcator C-MOD for LH
%
elseif strcmp(type,'cmod-LH')
plasma.EQ= 'Solovev'; % Analytical Solovev equilibrium
plasma.NS=40; plasma.NT=45; % spatial mesh points
plasma.NK=20;
plasma.b0=5.5; % axis magnetic field [Tesla]
plasma.r0=0.67; % axis major radius [m]
plasma.q0=1.0E+0; % axis safety factor
plasma.iaspr=0.22/0.67; % inverse aspect ratio
plasma.elong=1.6; % elongation
% Plasma species and response
plasma.PROBL='tok';
plasma.MODEL='cld3x3'; % tensor (MSwave, cld2x2, cld3x3)
plasma.amass=[1/1836 2]; % atomic mass [a.u.]
plasma.acharge=[-1 1]; % atomic charge [a.u.]
plasma.n0=[1 1]*1E20; % densities on axis [1/m^3]
plasma.na=[1 .7]; plasma.nb=[3 3]; % density profile factors
plasma.t0=[5 5]; % temperatures on axis [keV]
plasma.ta=[1 1]; plasma.tb=[1 1]; % temperatures profile factors
plasma.sant=.7;
plasma.thant=[-.5; .5]; % antenna ray pencil in (s,theta)
plasma.freq = 4.6E+9; % antenna frequency [Hz]
plasma.kant = [-35 10 0.]; % wave vector in (r,phi,z) [1/m]
% Set values of parameters derived from the above data
plasma.psin=0.5*plasma.b0/plasma.q0* ...
plasma.elong*(plasma.r0*plasma.iaspr)^2; % magnetic flux at edge
plasma.omega = 2*pi*plasma.freq; % circular frequency [rad/sec]
plasma.depo=zeros(20,length(plasma.amass)); % Deposition profiles
% why is this 20? Probably #bins in s, but why not NS?
str=type;
%
% ----- LH slab example, for calculating caustics
%
elseif strcmp(type,'LH-ce')
plasma.EQ= 'Solovev'; % Analytical Solovev equilibrium
plasma.NS=40; plasma.NT=45; % spatial mesh points
plasma.NK=20;
plasma.b0=5.5; % axis magnetic field [Tesla]
plasma.r0=0.67; % axis major radius [m]
plasma.q0=2.0E+0; % axis safety factor
plasma.iaspr=0.22/0.67; % inverse aspect ratio
plasma.elong=1.6; % elongation
% Plasma species and response
plasma.PROBL='tok';
plasma.MODEL='cld3x3'; % tensor (MSwave, cld2x2, cld3x3)
plasma.amass=[1/1836 2]; % atomic mass [a.u.]
plasma.acharge=[-1 1]; % atomic charge [a.u.]
plasma.n0=[1 1]*1E20; % densities on axis [1/m^3]
plasma.na=[1 .7]; plasma.nb=[3 3]; % density profile factors
plasma.t0=[5 5]; % temperatures on axis [keV]
plasma.ta=[1 1]; plasma.tb=[1 1]; % temperatures profile factors
plasma.sant=.7;
plasma.thant=[-.5; .5]; % antenna ray pencil in (s,theta)
plasma.freq = 4.6E+9; % antenna frequency [Hz]
plasma.kant = [-35 10 0.]; % wave vector in (r,phi,z) [1/m]
% Set values of parameters derived from the above data
plasma.psin=0.5*plasma.b0/plasma.q0* ...
plasma.elong*(plasma.r0*plasma.iaspr)^2; % magnetic flux at edge
plasma.omega = 2*pi*plasma.freq; % circular frequency [rad/sec]
plasma.depo=zeros(20,length(plasma.amass)); % Deposition profiles
% why is this 20? Probably #bins in s, but why not NS?
str=type;
%
% ----- JET: D(20%He3) shots (2006 spring campain e.g. #66421)
%
elseif strcmp(type,'jet06')
plasma.EQ= 'Solovev'; % Analytical Solovev equilibrium
plasma.NS=22; plasma.NT=65; plasma.NK=15; % discretization
plasma.b0=3.35; % axis magnetic field [Tesla]
plasma.r0=3.; % axis major radius [m]
plasma.q0=1.5E+0; % axis safety factor
plasma.iaspr=0.3; % inverse aspect ratio
plasma.elong=1.4; % elongation
% Plasma species and response
plasma.PROBL='tok';plasma.MODEL='cld2x2';
rays.TYPE='Amp';% tensor and calculation
plasma.amass=[1/1836 2 3]; % atomic mass [a.u.]
plasma.acharge=[-1 1 2]; % atomic charge [a.u.]
% seems that these are wrong for quasinutrality
% plasma.n0=[7. 5.6 1.4]*1E19; % densities on axis [1/m^3]
% plasma.na=[1 1 .5]; plasma.nb=[1 1 1]; % density profile factors
plasma.n0=[8.4 5.6 1.4]*1E19; % densities on axis [1/m^3]
plasma.na=[1 1 1]; plasma.nb=[1 1 1]; % density profile factors
plasma.t0=[5 5 5]; % temperatures on axis [keV]
plasma.ta=[.6 .6 .6];
% below is the same name as above! I don't think temperature stuff
% works...
% plasma.nb=[2 2 2]; % temperatures profile factors
% Rays
rays.NRAY = 1; % number of rays to trace
plasma.sant = 0.6; plasma.thant=[.01; 0.7]; % Used 3 rays {0,.3,.6}
plasma.freq = 37E+6; % antenna frequency [Hz]
plasma.kant = [-30. -4.67 0.]; % n= +/-14 or pi/2 phasing
rays.timespan= 1E-6; % Time span of evolution
% Set values of parameters derived from the above data
plasma.psin=0.5*plasma.b0/plasma.q0* ...
plasma.elong*(plasma.r0*plasma.iaspr)^2; % magnetic flux at edge
plasma.omega = 2*pi*plasma.freq; % circular frequency [rad/sec]
plasma.depo=zeros(20,length(plasma.amass)); % Deposition profiles
% why is this 20? Probably #bins in s, but why not NS?
str=type;
%
% kant = [-20. -9. 0.]; % Plot Dirk VEester pi phasing
%
% ----- ITER: D(50%T) without cylotron resonance
%
elseif strcmp(type,'iter06')
plasma.EQ= 'Solovev'; % Analytical Solovev equilibrium
plasma.NS=21; plasma.T=64; plasma.NK=15; % discretization
plasma.b0=5.; % axis magnetic field [Tesla]
plasma.r0=5.; % axis major radius [m]
plasma.q0=1.E+0; % axis safety factor
plasma.iaspr=0.3; % inverse aspect ratio
plasma.elong=1.4; % elongation
% Plasma species and response
plasma.PROBL='tok';plasma.MODEL='cld2x2';
plasma.TYPE='Con';% tensor and calculation
plasma.amass=[1/1836 2 3 4]; % atomic mass [a.u.]
plasma.acharge=[-1 1 1 2]; % atomic charge [a.u.]
plasma.n0=[10. 6. 2. 2.]*1E19; % densities on axis [1/m^3]
plasma.na=[1 .9 1. 1.]; plasma.nb=[1 1 1 1]; % density profile factors
plasma.t0=[20 20 20]; % temperatures on axis [keV]
plasma.ta=[1 1 1]; plasma.nb=[1 1 1]; % temperatures profile factors
% Rays
rays.NRAY = 1; % number of rays to trace
plasma.sant = 0.6; plasma.thant=[-.01; 0.7]; % antenna ray pencil in (s,theta)
plasma.freq = 26E+6; % antenna frequency [Hz]
plasma.kant = [-15. -3. 0.]; % n= +/-15
rays.timespan= 1E-6; % Time span of evolution
str=type;
%
plasma.TYPE='Amp';
%
% ----- Tokamak: D(20%H) without cylotron resonance
%
elseif strcmp(type,'ray05')
plasma.EQ= 'Solovev'; % Analytical Solovev equilibrium
plasma.NS=25; plasma.NT=64; plasma.NK=15; % discretization
plasma.b0=3.4; % axis magnetic field [Tesla]
plasma.r0=3.; % axis major radius [m]
plasma.q0=1.E+0; % axis safety factor
plasma.iaspr=0.3; % inverse aspect ratio
plasma.elong=1.4; % elongation
% Plasma species and response
plasma.PROBL='tok';plasma.MODEL='cld2x2';
plasma.TYPE='Amp';% tensor and calculation
plasma.amass=[1/1836 2 1]; % atomic mass [a.u.]
plasma.acharge=[-1 1 1]; % atomic charge [a.u.]
plasma.n0=[1. .8 .2]*1E19; % densities on axis [1/m^3]
plasma.na=[1 1 .5]; plasma.nb=[1 1 1]; % density profile factors
plasma.t0=[6 6 6]; % temperatures on axis [keV]
plasma.ta=[1 1 1]; plasma.nb=[1 1 1]; % temperatures profile factors
% Rays
rays.NRAY = 1; % number of rays to trace
plasma.sant = 0.6; plasma.thant=[-.3; 0.9]; % antenna ray pencil in (s,theta)
plasma.freq = 43E+6; % antenna frequency [Hz]
plasma.kant = [-12.5 0.0 0.]; % wave vector in (r,phi,z) [1/m]
rays.timespan= 1E-6; % Time span of evolution
str=type;
%TYPE='Con'; timespan= 4E-7; % Time span of evolution
plasma.thant=[-.01;0.9]; % FigC inside mid-plane
% thant=[-.3;0.9]; % FigD slight off mid-plane
% thant=[.4; 0.9]; kant=[-7.5 -5. -3.]; % FigE off mid-plane + ntor
%
% ----- Andre(3): normalized quantities to compare with analytical
%
elseif strcmp(type,'andre3')
% Constants
cnst.c = 1; % speed of light in vacuum [m/s]
cnst.e = 1.; % electron charge [C]
cnst.mp = 1.; % proton mass [kg]
cnst.eps0 = 1.; % permittivity of vacuum [F/m]
plasma.EQ= 'Solovev'; % Analytical Solovev equilibrium
plasma.NS=20; plasma.NT=18; % spatial mesh points
plasma.b0=sqrt(2.); % axis magnetic field [Tesla]
plasma.r0=1000.; % axis major radius [m]
plasma.q0=1E+3; % axis safety factor
plasma.iaspr=0.001; % inverse aspect ratio
plasma.elong=1.; % elongation
% Plasma species and response
plasma.MODEL='cld2x2'; plasma.TYPE='Amp'; % tensor and calculation
plasma.amass=[1 1]; % atomic mass [a.u.]
plasma.acharge=[-1 1]; % atomic charge [a.u.]
plasma.n0=[1 1]; % densities on axis [1/m^3]
plasma.na=[1 1]; plasma.nb=[1 1]; % density profile factors
% Rays
rays.NRAY = 1; % number of rays to trace
plasma.sant=sqrt(3/4); plasma.thant=[3.1416; 3.15]; % antenna ray pencil in (s,theta)
plasma.freq = 1/(2*pi); % antenna frequency [Hz]
plasma.kant = [.1 0. 0.]; % wave vector in (r,phi,z) [1/m]
rays.timespan= 75; % Time span of evolution
str=type;
%
else % strcmp(type,'Default ')
str=strvcat( ...
' %===== DEFAULT PARAMETERS DEFINED IN ''data.m'' ===================================',...
' global EQ NS NT b0 elong iaspr q0 r0 n0 na nb t0 ta tb acharge amass',...
' global MODEL NRAY freq kant sant thant timespan',...
' ',...
' % ----- Equilibrium',...
' EQ = ''Solovev''; % analytical Solovev',...
' NS = 32; NT = 18; % spatial mesh points',...
' b0 = 3.; % axis magnetic field [Tesla]',...
' r0 = 3.; % axis major radius [m]',...
' q0 = 1.1; % axis safety factor',...
' iaspr = 0.33; % inverse aspect ratio',...
' elong = 1.35; % elongation',...
' ',...
' % ----- Plasma species and response',...
' MODEL = ''cld2x2''; % tensor (cld1x1, cld2x2, cld3x3)',...
' amass = [1/1836 2 1]; % atomic mass [a.u.]',...
' acharge = [-1 1 1]; % atomic charge [a.u.]',...
' n0 = [1 0.10 0.90]*1E19; % densities on axis [1/m^3]',...
' na=[1 .9 .9]; nb=[1 1 1]; % density profile factors',...
' t0=[5 5 5]; % temperature on axis [keV]',...
' ta=[1 1 1]; tb=[1 1 1]; % temperature profile factors',...
' ',...
' % ----- Rays',...
' NRAY = 1; % number of rays to trace',...
' sant = 0.4; thant = [0; pi/4]; % antenna in (s,theta)',...
' freq = 28E+6; % antenna frequency [Hz]',...
' kant = [-8 0 0]; % wave vector in (r,phi,z) [1/m]',...
' timespan = 10; % Evolution time span',...
' TYPE=''Trj''; % calculation (Trj,Con,Amp)',...
' ',...
' ');
end;
%
promptStr=str;