subroutine new_stella_config(index)
integer, intent(in) :: index
select case (index)
! This is the istell case switch:
! istell = 1: Helias5 machine
! istell = 2: Helias4 machine
! istell = 3: Helias3 machine
! istell = 4: w7x30 machine
! istell = 5: w7x50 machine
! istell = 6: Init from json
! All parameters set here are prelimnirary versions and might be changed in further commits
case(1)
! Helias5 Machine
! The values are given at the reference point
stella_config_name = "Helias 5b"
stella_config_rmajor_ref = 22.2D0
stella_config_rminor_ref = 1.80D0
stella_config_aspect_ref = 12.33D0
! Coil radii
stella_config_coil_rmajor = 22.44D0
stella_config_coil_rminor = 4.76D0
stella_config_bt_ref = 5.6D0
stella_config_WP_area = 0.8d0*0.6d0
stella_config_WP_bmax = 11.44d0
stella_config_symmetry = 5
stella_config_coilspermodule = 10
stella_config_a1 = 0.688D0
stella_config_a2 = 0.025D0
stella_config_plasma_volume = 1422.63D0 ! This value is for Helias 5
stella_config_dmin = 0.84D0
stella_config_max_portsize_width = 2.12D0
stella_config_plasma_surface = 1960.0D0 ! Plasma Surface
stella_config_maximal_coil_height = 12.7D0 ! [m] Full height max point to min point
stella_config_coilsurface = 4817.7D0 ! Coil surface, dimensionfull. At reference point
stella_config_coillength = 1680.0D0 ! Central filament length of machine with outer radius 1m.
stella_config_I0 = 13.06D0 ! Coil Current needed to produce 1T on axis in [MA] at outer radius 1m
stella_config_inductance = 1655.76D-6 ! inductance in muH
stella_config_WP_ratio = 1.2D0 ! The fit values in stellarator config class should be calculated using this value.
stella_config_max_force_density = 120.0d0 ! [MN/m^3]
stella_config_max_force_density_MNm = 98.0d0 ! [MN/m]
stella_config_max_lateral_force_density = 92.4d0 ! [MN/m^3]
stella_config_max_radial_force_density = 113.5d0 ! [MN/m^3]
stella_config_centering_force_max_MN = 189.5d0
stella_config_centering_force_min_MN = -55.7d0
stella_config_centering_force_avg_MN = 93.0d0
stella_config_min_plasma_coil_distance = 1.9d0
stella_config_derivative_min_LCFS_coils_dist = -1.0d0 ! this is approximated for now
stella_config_min_bend_radius = 1.0d0 ! [m]
stella_config_neutron_peakfactor = 1.6d0
stella_config_epseff = 0.015d0
if (allocated(sc_D11_star_mono_input)) deallocate(sc_D11_star_mono_input)
if (allocated(sc_nu_star_mono_input)) deallocate(sc_nu_star_mono_input)
allocate(sc_D11_star_mono_input(10))
allocate(sc_nu_star_mono_input(10))
sc_D11_star_mono_input = (/1,1,1,1,1,1,1,1,1,1/)
sc_nu_star_mono_input = (/1d-8,1d-7,1d-6,1d-5,1d-4,1d-3,1d-2,1d-1,1d0,1d1/)
case(2)
! Helias4 Machine
stella_config_name = "Helias 4"
! Reference point where all the other variables are determined from
! Plasma outer radius
stella_config_rmajor_ref = 17.6D0
stella_config_rminor_ref = 2.0D0
stella_config_aspect_ref = 8.8D0
! Coil radii
stella_config_coil_rmajor = 18.39D0
stella_config_coil_rminor = 4.94D0
stella_config_bt_ref = 5.6D0
stella_config_WP_area = 0.8d0*0.6d0
stella_config_WP_bmax = 11.51d0
stella_config_symmetry = 4
stella_config_coilspermodule = 10
stella_config_a1 = 0.676D0
stella_config_a2 = 0.029D0
stella_config_plasma_volume = 1380.0D0
stella_config_dmin = 1.08D0
stella_config_max_portsize_width = 3.24D0
stella_config_plasma_surface = 1900.0D0
stella_config_maximal_coil_height = 13.34D0 ! [m] Full height max point to min point
stella_config_coilsurface = 4100.0D0! Coil surface, dimensionfull. At reference point
stella_config_coillength = 1435.07D0 ! Central filament length of machine with outer radius 1m.
stella_config_I0 = 13.146D0 ! Coil Current needed to produce b0 on axis in [MA] at reference point
stella_config_inductance = 1290.4D-6 ! inductance/R*A^2 in muH
stella_config_WP_ratio = 1.3D0
stella_config_max_force_density = 120.0d0 ! [MN/m^3]
stella_config_max_force_density_MNm = 98.0d0 ! [MN/m]
stella_config_max_lateral_force_density = 87.9d0 ! [MN/m^3]
stella_config_max_radial_force_density = 109.9d0 ! [MN/m^3]
stella_config_centering_force_max_MN = 226.0d0
stella_config_centering_force_min_MN = -35.3d0
stella_config_centering_force_avg_MN = 125.8d0
stella_config_min_plasma_coil_distance = 1.7d0
stella_config_derivative_min_LCFS_coils_dist = -1.0d0 ! this is approximated for now
stella_config_min_bend_radius = 0.86d0 ! [m]
stella_config_neutron_peakfactor = 1.6d0
stella_config_epseff = 0.015d0
case(3)
! Helias 3 Machine
stella_config_name = "Helias 3"
! Reference point where all the other variables are determined from
! Plasma outer radius
stella_config_rmajor_ref = 13.86d0
stella_config_rminor_ref = 2.18d0
stella_config_aspect_ref = 6.36d0
! Coil radii
stella_config_coil_rmajor = 14.53D0
stella_config_coil_rminor = 6.12D0
stella_config_bt_ref = 5.6D0
stella_config_WP_bmax = 12.346d0
stella_config_WP_area = 0.8d0*0.6d0
stella_config_symmetry = 3
stella_config_coilspermodule = 10
! Bmax fit parameters
stella_config_a1 = 0.56D0
stella_config_a2 = 0.030D0
stella_config_plasma_volume = 1300.8D0
stella_config_dmin = 1.145D0
stella_config_max_portsize_width = 3.24D0 !??? guess. not ready yet
stella_config_plasma_surface = 1600.00D0
stella_config_maximal_coil_height = 17.74D0! [m] Full height max point to min point
stella_config_coilsurface = 4240.0D0 ! Coil surface, dimensionfull. At reference point
stella_config_coillength = 1287.3D0 ! Central filament length of machine with outer radius 1m.
stella_config_I0 = 14.23D0 ! Coil Current needed to produce 1T on axis in [MA] at outer radius 1m
stella_config_inductance = 1250.7D-6 ! inductance in muH
stella_config_WP_ratio = 1.3D0
stella_config_max_force_density = 120.0d0
stella_config_max_force_density_MNm = 98.0d0 ! [MN/m]
stella_config_max_lateral_force_density = 96.6d0 ! [MN/m^3]
stella_config_max_radial_force_density = 130.5d0 ! [MN/m^3]
stella_config_centering_force_max_MN = 428.1d0
stella_config_centering_force_min_MN = -70.3d0
stella_config_centering_force_avg_MN = 240.9d0
stella_config_min_plasma_coil_distance = 1.78d0
stella_config_derivative_min_LCFS_coils_dist = -1.0d0 ! this is approximated for now
stella_config_min_bend_radius = 1.145d0 ! [m]
stella_config_neutron_peakfactor = 1.6d0
stella_config_epseff = 0.015d0
case(4)
! w7x30 Machine
stella_config_name = "W7X-30"
! Reference point where all the other variables are determined from
! Plasma outer radius
stella_config_rmajor_ref = 5.50D0
stella_config_rminor_ref = 0.49D0
stella_config_aspect_ref = 11.2D0
! Coil radii
stella_config_coil_rmajor = 5.62D0
stella_config_coil_rminor = 1.36D0
stella_config_bt_ref = 3.0D0
stella_config_WP_area = 0.18d0*0.15d0
stella_config_WP_bmax = 10.6d0
stella_config_symmetry = 5
stella_config_coilspermodule = 6
stella_config_a1 = 0.98D0
stella_config_a2 = 0.041D0
stella_config_plasma_volume = 26.4D0
stella_config_dmin = 0.21D0
stella_config_max_portsize_width = 0.5D0
stella_config_plasma_surface = 128.3D0
stella_config_maximal_coil_height = 3.6D0 ! [m] Full height max point to min point
stella_config_coilsurface = 370.0D0! Coil surface, dimensionfull. At reference point
stella_config_coillength = 303.4D0 ! Central filament length of machine with outer radius 1m.
stella_config_I0 = 2.9D0 ! Coil Current needed to produce b0 on axis in [MA] at reference point
stella_config_inductance = 252.7D-6 ! inductance/R*A^2 in muH
stella_config_WP_ratio = 1.2D0
stella_config_max_force_density = 350.0d0 ! [MN/m^3]
stella_config_max_force_density_MNm = 98.0d0 ! [MN/m]
stella_config_max_lateral_force_density = 271.1d0 ! [MN/m^3]
stella_config_max_radial_force_density = 305.2d0 ! [MN/m^3]
stella_config_centering_force_max_MN = 7.95d0
stella_config_centering_force_min_MN = -2.15d0
stella_config_centering_force_avg_MN = 3.46d0
stella_config_min_plasma_coil_distance = 0.45D0
stella_config_derivative_min_LCFS_coils_dist = -1.0d0 ! this is approximated for now
stella_config_min_bend_radius = 0.186d0 ! [m]
stella_config_neutron_peakfactor = 1.6d0
stella_config_epseff = 0.015d0
case(5)
! w7x50 Machine
stella_config_name = "W7X-50"
! Reference point where all the other variables are determined from
! Plasma outer radius
stella_config_rmajor_ref = 5.5D0
stella_config_rminor_ref = 0.49D0
stella_config_aspect_ref = 11.2D0
! Coil radii
stella_config_coil_rmajor = 5.62d0
stella_config_coil_rminor = 1.18D0
stella_config_bt_ref = 3.0D0
stella_config_WP_area = 0.18d0*0.15d0
stella_config_WP_bmax = 6.3d0
stella_config_symmetry = 5
stella_config_coilspermodule = 10
stella_config_a1 = 0.66D0
stella_config_a2 = 0.025D0
stella_config_plasma_volume = 26.4D0
stella_config_dmin = 0.28D0
stella_config_max_portsize_width = 0.3D0
stella_config_plasma_surface = 128.3D0
stella_config_maximal_coil_height = 3.1D0 ! [m] Full height max point to min point
stella_config_coilsurface = 299.85D0! Coil surface, dimensionfull. At reference point
stella_config_coillength = 420.67D0 ! Central filament length of machine with outer radius 1m.
stella_config_I0 = 1.745D0 ! Coil Current needed to produce b0 on axis in [MA] at reference point
stella_config_inductance = 412.4D-6 ! inductance/R*A^2 in muH
stella_config_WP_ratio = 1.2D0
stella_config_max_force_density = 250.0d0 ! [MN/m^3]
stella_config_max_force_density_MNm = 98.0d0 ! [MN/m]
stella_config_max_lateral_force_density = 116.4d0 ! [MN/m^3]
stella_config_max_radial_force_density = 148.d0 ! [MN/m^3]
stella_config_centering_force_max_MN = 2.99d0
stella_config_centering_force_min_MN = -1.29d0
stella_config_centering_force_avg_MN = 1.61d0
stella_config_min_plasma_coil_distance = 0.39D0
stella_config_derivative_min_LCFS_coils_dist = -1.0d0 ! this is approximated for now
stella_config_min_bend_radius = 0.39d0 ! [m]
stella_config_neutron_peakfactor = 1.6d0
stella_config_epseff = 0.015d0
case(6)
! Init from json
! This requires a file called stella_config.json in the working directory.
! It can either be prepared manually or it can be produced automatically based on a VMEC netcdf
! file and a coils file
! by the pre-sPROCESS Code, https://gitlab.mpcdf.mpg.de/jtl/sprocess/ by jorrit.lion@ipp.mpg.de
call stella_config_json()
case default
! Return some error here. The index is not implemented yet.
write(*,*)'ERROR in initialization of stellarator config. No such istell: ',index
end select
end subroutine new_stella_config