-
Notifications
You must be signed in to change notification settings - Fork 5
/
test_kinetic_h.pro
170 lines (152 loc) · 4.55 KB
/
test_kinetic_h.pro
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
;
; Test_kinetic_H.pro
;
tek
key_default,name,'test'
file='Kinetic_H_'+name+'.dat'
key_default,plot,1
key_default,debug,0
key_default,debrief,1
key_default,pause,0
key_default,truncate,1.e-4
key_default,test,1
key_default,simple_cx,1
key_default,H_H_EL,1
key_default,H_P_EL,1
key_default,H_H2_EL,1
key_default,H_P_CX,1
key_default,ni_correct,1
key_default,mu,2
key_default,Truncate,1.0e-4
key_default,JH=1
key_default,Use_Collrad_Ionization=0
print,'H_H_EL:'+sval(H_H_EL)
print,'H_P_EL:'+sval(H_P_EL)
print,'H_H2_EL:'+sval(H_H2_EL)
print,'H_P_CX:'+sval(H_P_CX)
print,'ni_correct:'+sval(ni_correct)
print,'Simple_CX:'+sval(Simple_CX)
print,'mu:'+sval(mu)
print,'Truncate:'+sval(truncate)
compute_errors=1
;
; Test #1 - 3 eV neutrals
;
if test eq 1 then begin
nx=8
xw=0.0
xlim=0.2
xa=xlim-.02
xb=0.28
x1=xw+(xa-xw)*findgen(nx)/nx
nx=100
x2=xa+(xb-xa)*findgen(nx)/(nx-1)
x=[x1,x2]
nx=n_elements(x)
Ti=10.0*exp((x-xlim)/.025)
Ti=Ti > 1.0
Te=Ti
n=1.0e19*exp((x-xlim)/.03)
n=n > 1.0e15
n=n < 2.0e20
nv=10
fctr=1.0
PipeDia=dblarr(nx)
PipeDia(*)=0.5
Create_Kinetic_H_Mesh,nv,mu,x,Ti,Te,n,PipeDia,xH,TiH,TeH,neH,PipeDiaH,vx,vr,Tnorm,fctr=fctr
ip=where(vx gt 0)
nvr=n_elements(vr)
nvx=n_elements(vx)
nx=n_elements(xH)
vxi=fltarr(nx)
GammaxHBC=1.0e23
fHBC=fltarr(nvr,nvx)
Tneut=3.0
for i=ip(0),nvx-1 do begin
arg=-(vr(*)^2+vx(i)^2)/(Tneut/Tnorm)
fHBC(*,i)=exp(arg > (-80))
endfor
endif
if test eq 2 then begin
;
; Test #2 no ionization, Ti=T0
;
max_gen=100
nx=70
xa=0.0
xb=0.05
x=xa+(xb-xa)*findgen(nx)/(nx-1)
Ti=replicate(10.0,nx)
nv=20
Create_VrVxMesh,nv,Ti,vx,vr,Tnorm
ip=where(vx gt 0)
nvr=n_elements(vr)
nvx=n_elements(vx)
nx=n_elements(x)
GammaxHBC=1.0e23
; n=1.0e19*exp(x/.030)
n=replicate(5.0e19,nx)
Te=replicate(0.1,nx)
fHBC=fltarr(nvr,nvx)
Tneut=Ti(0)
for i=ip(0),nvx-1 do begin
arg=-(vr(*)^2+vx(i)^2)/(Tneut/Tnorm)
fHBC(*,i)=exp(arg > (-80))
endfor
endif
if test eq 3 then begin
;
; Test #3 with large ionization/charge exchange fraction, Ti=T0
;
max_gen=100
nx=70
xa=0.0
xb=0.05
x=xa+(xb-xa)*findgen(nx)/(nx-1)
Ti=replicate(10.0,nx)
nv=40
Create_VrVxMesh,nv,Ti,vx,vr,Tnorm
ip=where(vx gt 0)
nvr=n_elements(vr)
nvx=n_elements(vx)
nx=n_elements(x)
GammaxHBC=1.0e22
n=replicate(5.0e19,nx)
Te=replicate(30.0,nx)
fHBC=fltarr(nvr,nvx)
Tneut=Ti(0)
for i=ip(0),nvx-1 do begin
arg=-(vr(*)^2+vx(i)^2)/(Tneut/Tnorm)
fHBC(*,i)=exp(arg > (-80))
endfor
endif
;
print,'Test ='+sval(test)
multiplot,x,n,x,te,x,ti,title='Inputted profiles',xtitle='x',$
ytitle=['n','Te','Ti'],color=[2,3,4],$
varlabel=['Density (m^-3)','Te (ev)','Ti (eV)']
press_return
plot,vx,fHBC(0,*),/nodata,yrange=[0,max(fHBC)],title='Inputted fHBC'
for i=0,nvr-1 do oplot,vx,fHBC(i,*),color=(i mod 8)+2
press_return
Kinetic_H,vx,vr,xH,Tnorm,mu,TiH,TeH,neH,vxi,fHBC,GammaxHBC,PipeDiaH,fH2,fSH,nHP,THP,$
fH,nH,GammaxH,VxH,pH,TH,qxH,qxH_total,NetHSource,Sion,QH,RxH,QH_total,AlbedoH,WallH,$
truncate=truncate,Simple_CX=Simple_CX,Max_Gen=Max_Gen,$
No_Johnson_Hinnov=No_Johnson_Hinnov,Use_Collrad_Ionization=Use_Collrad_Ionization,No_Recomb=No_Recomb,$
H_H_EL=H_H_EL,H_P_EL=H_P_EL,H_H2_EL=_H_H2_EL,H_P_CX=H_P_CX,ni_correct=ni_correct,$
error=error,compute_errors=compute_errors,$
plot=plot,debug=debug,debrief=debrief,pause=pause
common Kinetic_H_Output,piH_xx,piH_yy,piH_zz,RxHCX,RxH2_H,RxP_H,RxW_H,EHCX,EH2_H,EP_H,EW_H,Epara_PerpH_H,SourceH,SRecomb
common Kinetic_H_Errors,Max_dx,vbar_error,mesh_error,moment_error,C_Error,CX_Error,H_H_error,$
qxH_total_error,QH_total_error
; save,file=file,vx,vr,x,Tnorm,mu,Ti,Te,n,vxi,fHBC,GammaxHBC,fH2,fSH,nHP,THP,$
; fH,nH,GammaxH,VxH,pH,TH,qxH,qxH_total,NetHSource,Sion,QH,RxH,QH_total,AlbedoH,$
; truncate,Simple_CX,Max_Gen,$
; No_Johnson_Hinnov,No_Recomb,$
; H_H_EL,H_P_EL,H_H2_EL,H_P_CX,$
; error,compute_errors,$
; plot,debug,debrief,pause,$
; piH_xx,piH_yy,piH_zz,RxH2_H,RxP_H,EH2_H,EP_H,$
; Max_dx,vbar_error,mesh_error,moment_error,C_Error,H_H_error,$
; qxH_total_error,QH_total_error
end