15 function w_mhd(equilibrium, rminor, eps) result(f_w_mhd)
26 type (type_equilibrium
),
intent(in) :: equilibrium
27 real(r8) :: rminor, eps
30 character(len = 6),
parameter :: type =
'volume'
32 real(r8) :: df(np - 1), dv(np - 1), dv_flux_tube(nr)
33 real(r8) :: xaxis, factas
34 integer(itm_i4) :: i, j
43 xaxis = (equilibrium%global_param%mag_axis%position%r &
44 - equilibrium%eqgeometry%geom_axis%r) &
45 / equilibrium%eqgeometry%a_minor
53 dv_flux_tube(i) = 0._r8
56 dv_flux_tube(i) = dv_flux_tube(i) + dv(j)
59 dv_flux_tube = dv_flux_tube * factas
60 dv_flux_tube = dv_flux_tube * rminor**3 / eps
69 f_w_mhd = f_w_mhd + 1.5_r8 * dv_flux_tube(i) &
70 * (equilibrium%profiles_1d%pressure(i - 1) &
71 + 0.5_r8 * (equilibrium%profiles_1d%psi(i) &
72 - equilibrium%profiles_1d%psi(i - 1)) * (0.75_r8 &
73 * equilibrium%profiles_1d%pprime(i - 1) + 0.25_r8 &
74 * equilibrium%profiles_1d%pprime(i)))
81 result(f_plasma_volume)
92 type (type_equilibrium
),
intent(inout) :: equilibrium
93 real(r8) :: rminor, eps
94 real(r8) :: f_plasma_volume
96 character(len = 6),
parameter :: type =
'volume'
98 real(r8) :: df(np - 1), dv(np - 1), dv_flux_tube(nr)
99 real(r8) :: xaxis, factas
100 integer(itm_i4) :: i, j
109 xaxis = (equilibrium%global_param%mag_axis%position%r &
110 - equilibrium%eqgeometry%geom_axis%r) &
111 / equilibrium%eqgeometry%a_minor
119 dv_flux_tube(i) = 0._r8
122 dv_flux_tube(i) = dv_flux_tube(i) + dv(j)
125 dv_flux_tube = dv_flux_tube * factas
126 dv_flux_tube = dv_flux_tube * rminor**3 / eps
128 f_plasma_volume = 0._r8
130 f_plasma_volume = f_plasma_volume + dv_flux_tube(i)
131 equilibrium%profiles_1d%volume(i) = f_plasma_volume
138 result(f_cross_section)
150 type (type_equilibrium
),
intent(inout) :: equilibrium
151 real(r8) :: rminor, eps
152 real(r8) :: f_cross_section
154 character(len = 6),
parameter :: type =
'area '
156 real(r8) :: df(np - 1), da(np - 1), da_flux_tube(nr)
157 real(r8) :: xaxis, factas
158 integer(itm_i4) :: i, j
167 xaxis = (equilibrium%global_param%mag_axis%position%r &
168 - equilibrium%eqgeometry%geom_axis%r) &
169 / equilibrium%eqgeometry%a_minor
177 da_flux_tube(i) = 0._r8
180 da_flux_tube(i) = da_flux_tube(i) + da(j)
183 da_flux_tube = da_flux_tube * factas
184 da_flux_tube = da_flux_tube * rminor**2
186 f_cross_section = 0._r8
188 f_cross_section = f_cross_section + da_flux_tube(i)
189 equilibrium%profiles_1d%area(i) = f_cross_section
206 type (type_equilibrium
),
intent(inout) :: equilibrium
207 real(r8) :: rminor, eps
209 character(len = 6),
parameter :: type =
'line '
211 real(r8) :: df(np - 1), da(np - 1), da_flux_tube(nr)
212 real(r8) :: xaxis, factas
213 integer(itm_i4) :: i, j
222 xaxis = (equilibrium%global_param%mag_axis%position%r &
223 - equilibrium%eqgeometry%geom_axis%r) &
224 / equilibrium%eqgeometry%a_minor
232 da_flux_tube(i) = 0._r8
235 da_flux_tube(i) = da_flux_tube(i) + da(j) * df(j)
238 da_flux_tube = da_flux_tube * factas
239 da_flux_tube = da_flux_tube * rminor &
240 * equilibrium%eqgeometry%geom_axis%r * twopi
242 equilibrium%profiles_1d%surface = da_flux_tube
248 result(f_beta_poloidal)
263 type (type_equilibrium
),
intent(inout) :: equilibrium
265 real(r8) :: f_beta_poloidal
267 character(len = 6),
parameter :: type =
'area '
269 real(r8) :: df(np - 1), da(np - 1), dl(np - 1)
270 real(r8),
intent(in) :: a
271 real(r8) :: factas, xaxis
273 integer(itm_i4) :: i, j
282 xaxis = (equilibrium%global_param%mag_axis%position%r &
283 - equilibrium%eqgeometry%geom_axis%r) &
284 / equilibrium%eqgeometry%a_minor
286 rminor = equilibrium%eqgeometry%a_minor
292 f_beta_poloidal = 0._r8
300 f_beta_poloidal = f_beta_poloidal + df(j) * da(j)
304 equilibrium%profiles_1d%beta_pol(i) = df(1)
307 equilibrium%profiles_1d%beta_pol(i) = f_beta_poloidal &
308 / equilibrium%profiles_1d%area(i)
318 lp = lp * factas * rminor
319 b_a = mu0 * equilibrium%global_param%i_plasma / lp
321 equilibrium%profiles_1d%beta_pol = equilibrium%profiles_1d%beta_pol &
322 * 2._r8 * mu0 / b_a**2
324 f_beta_poloidal = equilibrium%profiles_1d%beta_pol(nr)
330 result(f_beta_toroidal)
344 type (type_equilibrium
),
intent(inout) :: equilibrium
346 real(r8) :: f_beta_toroidal
348 character(len = 6),
parameter :: type =
'volume'
350 real(r8) :: df(np - 1), dv(np - 1)
351 real(r8),
intent(in) :: a
352 real(r8) :: factas, xaxis
353 integer(itm_i4) :: i, j
362 xaxis = (equilibrium%global_param%mag_axis%position%r &
363 - equilibrium%eqgeometry%geom_axis%r) &
364 / equilibrium%eqgeometry%a_minor
366 rminor = equilibrium%eqgeometry%a_minor
371 f_beta_toroidal = 0._r8
378 dv = dv * rminor**3 / eps
380 f_beta_toroidal = f_beta_toroidal + df(j) * dv(j)
384 f_beta_toroidal = f_beta_toroidal / equilibrium%global_param%volume
386 f_beta_toroidal = f_beta_toroidal * 2._r8 * mu0 &
387 / equilibrium%global_param%toroid_field%b0**2
393 result(f_internal_inductance)
412 type (type_equilibrium
),
intent(inout) :: equilibrium
413 real(r8) :: f_internal_inductance
415 character(len = 6),
parameter :: type =
'volume'
419 real(r8) :: df(np - 1), dv(np - 1), dl(np - 1)
420 real(r8) :: i_tor(nr)
421 real(r8),
intent(in) :: a
422 real(r8) :: factas, xaxis
423 real(r8) :: rminor, r_average
424 integer(itm_i4) :: i, j
433 xaxis = (equilibrium%global_param%mag_axis%position%r &
434 - equilibrium%eqgeometry%geom_axis%r) &
435 / equilibrium%eqgeometry%a_minor
436 rminor = equilibrium%eqgeometry%a_minor
442 f_internal_inductance = 0._r8
448 dv = dv * rminor**3 / eps
450 f_internal_inductance = f_internal_inductance + df(j) * dv(j)
452 i_tor(i) = i_tor(i - 1) + (equilibrium%profiles_1d%area(i) &
453 - equilibrium%profiles_1d%area(i - 1)) &
454 * equilibrium%profiles_1d%jphi(i)
455 r_average = equilibrium%profiles_1d%volume(i) / (twopi &
456 * equilibrium%profiles_1d%area(i))
457 equilibrium%profiles_1d%li(i) = f_internal_inductance / i_tor(i)**2 &
458 / (equilibrium%eqgeometry%a_minor &
459 * equilibrium%eqgeometry%geom_axis%r &
460 / (equilibrium%profiles_1d%psi(nr) &
461 - equilibrium%profiles_1d%psi(1)))**2 / mu0
463 equilibrium%profiles_1d%li(i) = 2._r8 * equilibrium%profiles_1d%li(i) &
469 call
spline(nr - 1, equilibrium%profiles_1d%volume(2 : nr), &
470 equilibrium%profiles_1d%li(2 : nr), 0._r8, 0._r8, 2, coeff)
471 equilibrium%profiles_1d%li(1) =
spwert(nr - 1, 0._r8, coeff, &
472 equilibrium%profiles_1d%volume(2 : nr), abltg, 0)
475 f_internal_inductance = equilibrium%profiles_1d%li(nr)
real(r8) function, public cross_section(equilibrium, rminor, eps)
real(r8) function bp2(a, x, xr, xs, yr, ys, psi, psir, F_dia)
subroutine allocate_spline_coefficients(spline, n)
real(r8) function internal_inductance(a, equilibrium)
subroutine spline(N, X, Y, ALFA, BETA, TYP, A, B, C, D)
REAL *8 function spwert(N, XWERT, A, B, C, D, X, ABLTG)
real(r8) function, public plasma_volume(equilibrium, rminor, eps)
subroutine, public element_average(i, type, xaxis, a, F_dia, func, df, dl)
subroutine deallocate_spline_coefficients(spline)
real(r8) function p(a, x, xr, xs, yr, ys, psi, psir, F_dia)
real(r8) function, public w_mhd(equilibrium, rminor, eps)
real(r8) function beta_toroidal(a, equilibrium)
real(r8) function identity(a, x, xr, xs, yr, ys, psi, psir, F_dia)
real(r8) function beta_poloidal(a, equilibrium)
subroutine, public surface_area(equilibrium, rminor, eps)
real(r8) function r_major(a, x, xr, xs, yr, ys, psi, psir, F_dia)