bluemira.radiation_transport.radiation_profile ============================================== .. py:module:: bluemira.radiation_transport.radiation_profile .. autoapi-nested-parse:: 1-D radiation model inspired by the PROCESS function "plot_radprofile" in plot_proc.py. Classes ------- .. autoapisummary:: bluemira.radiation_transport.radiation_profile.RadiationSourceParams bluemira.radiation_transport.radiation_profile.Radiation bluemira.radiation_transport.radiation_profile.CoreRadiation bluemira.radiation_transport.radiation_profile.ScrapeOffLayerRadiation bluemira.radiation_transport.radiation_profile.DNScrapeOffLayerRadiation bluemira.radiation_transport.radiation_profile.SNScrapeOffLayerRadiation bluemira.radiation_transport.radiation_profile.RadiationSource Module Contents --------------- .. py:class:: RadiationSourceParams Bases: :py:obj:`bluemira.base.parameter_frame.ParameterFrame` .. autoapi-inheritance-diagram:: bluemira.radiation_transport.radiation_profile.RadiationSourceParams :parts: 1 :private-bases: Radiation source parameter frame .. py:attribute:: sep_corrector_omp :type: bluemira.base.parameter_frame.Parameter[float] Separation correction for double and single null plasma .. py:attribute:: sep_corrector_imp :type: bluemira.base.parameter_frame.Parameter[float] Separation correction for double and single null plasma .. py:attribute:: alpha_n :type: bluemira.base.parameter_frame.Parameter[float] Density profile factor .. py:attribute:: alpha_t :type: bluemira.base.parameter_frame.Parameter[float] Temperature profile index .. py:attribute:: det_t :type: bluemira.base.parameter_frame.Parameter[float] Detachment target temperature .. py:attribute:: eps_cool :type: bluemira.base.parameter_frame.Parameter[float] electron energy loss .. py:attribute:: f_ion_t :type: bluemira.base.parameter_frame.Parameter[float] Hydrogen first ionization .. py:attribute:: main_ext :type: bluemira.base.parameter_frame.Parameter[float] radiation region extension in main chamber .. py:attribute:: rec_ext_out_leg :type: bluemira.base.parameter_frame.Parameter[float] recycling region extension in outer leg .. py:attribute:: rec_ext_in_leg :type: bluemira.base.parameter_frame.Parameter[float] recycling region extension in inner leg .. py:attribute:: fw_lambda_q_far_imp :type: bluemira.base.parameter_frame.Parameter[float] Lambda_q far SOL imp .. py:attribute:: fw_lambda_q_far_omp :type: bluemira.base.parameter_frame.Parameter[float] Lambda_q far SOL omp .. py:attribute:: fw_lambda_q_near_imp :type: bluemira.base.parameter_frame.Parameter[float] Lambda_q near SOL imp .. py:attribute:: fw_lambda_q_near_omp :type: bluemira.base.parameter_frame.Parameter[float] Lambda_q near SOL omp .. py:attribute:: lambda_t_factor :type: bluemira.base.parameter_frame.Parameter[float] Lambda_t factor for non conduction-limited regime .. py:attribute:: lambda_n_factor :type: bluemira.base.parameter_frame.Parameter[float] Lambda_n factor for non conduction-limited regime .. py:attribute:: gamma_sheath :type: bluemira.base.parameter_frame.Parameter[float] sheath heat transmission coefficient .. py:attribute:: k_0 :type: bluemira.base.parameter_frame.Parameter[float] material's conductivity .. py:attribute:: lfs_p_fraction :type: bluemira.base.parameter_frame.Parameter[float] lfs fraction of SoL power .. py:attribute:: n_e_0 :type: bluemira.base.parameter_frame.Parameter[float] Electron density on axis .. py:attribute:: n_e_ped :type: bluemira.base.parameter_frame.Parameter[float] Electron density pedestal height .. py:attribute:: n_e_sep :type: bluemira.base.parameter_frame.Parameter[float] Electron density at separatrix .. py:attribute:: P_sep :type: bluemira.base.parameter_frame.Parameter[float] Radiation power .. py:attribute:: rho_ped_n :type: bluemira.base.parameter_frame.Parameter[float] Density pedestal r/a location .. py:attribute:: rho_ped_t :type: bluemira.base.parameter_frame.Parameter[float] Temperature pedestal r/a location .. py:attribute:: n_points_core_95 :type: bluemira.base.parameter_frame.Parameter[float] rho discretization to 95% of core .. py:attribute:: n_points_core_99 :type: bluemira.base.parameter_frame.Parameter[float] rho discretization to 99% of core .. py:attribute:: n_points_mantle :type: bluemira.base.parameter_frame.Parameter[float] rho discretization to separatrix .. py:attribute:: t_beta :type: bluemira.base.parameter_frame.Parameter[float] Temperature profile index beta .. py:attribute:: T_e_0 :type: bluemira.base.parameter_frame.Parameter[float] Electron temperature on axis .. py:attribute:: T_e_ped :type: bluemira.base.parameter_frame.Parameter[float] Electron temperature pedestal height .. py:attribute:: T_e_sep :type: bluemira.base.parameter_frame.Parameter[float] Electron temperature at separatrix .. py:attribute:: theta_inner_target :type: bluemira.base.parameter_frame.Parameter[float] Inner divertor poloidal angle with the separatrix flux line .. py:attribute:: theta_outer_target :type: bluemira.base.parameter_frame.Parameter[float] Outer divertor poloidal angle with the separatrix flux line .. py:class:: Radiation(eq: bluemira.equilibria.equilibrium.Equilibrium, params: dict | bluemira.base.parameter_frame.ParameterFrame) Initial and generic class (no distinction between core and SOL) to calculate radiation source within the flux tubes. .. py:attribute:: params .. py:attribute:: eq .. py:method:: collect_flux_tubes(psi_n: numpy.ndarray) -> list[bluemira.geometry.coordinates.Coordinates] Collect flux tubes according to the normalised psi. For now only used for the core as for the SoL the flux surfaces to calculate the heat flux from charged particles are used. :param psi_n: normalised psi :returns: list of flux tubes :rtype: flux tubes .. py:method:: flux_tube_pol_t(flux_tube: bluemira.geometry.coordinates.Coordinates, te_mp: float, t_rad_in: float = 0, t_rad_out: float = 0, rad_i: numpy.ndarray | None = None, rec_i: numpy.ndarray | None = None, t_tar: float = 0, *, core: bool = False, x_point_rad: bool = False, main_chamber_rad: bool = False) -> numpy.ndarray :staticmethod: Along a single flux tube, it assigns different temperature values. :param flux_tube: flux tube geometry :param te_mp: electron temperature at the midplane [keV] :param t_rad_in: temperature value at the entrance of the radiation region [keV] :param t_rad_out: temperature value at the exit of the radiation region [keV] :param rad_i: indexes of points, belonging to the flux tube, which fall into the radiation region :param rec_i: indexes of points, belonging to the flux tube, which fall into the recycling region :param t_tar: electron temperature at the target [keV] :param core: if True, t is constant along the flux tube. If false,it varies :param x_point_rad: if True, it assumes there is no radiation at all in the recycling region. :param main_chamber_rad: if True, the temperature from the midplane to the radiation region entrance is not constant :returns: poloidal distribution of electron temperature :rtype: te [keV] :raises ValueError: Required inputs not provided .. py:method:: flux_tube_pol_n(flux_tube: bluemira.geometry.coordinates.Coordinates, ne_mp: float, n_rad_in: float | None = None, n_rad_out: float | None = None, rad_i: numpy.ndarray | None = None, rec_i: numpy.ndarray | None = None, n_tar: float | None = None, *, core: bool = False, main_chamber_rad: bool = False) -> numpy.ndarray :staticmethod: Along a single flux tube, it assigns different density values. :param flux_tube: flux tube geometry :param ne_mp: electron density at the midplane [1/m^3] :param n_rad_in: density value at the entrance of the radiation region [1/m^3] :param n_rad_out: density value at the exit of the radiation region [1/m^3] :param rad_i: indexes of points, belonging to the flux tube, which fall into the radiation region :param rec_i: indexes of points, belonging to the flux tube, which fall into the recycling region :param n_tar: electron density at the target [1/m^3] :param core: if True, n is constant along the flux tube. If false,it varies :param main_chamber_rad: if True, the temperature from the midplane to the radiation region entrance is not constant :returns: poloidal distribution of electron density :rtype: ne :raises ValueError: Required inputs not provided .. py:method:: mp_profile_plot(rho: numpy.ndarray, rad_power: numpy.ndarray, imp_name: str | list[str], ax=None) -> matplotlib.pyplot.Axes :staticmethod: 1D plot of the radiation power distribution along the midplane. :param rho: dimensionless radius. Values between 0 and 1 for the plasma core. Values > 1 for the scrape-off layer :param rad_power: radiated power at each mid-plane location corresponding to rho [Mw/m^3] :param imp_name: impurity names :returns: axes on which the mid-plane radiation power distribution profile is plotted. :rtype: ax .. rubric:: Notes if rad_power.ndim > 1 the plot shows as many line as the number of impurities, plus the total radiated power .. py:class:: CoreRadiation(eq: bluemira.equilibria.equilibrium.Equilibrium, params: bluemira.base.parameter_frame.ParameterFrame, midplane_profiles: bluemira.radiation_transport.midplane_temperature_density.MidplaneProfiles, impurity_content: dict[str, float], impurity_data: dict[str, dict[str, tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]]]) Bases: :py:obj:`Radiation` .. autoapi-inheritance-diagram:: bluemira.radiation_transport.radiation_profile.CoreRadiation :parts: 1 :private-bases: Specific class to calculate the core radiation source. Temperature and density are assumed to be constant along a single flux tube. In addition to `Radiation`, this class also includes the impurity data of all gases except Argon. :param eq: The equilibrium defining flux surfaces. :param midplane_profiles: Electron density and electron temperature profile at the mid-plane. :param impurity_content: The dictionary of impurities (e.g. 'H') and their fractions (e.g. 1E-2) in the core. :param impurity_data: The dictionary of impurities in the core at a defined time, sorted by species, then sorted by "T_ref" v.s. "L_ref", where T_ref = reference ion temperature [eV], L_ref = the loss function value $L_z(n_e, T_e)$ [W m^3]. .. py:attribute:: impurities_content .. py:attribute:: imp_data_t_ref .. py:attribute:: imp_data_l_ref .. py:attribute:: imp_data_z_ref .. py:attribute:: impurity_symbols .. py:attribute:: profiles .. py:method:: calculate_mp_radiation_profile() 1D profile of the line radiation loss at the mid-plane from the magnetic axis to the separatrix .. py:method:: plot_mp_radiation_profile() Plot one dimensional behaviour of line radiation against the adimensional radius .. py:method:: calculate_core_distribution() -> list[list[numpy.ndarray]] Build poloidal distribution (distribution along the field lines) of line radiation loss in the plasma core. :returns: Line core radiation for each impurity species and for each closed flux line in the core. :rtype: rad .. py:method:: calculate_core_radiation_map() Build core radiation map. :returns: the core radiation map .. py:method:: radiation_distribution_plot(flux_tubes: numpy.ndarray, power_density: numpy.ndarray, ax=None) -> matplotlib.pyplot.Axes 2D plot of the core radiation power distribution. :param flux_tubes: array of the closed flux tubes within the separatrix. :param power_density: arrays containing the power radiation density of the points lying on each flux tube [MW/m^3] :returns: the axes .. py:method:: plot_radiation_distribution() Plot poloidal radiation distribution within the plasma core .. py:method:: plot_lz_vs_tref() Plot radiative loss function for a set of given impurities against the reference temperature. .. py:class:: ScrapeOffLayerRadiation(eq: bluemira.equilibria.equilibrium.Equilibrium, params: bluemira.base.parameter_frame.ParameterFrame, x_sep_omp: float | None = None, x_sep_imp: float | None = None, dx_omp: float | None = None, dx_imp: float | None = None) Bases: :py:obj:`Radiation` .. autoapi-inheritance-diagram:: bluemira.radiation_transport.radiation_profile.ScrapeOffLayerRadiation :parts: 1 :private-bases: Specific class to calculate the SOL radiation source. In the SOL is assumed a conduction dominated regime until the x-point, with no heat sinks, and a convection dominated regime between x-point and target. :param eq: The equilibrium defining flux surfaces. :param x_sep_omp: outboard mid-plane separatrix x-coordinates [m] :param x_sep_imp: inboard mid-plane separatrix x-coordinates [m] :param dx_omp: The midplane spatial resolution between flux surfaces at the outboard [m] :param dx_imp: The midplane spatial resolution between flux surfaces at the inboard [m] .. py:attribute:: x_sep_omp :value: None .. py:attribute:: x_sep_imp :value: None .. py:attribute:: dx_omp :value: None .. py:attribute:: dx_imp :value: None .. py:method:: collect_x_and_o_point_coordinates() Magnetic axis coordinates and x-point(s) coordinates. .. py:method:: collect_separatrix_parameters() Radiation source relevant parameters at the separatrix .. py:method:: x_point_radiation_z_ext(main_ext: float | None = None, pfr_ext: float = 0.3, *, low_div: bool = True) -> tuple[float, Ellipsis] Simple definition of a radiation region around the x-point. The region is supposed to extend from an arbitrary z coordinate on the main plasma side, to an arbitrary z coordinate on the private flux region side. :param main_ext: region extension on the main plasma side [m] :param pfr_ext: region extension on the private flux region side [m] :param low_div: default=True for the lower divertor. If False, upper divertor :type low_div: boolean :returns: * *z_main* -- vertical (z coordinate) extension of the radiation region toward the main plasma [m] * *z_pfr* -- vertical (z coordinate) extension of the radiation region toward the pfr [m] .. py:method:: radiation_region_ends(z_main: float, z_pfr: float, *, lfs: bool = True) -> tuple[float, Ellipsis] Entering and exiting points (x, z) of the radiation region detected on the separatrix. The separatrix is supposed to be given by relevant half. :param z_main: vertical (z coordinate) extension of the radiation region toward the main plasma [m] :param z_pfr: vertical (z coordinate) extension of the radiation region toward the pfr [m] :param lfs: default=True for the low field side (right half). If False, high field side (left half). :returns: * *entrance_x, entrance_z* -- x, z coordinates of the radiation region starting point * *exit_x, exit_z* -- x, z coordinates of the radiation region ending point .. py:method:: radiation_region_points(flux_tube: bluemira.geometry.coordinates.Coordinates, z_main: float, z_pfr: float, *, lower: bool = True) -> tuple[numpy.ndarray, Ellipsis] :staticmethod: For a given flux tube, indexes of points which fall respectively into the radiation and recycling region :param flux_tube: flux tube geometry :param z_main: vertical (z coordinate) extension of the radiation region toward the main plasma. Taken on the separatrix [m] :param z_pfr: vertical (z coordinate) extension of the radiation region toward the pfr. Taken on the separatrix [m] :param lower: default=True for the lower divertor. If False, upper divertor :returns: * *rad_i* -- indexes of the points within the radiation region * *rec_i* -- indexes pf the points within the recycling region .. py:method:: mp_electron_density_temperature_profiles(te_sep: float | None = None, *, omp: bool = True) -> tuple[numpy.ndarray, Ellipsis] Calculation of electron density and electron temperature profiles across the SoL at midplane. It uses the customised version for the mid-plane of the exponential decay law described in "electron_density_and_temperature_sol_decay". :param te_sep: electron temperature at the separatrix [keV] :param omp: outer mid-plane. Default value True. If False it stands for inner mid-plane :returns: * *te_sol* -- radial decayed temperatures through the SoL at the mid-plane. Unit [keV] * *ne_sol* -- radial decayed densities through the SoL at the mid-plane. Unit [1/m^3] .. py:method:: any_point_density_temperature_profiles(x_p: float, z_p: float, t_p: float, t_u: float, *, lfs: bool = True) -> tuple[numpy.ndarray, Ellipsis] Calculation of electron density and electron temperature profiles across the SoL, starting from any point on the separatrix. (The z coordinate is the same. While the x coordinate changes) Using the equation to calculate T(s||). :param x_p: x coordinate of the point at the separatrix [m] :param z_p: z coordinate of the point at the separatrix [m] :param t_p: point temperature [eV] :param t_u: upstream temperature [eV] :param lfs: low (toroidal) field side (outer wall side). Default value True. If False it stands for high field side (hfs). :returns: * *te_prof* -- radial decayed temperatures through the SoL. Unit [eV] * *ne_prof* -- radial decayed densities through the SoL. Unit [1/m^3] .. py:method:: tar_electron_densitiy_temperature_profiles(ne_div: numpy.ndarray, te_div: numpy.ndarray, f_m: float = 1, *, detachment: bool = False) -> tuple[numpy.ndarray, Ellipsis] Calculation of electron density and electron temperature profiles across the SoL at the target. From the pressure balance, considering friction losses. :param ne_div: density of the flux tubes at the entrance of the recycling region, assumed to be corresponding to the divertor plane [1/m^3] :param te_div: temperature of the flux tubes at the entrance of the recycling region, assumed to be corresponding to the divertor plane [eV] :param f_m: fractional loss of pressure due to friction. It can vary between 0 and 1. :returns: * *te_t* -- target temperature [eV] * *ne_t* -- target density [1/m^3] .. py:method:: calculate_sector_distributions(flux_tubes: numpy.ndarray, x_strike: float, z_strike: float, main_ext: float, firstwall_geom: bluemira.geometry.coordinates.Coordinates, pfr_ext: float | None = None, rec_ext: float | None = None, *, x_point_rad: bool = False, detachment: bool = False, lfs: bool = True, low_div: bool = True, main_chamber_rad: bool = False) -> tuple[numpy.ndarray, Ellipsis] Temperature and density profiles calculation. Within the scrape-off layer sector, it gives temperature and density profile along each flux tube. :param flux_tubes: set of flux tubes :type flux_tubes: array :param x_strike: x coordinate of the first open flux surface strike point [m] :type x_strike: float :param z_strike: z coordinate of the first open flux surface strike point [m] :type z_strike: float :param main_ext: extension of the radiation region from the x-point towards the main plasma [m] :type main_ext: float :param firstwall_geom: first wall geometry :param pfr_ext: extension of the radiation region from the x-point towards private flux region [m] :param rec_ext: extension of the recycling region, along the separatrix, from the target [m] :param x_point_rad: if True, it assumes there is no radiation at all in the recycling region, and pfr_ext MUST be provided. :param detachment: if True, it makes the temperature decay through the recycling region from the H ionization temperature to the assign temperature for detachment at the target. Else temperature is constant through the recycling region. :param lfs: low field side. Default value True. If False it stands for high field side (hfs) :param low_div: default=True for the lower divertor. If False, upper divertor :param main_chamber_rad: if True, the temperature from the midplane to the radiation region entrance is not constant :returns: * *t_pol* -- temperature poloidal profile along each flux tube within the specified set [keV] * *n_pol* -- density poloidal profile along each flux tube within the specified set [1/m^3] :raises ValueError: Required inputs not provided .. py:method:: radiation_distribution_plot(flux_tubes, power_density, firstwall, ax=None) 2D plot of the radiation power distribution. :param flux_tubes: list of arrays of the flux tubes of different sectors. Example: if len(flux_tubes) = 2, it could contain the set of flux tubes of the lower that go from the omp to the outer lower divertor, and the set of flux tubes that go from the imp to the inner lower divertor. :type flux_tubes: [np.array] :param power_density: list of arrays containing the power radiation density of the points lying on the specified flux tubes. expected len(flux_tubes) = len(power_density) :type power_density: [np.array] :param firstwall: first wall geometry :type firstwall: Grid :returns: Axes on which the 2D radiation power distribution is plotted. :rtype: ax .. py:method:: poloidal_distribution_plot(flux_tubes: numpy.ndarray, flux_property: numpy.ndarray, *, temperature: bool = True, ax=None) :staticmethod: 2D plot of a generic property (density, temperature or radiation) as poloidal section the flux tube points. :param flux_tubes: array of the open flux tubes within the SoL. :param flux_property: arrays containing the property values associated to the points of each flux tube. :returns: Axes on which the flux tubes' properties are plotted. :rtype: ax .. py:method:: plot_t_vs_n(flux_tube, t_distribution, n_distribution, ax1=None) -> matplotlib.pyplot.Axes :staticmethod: 2D plot of temperature and density of a single flux tube within the SoL :param flux_tube: open flux tube within the SoL. :type flux_tube: flux surface object as described in advective_transport.py :param t_distribution: arrays containing the temperature values associated to the points of the flux tube. :type t_distribution: np.array([np.array]) :param n_distribution: arrays containing the density values associated to the points of the flux tube. :type n_distribution: np.array([np.array]) :returns: * *ax1* -- Axes object on which the electron temperature is plotted * *ax2* -- Axes object on which the electron density is plotted .. py:class:: DNScrapeOffLayerRadiation(eq: bluemira.equilibria.equilibrium.Equilibrium, params: bluemira.base.parameter_frame.ParameterFrame, flux_surfaces: list[bluemira.equilibria.flux_surfaces.PartialOpenFluxSurface], impurity_content: dict[str, float], impurity_data: dict[str, dict[str, tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]]], firstwall_geom: bluemira.geometry.coordinates.Coordinates, x_sep_omp: float | None = None, x_sep_imp: float | None = None, dx_omp: float | None = None, dx_imp: float | None = None) Bases: :py:obj:`ScrapeOffLayerRadiation` .. autoapi-inheritance-diagram:: bluemira.radiation_transport.radiation_profile.DNScrapeOffLayerRadiation :parts: 1 :private-bases: Specific class to make the SOL radiation source for a double null configuration. Here the SOL is divided into for regions. From the outer midplane to the outer lower target; from the omp to the outer upper target; from the inboard midplane to the inner lower target; from the imp to the inner upper target. :param eq: The equilibrium defining flux surfaces. :param flux_surfaces: list of flux surfaces, all of which terminating at the first walls. :param impurity_content: The dictionary of impurities in the double-null's scrape-off layer (e.g. 'H') and their fractions (e.g. 1E-2). :param impurity_data: The dictionary of impurities in the double-null's scrape-off layer at a defined time, sorted by species, then sorted by "T_ref" v.s. "L_ref", where T_ref = reference ion temperature [eV], L_ref = the loss function value $L_z(n_e, T_e)$ [W m^3]. :param firstwall_geom: The closed first wall geometry :param x_sep_omp: outboard mid-plane separatrix x-coordinates [m] :param x_sep_imp: inboard mid-plane separatrix x-coordinates [m] :param dx_omp: The midplane spatial resolution between flux surfaces at the outboard [m] :param dx_imp: The midplane spatial resolution between flux surfaces at the inboard [m] .. py:attribute:: impurities_content .. py:attribute:: imp_data_t_ref .. py:attribute:: imp_data_l_ref .. py:attribute:: flux_tubes_lfs_low .. py:attribute:: flux_tubes_hfs_low .. py:attribute:: flux_tubes_lfs_up .. py:attribute:: flux_tubes_hfs_up .. py:attribute:: x_strike_lfs .. py:attribute:: z_strike_lfs .. py:attribute:: alpha_lfs .. py:attribute:: b_pol_out_tar .. py:attribute:: b_tor_out_tar .. py:attribute:: b_tot_out_tar .. py:attribute:: x_strike_hfs .. py:attribute:: z_strike_hfs .. py:attribute:: alpha_hfs .. py:attribute:: b_pol_inn_tar .. py:attribute:: b_tor_inn_tar .. py:attribute:: b_tot_inn_tar .. py:attribute:: t_omp .. py:attribute:: t_imp .. py:method:: calculate_sol_distribution(firstwall_geom: bluemira.geometry.coordinates.Coordinates) Temperature and density profiles calculation. For each scrape-off layer sector, it gives temperature and density profile along each flux tube. :param firstwall_geom: first wall geometry :type firstwall_geom: grid :returns: * *t_and_n_pol["lfs_low"]* -- temperature and density poloidal profile along each flux tube within the lfs lower divertor set * *t_and_n_pol["lfs_up"]* -- temperature and density poloidal profile along each flux tube within the lfs upper divertor set * *t_and_n_pol["hfs_low"]* -- temperature and density poloidal profile along each flux tube within the hfs lower divertor set * *t_and_n_pol["hfs_up"]* -- temperature and density poloidal profile along each flux tube within the hfs upper divertor set .. py:method:: calculate_sol_radiation_distribution(lfs_low, lfs_up, hfs_low, hfs_up) Radiation profiles calculation. For each scrape-off layer sector, it gives the radiation profile along each flux tube. :param lfs_low: temperature and density poloidal profile along each flux tube within the lfs lower divertor set :param lfs_up: temperature and density poloidal profile along each flux tube within the lfs upper divertor set :param hfs_low: temperature and density poloidal profile along each flux tube within the hfs lower divertor set :param hfs_up: temperature and density poloidal profile along each flux tube within the hfs upper divertor set :returns: * *rad["lfs_low"]* -- radiation poloidal profile along each flux tube within the lfs lower divertor set * *rad["lfs_up"]* -- radiation poloidal profile along each flux tube within the lfs upper divertor set * *rad["hfs_low"]* -- radiation poloidal profile along each flux tube within the hfs lower divertor set * *rad["hfs_up"]* -- radiation poloidal profile along each flux tube within the hfs upper divertor set .. py:method:: calculate_sol_radiation_map(lfs_low, lfs_up, hfs_low, hfs_up) Scrape off layer radiation map calculation. :param lfs_low: radiation poloidal profile along each flux tube within the lfs lower divertor set :param lfs_up: radiation poloidal profile along each flux tube within the lfs upper divertor set :param hfs_low: radiation poloidal profile along each flux tube within the hfs lower divertor set :param hfs_up: radiation poloidal profile along each flux tube within the hfs upper divertor set :returns: the SOL radiation map .. py:method:: plot_poloidal_radiation_distribution(firstwall_geom: bluemira.equilibria.grid.Grid) Plot poloidal radiation distribution within the scrape-off layer :param firstwall_geom: first wall geometry .. py:class:: SNScrapeOffLayerRadiation(eq: bluemira.equilibria.equilibrium.Equilibrium, params: bluemira.base.parameter_frame.ParameterFrame, flux_surfaces: list[bluemira.equilibria.flux_surfaces.PartialOpenFluxSurface], impurity_content: dict[str, float], impurity_data: dict[str, dict[str, tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]]], firstwall_geom: bluemira.geometry.coordinates.Coordinates, x_sep_omp: float, dx_omp: float) Bases: :py:obj:`ScrapeOffLayerRadiation` .. autoapi-inheritance-diagram:: bluemira.radiation_transport.radiation_profile.SNScrapeOffLayerRadiation :parts: 1 :private-bases: Specific class to make the SOL radiation source for a double null configuration. Here the SOL is divided into for regions. From the outer midplane to the outer lower target; from the omp to the outer upper target; from the inboard midplane to the inner lower target; from the imp to the inner upper target. :param eq: The equilibrium defining flux surfaces. :param flux_surfaces: list of flux surfaces, all of which terminating at the first walls. :param impurity_content: The dictionary of impurities in the single-null scrape-off layer (e.g. 'H') and their fractions (e.g. 1E-2). :param impurity_data: The dictionary of impurities in the single-null scrape-off layer at a defined time, sorted by species, then sorted by "T_ref" v.s. "L_ref", where T_ref = reference ion temperature [eV], L_ref = the loss function value $L_z(n_e, T_e)$ [W m^3]. :param firstwall_geom: The closed first wall geometry :param x_sep_omp: outboard mid-plane separatrix x-coordinates [m] :param dx_omp: The midplane spatial resolution between flux surfaces at the outboard [m] .. py:attribute:: impurities_content .. py:attribute:: imp_data_t_ref .. py:attribute:: imp_data_l_ref .. py:attribute:: flux_tubes_lfs .. py:attribute:: flux_tubes_hfs .. py:attribute:: x_strike_lfs .. py:attribute:: z_strike_lfs .. py:attribute:: alpha_lfs .. py:attribute:: b_pol_out_tar .. py:attribute:: b_tor_out_tar .. py:attribute:: b_tot_out_tar .. py:attribute:: x_strike_hfs .. py:attribute:: z_strike_hfs .. py:attribute:: alpha_hfs .. py:attribute:: b_pol_inn_tar .. py:attribute:: b_tor_inn_tar .. py:attribute:: b_tot_inn_tar .. py:attribute:: t_omp .. py:method:: calculate_sol_distribution(firstwall_geom: bluemira.equilibria.grid.Grid) -> dict[str, numpy.typing.NDArray[numpy.float64]] Temperature and density profiles calculation. For each scrape-off layer sector, it gives temperature and density profile along each flux tube. :param firstwall_geom: first wall geometry :returns: * *t_and_n_pol["lfs"]* -- temperature and density poloidal profile along each flux tube within the lfs divertor set * *t_and_n_pol["hfs"]* -- temperature and density poloidal profile along each flux tube within the hfs divertor set .. py:method:: calculate_sol_radiation_distribution(lfs: numpy.ndarray, hfs: numpy.ndarray) -> dict[str, list[list[numpy.ndarray]]] Radiation profiles calculation. For each scrape-off layer sector, it gives the radiation profile along each flux tube. :param lfs: temperature and density poloidal profile along each flux tube within the lfs divertor set :param hfs: temperature and density poloidal profile along each flux tube within the hfs divertor set :returns: * *rad["lfs"]* -- radiation poloidal profile along each flux tube within the lfs divertor set * *rad["hfs"]* -- radiation poloidal profile along each flux tube within the hfs divertor set .. py:method:: calculate_sol_radiation_map(lfs: numpy.ndarray, hfs: numpy.ndarray) Scrape off layer radiation map calculation. :param lfs: radiation poloidal profile along each flux tube within the lfs divertor set :param hfs: radiation poloidal profile along each flux tube within the hfs upper divertor set .. py:method:: plot_poloidal_radiation_distribution(firstwall_geom: bluemira.geometry.coordinates.Coordinates) Plot poloidal radiation distribution within the scrape-off layer :param firstwall_geom: first wall geometry .. py:class:: RadiationSource(eq: bluemira.equilibria.equilibrium.Equilibrium, firstwall_shape: bluemira.geometry.coordinates.Coordinates, params: bluemira.base.parameter_frame.typed.ParameterFrameLike, midplane_profiles: bluemira.radiation_transport.midplane_temperature_density.MidplaneProfiles, core_impurities: dict[str, float], sol_impurities: dict[str, float], confinement_time_core: float = np.inf, confinement_time_sol: float = 10, source_sol_dl: float | None = None, dx_mp: float = 0.001) Simplified solver to easily access the radiation model location inputs. :param eq: The equilibrium defining flux surfaces. :param firstwall_shape: BluemiraWire defining the first wall. :param midplane_profiles: Electron density and electron temperature profile at the mid-plane. :param core_impurities: The dictionary of impurities in the core (e.g. 'H') and their fractions (e.g. 1E-2). :param sol_impurities: The dictionary of impurities in the scrape-off layer (e.g. 'H') and their fractions (e.g. 1E-2). :param confinement_time_sol: Confinement timescale at the scrape-off layer [s] :param confinement_time_core: Confinement timescale in the core [s] :param source_sol_dl: the discretisation length of the scrape of layer source term [m] :param dx_mp: The midplane spatial resolution between flux surfaces [m] .. py:attribute:: params :type: RadiationSourceParams .. py:attribute:: param_cls :type: type[RadiationSourceParams] .. py:attribute:: eq .. py:attribute:: imp_content_core .. py:attribute:: imp_data_core .. py:attribute:: imp_content_sol .. py:attribute:: imp_data_sol .. py:attribute:: lcfs .. py:attribute:: midplane_profiles .. py:attribute:: core_rad :value: None .. py:attribute:: sol_rad :value: None .. py:attribute:: x_tot :value: None .. py:attribute:: z_tot :value: None .. py:attribute:: rad_tot :value: None .. py:method:: analyse(firstwall_geom: bluemira.geometry.coordinates.Coordinates) -> tuple[CoreRadiation, ScrapeOffLayerRadiation] Using core radiation model and SOL radiation model to calculate the radiation source at all points :param firstwall_geom: The closed first wall geometry :returns: * *self.core_rad* -- Core radiation source * *self.sol_rad* -- Scrape-off-layer radiation source .. py:method:: rad_core_by_psi_n(psi_n: float | numpy.ndarray) -> numpy.ndarray Calculation of core radiation source for a given (set of) psi norm value(s) :param psi_n: The normalised magnetic flux value(s), between the minimum and maximum of [self.midplane_profiles.psi_n.min(), self.midplane_profiles.psi_n.max()]. :returns: Local radiation source value(s) associated to the given psi_n :rtype: rad_new .. py:method:: rad_core_by_points(x: float | numpy.ndarray, z: float | numpy.ndarray) -> numpy.ndarray Calculation of core radiation source for a given (set of) x, z coordinates :param x: The x coordinate(s) of desired radiation source point(s) :param z: The z coordinate(s) of desired radiation source point(s) :returns: Local radiation source value(s) associated to the point(s) :rtype: self.rad_core_by_psi_n(psi_n) .. py:method:: rad_sol_by_psi_n(psi_n: float | numpy.ndarray[float]) -> numpy.ndarray Calculation of SOL radiation sources for a given psi norm value. Each psi_n corresponds to a flux surface defined by a list of x-z coordinates. In the SOL (i.e. outside the LCFS) the radiation intensity is not constant, but rather varies across the flux surface. Therefore this method returns a radiation intensity value for each x-z coordinates in the list defining each flux surface. :param psi_n: The normalised magnetic flux value, between the minimum and maximum of [self.eq.psi_norm().min(), self.eq.psi_norm().max()]. :type psi_n: float :returns: Local radiation source values associated to the given psi_n :rtype: list .. py:method:: rad_sol_by_points(x_lst: collections.abc.Iterable[float], z_lst: collections.abc.Iterable[float]) -> numpy.ndarray Calculation of SOL radiation source for a given (set of) x, z coordinates :param x_lst: The x coordinate(s) of desired radiation source point(s) :param z_lst: The z coordinate(s) of desired radiation source point(s) :returns: Local radiation source value(s) associated to the point(s) :rtype: list .. py:method:: rad_by_psi_n(psi_n: float) -> numpy.ndarray Calculation of any radiation source for a given (set of) psi norm value(s) :param psi_n: The normalised magnetic flux value(s), between the minimum and maximum of [self.eq.psi_norm().min(), self.eq.psi_norm().max()]. :returns: Local radiation source value(s) associated to the given psi_n :rtype: rad_any .. py:method:: rad_by_points(x: float | numpy.ndarray, z: float | numpy.ndarray) -> numpy.ndarray Calculation of any radiation source for a given (set of) x, z coordinates :param x: The x coordinate(s) of desired radiation source point(s) :param z: The z coordinate(s) of desired radiation source point(s) :returns: Local radiation source values located at the meshgrid formed by meshgrid of x and z. :rtype: rad_any .. py:method:: rad_map(firstwall_geom: bluemira.geometry.coordinates.Coordinates) Mapping all the radiation values associated to all the points as three arrays containing x coordinates, z coordinates and local radiated power density [MW/m^3] :returns: * *self.x_tot* -- x-coordinates of flux tubes [m] * *self.z_tot* -- z-coordinates of flux tubes [m] * *self.rad_tot* -- total radiated power density [MW/m^3] .. py:method:: plot(ax=None, *, plot_flux_tubes: bool = False) -> matplotlib.pyplot.Axes Plot the RadiationSolver results. :returns: The axes object on which radiation solver results are plotted. :rtype: ax