diff --git a/process/stellarator.py b/process/stellarator.py index 7dbbeed7b1..60d74c4048 100644 --- a/process/stellarator.py +++ b/process/stellarator.py @@ -1,6 +1,7 @@ import logging from copy import copy import numpy as np +from pathlib import Path from process.fortran import ( constants, @@ -27,11 +28,14 @@ neoclassics_module, impurity_radiation_module, sctfcoil_module, + global_variables, ) import process.superconductors as superconductors import process.physics_functions as physics_funcs +from process.stellarator_config import load_stellarator_config from process.coolprop_interface import FluidProperties from process.physics import rether +from process.utilities.f2py_string_patch import f2py_compatible_to_string logger = logging.getLogger(__name__) # Logging handler for console output @@ -255,7 +259,12 @@ def stnewconfig(self): It overwrites rminor with rmajor and aspect ratio e.g. """ - stellarator_configuration.new_stella_config(stellarator_variables.istell) + load_stellarator_config( + stellarator_variables.istell, + Path( + f"{f2py_compatible_to_string(global_variables.output_prefix)}stella_conf.json" + ), + ) # If physics_variables.aspect ratio is not in numerics.ixc set it to default value # Or when you call it the first time diff --git a/process/stellarator_config.py b/process/stellarator_config.py new file mode 100644 index 0000000000..7827ee6ed2 --- /dev/null +++ b/process/stellarator_config.py @@ -0,0 +1,248 @@ +from typing import Optional +from pathlib import Path +import json + +from process.fortran import stellarator_configuration + +HELIAS5B = dict( + name="Helias 5b", + rmajor_ref=22.2, + rminor_ref=1.80, + aspect_ref=12.33, + # Coil radii + coil_rmajor=22.44, + coil_rminor=4.76, + bt_ref=5.6, + WP_area=0.8 * 0.6, + WP_bmax=11.44, + symmetry=5, + coilspermodule=10, + a1=0.688, + a2=0.025, + plasma_volume=1422.63, # This value is for Helias 5 + dmin=0.84, + max_portsize_width=2.12, + plasma_surface=1960.0, # Plasma Surface + maximal_coil_height=12.7, # [m] Full height max point to min point + coilsurface=4817.7, # Coil surface, dimensionfull. At reference point + coillength=1680.0, # Central filament length of machine with outer radius 1m. + I0=13.06, # Coil Current needed to produce 1T on axis in [MA] at outer radius 1m + inductance=1655.76e-6, # inductance in muH + WP_ratio=1.2, # The fit values in stellarator config class should be calculated using this value. + max_force_density=120.0, # [MN/m^3] + max_force_density_MNm=98.0, # [MN/m] + max_lateral_force_density=92.4, # [MN/m^3] + max_radial_force_density=113.5, # [MN/m^3] + centering_force_max_MN=189.5, + centering_force_min_MN=-55.7, + centering_force_avg_MN=93.0, + min_plasma_coil_distance=1.9, + derivative_min_LCFS_coils_dist=-1.0, # this is approximated for now + min_bend_radius=1.0, # [m] + neutron_peakfactor=1.6, + epseff=0.015, +) + +HELIAS4 = dict( + name="Helias 4", + # Reference point where all the other variables are determined from + # Plasma outer radius + rmajor_ref=17.6, + rminor_ref=2.0, + aspect_ref=8.8, + # Coil radii + coil_rmajor=18.39, + coil_rminor=4.94, + bt_ref=5.6, + WP_area=0.8 * 0.6, + WP_bmax=11.51, + symmetry=4, + coilspermodule=10, + a1=0.676, + a2=0.029, + plasma_volume=1380.0, + dmin=1.08, + max_portsize_width=3.24, + plasma_surface=1900.0, + maximal_coil_height=13.34, # [m] Full height max point to min point + coilsurface=4100.0, # Coil surface, dimensionfull. At reference point + coillength=1435.07, # Central filament length of machine with outer radius 1m. + I0=13.146, # Coil Current needed to produce b0 on axis in [MA] at reference point + inductance=1290.4e-6, # inductance/R*A^2 in muH + WP_ratio=1.3, + max_force_density=120.0, # [MN/m^3] + max_force_density_MNm=98.0, # [MN/m] + max_lateral_force_density=87.9, # [MN/m^3] + max_radial_force_density=109.9, # [MN/m^3] + centering_force_max_MN=226.0, + centering_force_min_MN=-35.3, + centering_force_avg_MN=125.8, + min_plasma_coil_distance=1.7, + derivative_min_LCFS_coils_dist=-1.0, # this is approximated for now + min_bend_radius=0.86, # [m] + neutron_peakfactor=1.6, + epseff=0.015, +) + +HELIAS3 = dict( + name="Helias 3", + # Reference point where all the other variables are determined from + # Plasma outer radius + rmajor_ref=13.86, + rminor_ref=2.18, + aspect_ref=6.36, + # Coil radii + coil_rmajor=14.53, + coil_rminor=6.12, + bt_ref=5.6, + WP_bmax=12.346, + WP_area=0.8 * 0.6, + symmetry=3, + coilspermodule=10, + # Bmax fit parameters + a1=0.56, + a2=0.030, + plasma_volume=1300.8, + dmin=1.145, + max_portsize_width=3.24, # ??? guess. not ready yet + plasma_surface=1600.00, + maximal_coil_height=17.74, # [m] Full height max point to min point + coilsurface=4240.0, # Coil surface, dimensionfull. At reference point + coillength=1287.3, # Central filament length of machine with outer radius 1m. + I0=14.23, # Coil Current needed to produce 1T on axis in [MA] at outer radius 1m + inductance=1250.7e-6, # inductance in muH + WP_ratio=1.3, + max_force_density=120.0, + max_force_density_MNm=98.0, # [MN/m] + max_lateral_force_density=96.6, # [MN/m^3] + max_radial_force_density=130.5, # [MN/m^3] + centering_force_max_MN=428.1, + centering_force_min_MN=-70.3, + centering_force_avg_MN=240.9, + min_plasma_coil_distance=1.78, + derivative_min_LCFS_coils_dist=-1.0, # this is approximated for now + min_bend_radius=1.145, # [m] + neutron_peakfactor=1.6, + epseff=0.015, +) + +W7X30 = dict( + name="W7X-30", + # Reference point where all the other variables are determined from + # Plasma outer radius + rmajor_ref=5.50, + rminor_ref=0.49, + aspect_ref=11.2, + # Coil radii + coil_rmajor=5.62, + coil_rminor=1.36, + bt_ref=3.0, + WP_area=0.18 * 0.15, + WP_bmax=10.6, + symmetry=5, + coilspermodule=6, + a1=0.98, + a2=0.041, + plasma_volume=26.4, + dmin=0.21, + max_portsize_width=0.5, + plasma_surface=128.3, + maximal_coil_height=3.6, # [m] Full height max point to min point + coilsurface=370.0, # Coil surface, dimensionfull. At reference point + coillength=303.4, # Central filament length of machine with outer radius 1m. + I0=2.9, # Coil Current needed to produce b0 on axis in [MA] at reference point + inductance=252.7e-6, # inductance/R*A^2 in muH + WP_ratio=1.2, + max_force_density=350.0, # [MN/m^3] + max_force_density_MNm=98.0, # [MN/m] + max_lateral_force_density=271.1, # [MN/m^3] + max_radial_force_density=305.2, # [MN/m^3] + centering_force_max_MN=7.95, + centering_force_min_MN=-2.15, + centering_force_avg_MN=3.46, + min_plasma_coil_distance=0.45, + derivative_min_LCFS_coils_dist=-1.0, # this is approximated for now + min_bend_radius=0.186, # [m] + neutron_peakfactor=1.6, + epseff=0.015, +) + +W7X50 = dict( + name="W7X-50", + # Reference point where all the other variables are determined from + # Plasma outer radius + rmajor_ref=5.5, + rminor_ref=0.49, + aspect_ref=11.2, + # Coil radii + coil_rmajor=5.62, + coil_rminor=1.18, + bt_ref=3.0, + WP_area=0.18 * 0.15, + WP_bmax=6.3, + symmetry=5, + coilspermodule=10, + a1=0.66, + a2=0.025, + plasma_volume=26.4, + dmin=0.28, + max_portsize_width=0.3, + plasma_surface=128.3, + maximal_coil_height=3.1, # [m] Full height max point to min point + coilsurface=299.85, # Coil surface, dimensionfull. At reference point + coillength=420.67, # Central filament length of machine with outer radius 1m. + I0=1.745, # Coil Current needed to produce b0 on axis in [MA] at reference point + inductance=412.4e-6, # inductance/R*A^2 in muH + WP_ratio=1.2, + max_force_density=250.0, # [MN/m^3] + max_force_density_MNm=98.0, # [MN/m] + max_lateral_force_density=116.4, # [MN/m^3] + max_radial_force_density=148.0, # [MN/m^3] + centering_force_max_MN=2.99, + centering_force_min_MN=-1.29, + centering_force_avg_MN=1.61, + min_plasma_coil_distance=0.39, + derivative_min_LCFS_coils_dist=-1.0, # this is approximated for now + min_bend_radius=0.39, # [m] + neutron_peakfactor=1.6, + epseff=0.015, +) + + +def load_stellarator_config(istell: int, config_file: Optional[Path]): + """Load the appropriate Stellarator machine configuration + given the `istell` 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 + """ + match istell: + case 1: + machine_config = HELIAS5B + case 2: + machine_config = HELIAS4 + case 3: + machine_config = HELIAS3 + case 4: + machine_config = W7X30 + case 5: + machine_config = W7X50 + case 6: + if config_file is None: + raise ValueError("Stellarator config file is None but istell=6") + + with open(config_file) as f: + machine_config = json.load(f) + case _: + raise ValueError(f"{istell=} is not an integer in the range [1, 6]") + + for variable_name, variable_value in machine_config.items(): + setattr( + stellarator_configuration, + f"stella_config_{variable_name.lower()}", + variable_value, + ) diff --git a/source/fortran/stellarator_configuration.f90 b/source/fortran/stellarator_configuration.f90 index 37e1b2d943..aaa0f56008 100644 --- a/source/fortran/stellarator_configuration.f90 +++ b/source/fortran/stellarator_configuration.f90 @@ -119,477 +119,4 @@ module stellarator_configuration real(dp) :: stella_config_neutron_peakfactor ! The neutron peaking factor determined through inhomogeneities on the stellarator wall (qmax/qavg) [1] - - real(dp), dimension(:), allocatable :: sc_D11_star_mono_input - ! The monoenergetic radial transport coefficients normalized by the plateau value. - - real(dp), dimension(:), allocatable :: sc_nu_star_mono_input - ! The monoenergetic radial transport coefficients normalized by the plateau value. - - contains - - 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 - - - - subroutine stella_config_json() - - !! Initialises the effective stellarator values using a json input file - !! author: J Lion, IPP Greifswald - !! None - !! This routine reads in all effective variables that - !! are given needed by the 'constructor' stella_config - !!

The effective values are read in from a JSON-format file. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - use fson_library, only: fson_parse, fson_value, fson_get, fson_destroy - use global_variables, only: output_prefix - - - - ! Arguments - - ! Local variables - - integer :: n_values - character(len=180) :: filename - type(fson_value), pointer :: stellafile - - real(dp), dimension(:), allocatable :: nustar,d11,d13 - !type(stella_config), allocatable, dimension(:) :: stella_json - - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - ! Parse the json file - - filename = trim(output_prefix) // 'stella_conf.json' - stellafile => fson_parse(trim(filename)) - - ! Extract information arrays from the file - - call fson_get(stellafile, "name", stella_config_name) - call fson_get(stellafile, "symmetry", stella_config_symmetry) - - call fson_get(stellafile, "coilspermodule", stella_config_coilspermodule) - call fson_get(stellafile, "rmajor_ref", stella_config_rmajor_ref) - call fson_get(stellafile, "rminor_ref", stella_config_rminor_ref) - call fson_get(stellafile, "coil_rmajor", stella_config_coil_rmajor) - call fson_get(stellafile, "coil_rminor", stella_config_coil_rminor) - call fson_get(stellafile, "aspect_ref", stella_config_aspect_ref) - call fson_get(stellafile, "bt_ref", stella_config_bt_ref) - call fson_get(stellafile, "WP_area", stella_config_WP_area) - call fson_get(stellafile, "WP_bmax", stella_config_WP_bmax) - call fson_get(stellafile, "i0", stella_config_i0) - call fson_get(stellafile, "a1", stella_config_a1) - call fson_get(stellafile, "a2", stella_config_a2) - call fson_get(stellafile, "dmin", stella_config_dmin) - call fson_get(stellafile, "inductance", stella_config_inductance) - call fson_get(stellafile, "coilsurface", stella_config_coilsurface) - call fson_get(stellafile, "coillength", stella_config_coillength) - call fson_get(stellafile, "max_portsize_width", stella_config_max_portsize_width) - call fson_get(stellafile, "maximal_coil_height", stella_config_maximal_coil_height) - call fson_get(stellafile, "min_plasma_coil_distance", stella_config_min_plasma_coil_distance) - call fson_get(stellafile, "derivative_min_LCFS_coils_dist", stella_config_derivative_min_LCFS_coils_dist) - call fson_get(stellafile, "plasma_volume", stella_config_plasma_volume) - call fson_get(stellafile, "plasma_surface", stella_config_plasma_surface) - call fson_get(stellafile, "WP_ratio", stella_config_WP_ratio) - call fson_get(stellafile, "max_force_density", stella_config_max_force_density) - call fson_get(stellafile, "max_force_density_MNm", stella_config_max_force_density_MNm) - call fson_get(stellafile, "min_bend_radius", stella_config_min_bend_radius) - call fson_get(stellafile, "epseff", stella_config_epseff) - - call fson_get(stellafile, "max_lateral_force_density", stella_config_max_lateral_force_density) - call fson_get(stellafile, "max_radial_force_density", stella_config_max_radial_force_density) - - call fson_get(stellafile, "centering_force_max_MN", stella_config_centering_force_max_MN) - call fson_get(stellafile, "centering_force_min_MN", stella_config_centering_force_min_MN) - call fson_get(stellafile, "centering_force_avg_MN", stella_config_centering_force_avg_MN) - - call fson_get(stellafile, "neutron_peakfactor", stella_config_neutron_peakfactor) - - - call fson_get(stellafile, "number_nu_star", n_values) - - 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(n_values)) - allocate(sc_nu_star_mono_input(n_values)) - - - call fson_get(stellafile, "D11_star_mono_input", sc_D11_star_mono_input) - call fson_get(stellafile, "nu_star_mono_input", sc_nu_star_mono_input) - - - - - ! Clean up - call fson_destroy(stellafile) - - end subroutine stella_config_json - - - subroutine stella_error(index,keyname) - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Gives the errors of a the stellarator module - - integer, intent(in) :: index - character, intent(in) :: keyname - - - select case (index) - case(1) - ! Error reading in a json attribute - ! Not used yet because I don't know how. - write(*,*)'ERROR in initialization of stellarator config. Missing json key: ',keyname - - - case default - ! Return some error here. The index is not implemented yet. - write(*,*)'ERROR in stella_error! No such error index: ',index - - end select - - - end subroutine stella_error - - end module stellarator_configuration diff --git a/source/fortran/stellarator_variables.f90 b/source/fortran/stellarator_variables.f90 index 3635743afe..eec23506e9 100644 --- a/source/fortran/stellarator_variables.f90 +++ b/source/fortran/stellarator_variables.f90 @@ -115,5 +115,7 @@ subroutine init_stellarator_variables vportamax = 0.0D0 vportpmax = 0.0D0 vporttmax = 0.0D0 + max_gyrotron_frequency = 1.0D9 + te0_ecrh_achievable = 1.0D2 end subroutine init_stellarator_variables end module stellarator_variables