1 SUBROUTINE etaigb(eq, coreprof, coretransp, code_parameters)
21 TYPE (type_equilibrium
),
pointer ::
eq(:)
22 TYPE (type_coreprof
),
pointer :: coreprof(:)
23 TYPE (type_coretransp
),
pointer :: coretransp(:)
24 type (type_param
) :: code_parameters
26 INTEGER(ITM_I4) :: i,jm,j0,j1,j2
27 INTEGER(ITM_I4) :: nrho_prof,nion_prof
28 REAL(R8) :: x,aintm,aint0,aint1,aint2,xm,x0,x1,x2
29 REAL(R8) :: a00,b00,r00,hra
30 REAL(R8) :: nne,tte,nni,tti,taui,rlne,rlte,rlti,rhos,cs,zeff,qq
31 REAL(R8) :: rnue,rnui,beta,shat,rmue,epss,lperp
32 REAL(R8) :: chigb,ffe,ffi,gge,ggi
33 REAL(R8) :: diffe,diffi,chie,chii,vconve,vconvi,yconve,yconvi
37 integer(ITM_I4) :: return_status
39 character(len = 132),
target :: codename(1) =
'ETAIGB'
40 character(len = 132),
target :: codeversion(1) =
'0'
46 CALL mpi_comm_size( mpi_comm_world, npes, ierr )
47 CALL mpi_comm_rank( mpi_comm_world, mype, ierr )
54 nrho_prof=
SIZE(coreprof(1)%rho_tor)
55 nion_prof=
SIZE(coreprof(1)%ni%value)/nrho_prof
59 IF (.NOT.
ASSOCIATED(coretransp))
THEN
60 ALLOCATE(coretransp(1))
61 allocate(coretransp(1)%values(1))
70 if (.not.
associated(code_parameters%parameters))
then
71 write(6, *)
'ERROR: code parameters not associated!'
74 allocate(coretransp(1)%codeparam%parameters(
size(code_parameters%parameters)))
77 allocate(coretransp(1)%codeparam%codename(1))
78 allocate(coretransp(1)%codeparam%codeversion(1))
80 coretransp(1)%codeparam%codename = codename
81 coretransp(1)%codeparam%codeversion = codeversion
82 coretransp(1)%codeparam%parameters = code_parameters%parameters
86 if (return_status /= 0)
then
87 write(*,*)
'ERROR: Could not assign ETAIGB parameters.'
91 write(*,*)
'done assigning ETAIGB parameters'
95 CALL mpi_barrier(mpi_comm_world,ierr)
101 IF (nrho_transp == 0) nrho_transp = nrho_prof
102 IF (nion == 0) nion = nion_prof
112 nrho_transp=
SIZE(coretransp(1)%values(1)%rho_tor)
113 nion=
SIZE(coretransp(1)%values(1)%ti_transp%flux)/nrho_transp
117 a00=
eq(1)%eqgeometry%a_minor
118 b00=
eq(1)%global_param%toroid_field%b0
119 r00=
eq(1)%global_param%toroid_field%r0
123 hra=1.0_r8/nrho_transp
124 coretransp(1)%values(1)%rho_tor_norm=(/ (hra*(i-0.5_r8),i=1,nrho_transp) /)
125 coretransp(1)%values(1)%rho_tor=coretransp(1)%values(1)%rho_tor_norm*a00
134 x=coretransp(1)%values(1)%rho_tor(i)
135 DO WHILE (x >= coreprof(1)%rho_tor(j1) .AND. j1 < nrho_prof-1)
143 x2=coreprof(1)%rho_tor(j2)
144 x1=coreprof(1)%rho_tor(j1)
145 x0=coreprof(1)%rho_tor(j0)
146 xm=coreprof(1)%rho_tor(jm)
148 aintm=(x-x0)*(x-x1)*(x-x2)/((xm-x0)*(xm-x1)*(xm-x2))
149 aint0=(x-xm)*(x-x1)*(x-x2)/((x0-xm)*(x0-x1)*(x0-x2))
150 aint1=(x-xm)*(x-x0)*(x-x2)/((x1-xm)*(x1-x0)*(x1-x2))
151 aint2=(x-xm)*(x-x0)*(x-x1)/((x2-xm)*(x2-x0)*(x2-x1))
155 nne=aintm*coreprof(1)%ne%value(jm)+ &
156 aint0*coreprof(1)%ne%value(j0)+ &
157 aint1*coreprof(1)%ne%value(j1)+ &
158 aint2*coreprof(1)%ne%value(j2)
159 tte=aintm*coreprof(1)%te%value(jm)+ &
160 aint0*coreprof(1)%te%value(j0)+ &
161 aint1*coreprof(1)%te%value(j1)+ &
162 aint2*coreprof(1)%te%value(j2)
163 if(
associated(coreprof(1)%profiles1d%zeff%value))
then
164 zeff=aintm*coreprof(1)%profiles1d%zeff%value(jm)+ &
165 aint0*coreprof(1)%profiles1d%zeff%value(j0)+ &
166 aint1*coreprof(1)%profiles1d%zeff%value(j1)+ &
167 aint2*coreprof(1)%profiles1d%zeff%value(j2)
171 nni=aintm*coreprof(1)%ni%value(jm,1)+ &
172 aint0*coreprof(1)%ni%value(j0,1)+ &
173 aint1*coreprof(1)%ni%value(j1,1)+ &
174 aint2*coreprof(1)%ni%value(j2,1)
175 tti=aintm*coreprof(1)%ti%value(jm,1)+ &
176 aint0*coreprof(1)%ti%value(j0,1)+ &
177 aint1*coreprof(1)%ti%value(j1,1)+ &
178 aint2*coreprof(1)%ti%value(j2,1)
179 qq=aintm*coreprof(1)%profiles1d%q%value(jm)+ &
180 aint0*coreprof(1)%profiles1d%q%value(j0)+ &
181 aint1*coreprof(1)%profiles1d%q%value(j1)+ &
182 aint2*coreprof(1)%profiles1d%q%value(j2)
186 aintm=((x-x1)*(x-x2)+(x-x0)*(x-x2)+(x-x0)*(x-x1)) &
187 /((xm-x0)*(xm-x1)*(xm-x2))
188 aint0=((x-x1)*(x-x2)+(x-xm)*(x-x2)+(x-xm)*(x-x1)) &
189 /((x0-xm)*(x0-x1)*(x0-x2))
190 aint1=((x-x0)*(x-x2)+(x-xm)*(x-x2)+(x-xm)*(x-x0)) &
191 /((x1-xm)*(x1-x0)*(x1-x2))
192 aint2=((x-x0)*(x-x1)+(x-xm)*(x-x1)+(x-xm)*(x-x0)) &
193 /((x2-xm)*(x2-x0)*(x2-x1))
195 rlne=aintm*coreprof(1)%ne%value(jm)+ &
196 aint0*coreprof(1)%ne%value(j0)+ &
197 aint1*coreprof(1)%ne%value(j1)+ &
198 aint2*coreprof(1)%ne%value(j2)
199 rlte=aintm*coreprof(1)%te%value(jm)+ &
200 aint0*coreprof(1)%te%value(j0)+ &
201 aint1*coreprof(1)%te%value(j1)+ &
202 aint2*coreprof(1)%te%value(j2)
203 rlti=aintm*coreprof(1)%ti%value(jm,1)+ &
204 aint0*coreprof(1)%ti%value(j0,1)+ &
205 aint1*coreprof(1)%ti%value(j1,1)+ &
206 aint2*coreprof(1)%ti%value(j2,1)
207 shat=aintm*coreprof(1)%profiles1d%q%value(jm)+ &
208 aint0*coreprof(1)%profiles1d%q%value(j0)+ &
209 aint1*coreprof(1)%profiles1d%q%value(j1)+ &
210 aint2*coreprof(1)%profiles1d%q%value(j2)
219 rhos=cc*sqrt(
md*kb*tte)/(ee*b00)
223 beta=mu_0*nne*kb*tte/(b00*b00)
225 rnue=(lcoul/3.44e11_r8)*zeff*nne/(tte**1.5)
226 rnui=(lcoul/2.09e13_r8)*nni/(tti**1.5)
230 lperp=1./max( 1./(64.*rhos), abs(rlte), abs(rlti), abs(rlne))
241 chigb=rhos*rhos*cs/r00
243 chigb=chigb*40.0_r8/sqrt(1.0_r8+(beta_reduction*beta)**2.0_r8)
245 chigb=chigb*max(tfloor, (1.0_r8-thresh/abs((r00*rlti))))
255 coretransp(1)%values(1)%ne_transp%diff_eff(i,2) = diffe
256 coretransp(1)%values(1)%te_transp%diff_eff(i) = chie
257 coretransp(1)%values(1)%ni_transp%diff_eff(i,1,2) = diffi
258 coretransp(1)%values(1)%ti_transp%diff_eff(i,1) = chii
264 ffe= - diffe*(rlne-rlte/etae_pinch)/r00
271 coretransp(1)%values(1)%ne_transp%vconv_eff(i,2) = diffe*(rlte/etae_pinch)
272 coretransp(1)%values(1)%te_transp%vconv_eff(i) = 0._r8
273 coretransp(1)%values(1)%ni_transp%vconv_eff(i,1,2) = diffe*(rlte/etae_pinch)
274 coretransp(1)%values(1)%ti_transp%vconv_eff(i,1) = 0._r8
281 coretransp(1)%values(1)%ne_transp%flux(i) = nne*ffe
282 coretransp(1)%values(1)%te_transp%flux(i) = nne*kb*tte*(1.5_r8*ffe+gge)
283 coretransp(1)%values(1)%ni_transp%flux(i,1) = nni*ffe
284 coretransp(1)%values(1)%ti_transp%flux(i,1) = nni*kb*tti*(1.5_r8*ffe+ggi)
subroutine, public turb_constructor(coretransp, nrho0, nrho, nion)
subroutine eq(pcequi, psicon, ncequi, nstep, ngrid,
subroutine etaigb(eq, coreprof, coretransp, code_parameters)
subroutine assign_etaigb_parameters(codeparameters, return_status)