diff --git a/process/data_structure/physics_variables.py b/process/data_structure/physics_variables.py index ce1e9c99f..1809407d0 100644 --- a/process/data_structure/physics_variables.py +++ b/process/data_structure/physics_variables.py @@ -907,6 +907,9 @@ p_plasma_separatrix_mw: float = None """power to conducted to the divertor region (MW)""" +p_plasma_separatrix_rmajor_mw: float = None +"""Power to conducted to the divertor region per major radius (MW/m)""" + p_div_lower_separatrix_mw: float = None """Separatrix power conducted to the lower divertor region (calculated if `i_single_null = 0`) (MW)""" @@ -1544,6 +1547,7 @@ def init_physics_variables(): p_dd_total_mw, \ p_dhe3_total_mw, \ p_plasma_separatrix_mw, \ + p_plasma_separatrix_rmajor_mw, \ p_div_lower_separatrix_mw, \ p_div_upper_separatrix_mw, \ p_div_separatrix_max_mw, \ @@ -1808,6 +1812,7 @@ def init_physics_variables(): p_dd_total_mw = 0.0 p_dhe3_total_mw = 0.0 p_plasma_separatrix_mw = 0.0 + p_plasma_separatrix_rmajor_mw = 0.0 p_div_lower_separatrix_mw = 0.0 p_div_upper_separatrix_mw = 0.0 p_div_separatrix_max_mw = 0.0 diff --git a/process/main.py b/process/main.py index 07b0ae868..dcf5f7f5d 100644 --- a/process/main.py +++ b/process/main.py @@ -93,7 +93,13 @@ ) from process.log import logging_model_handler, show_errors from process.pfcoil import PFCoil -from process.physics import DetailedPhysics, Physics, PlasmaBeta, PlasmaInductance +from process.physics import ( + DetailedPhysics, + Physics, + PlasmaBeta, + PlasmaExhaust, + PlasmaInductance, +) from process.plasma_geometry import PlasmaGeom from process.plasma_profiles import PlasmaProfile from process.power import Power @@ -684,11 +690,13 @@ def __init__(self): ) self.plasma_beta = PlasmaBeta() self.plasma_inductance = PlasmaInductance() + self.plasma_exhaust = PlasmaExhaust() self.physics = Physics( plasma_profile=self.plasma_profile, current_drive=self.current_drive, plasma_beta=self.plasma_beta, plasma_inductance=self.plasma_inductance, + plasma_exhaust=self.plasma_exhaust, ) self.physics_detailed = DetailedPhysics( plasma_profile=self.plasma_profile, diff --git a/process/physics.py b/process/physics.py index de5922c93..ce246ea82 100644 --- a/process/physics.py +++ b/process/physics.py @@ -1387,13 +1387,21 @@ def _trapped_particle_fraction_sauter( class Physics: - def __init__(self, plasma_profile, current_drive, plasma_beta, plasma_inductance): + def __init__( + self, + plasma_profile, + current_drive, + plasma_beta, + plasma_inductance, + plasma_exhaust, + ): self.outfile = constants.NOUT self.mfile = constants.MFILE self.plasma_profile = plasma_profile self.current_drive = current_drive self.beta = plasma_beta self.inductance = plasma_inductance + self.exhaust = plasma_exhaust def physics(self): """ @@ -2165,12 +2173,14 @@ def physics(self): ) physics_variables.p_plasma_separatrix_mw = ( - physics_variables.f_p_alpha_plasma_deposited - * physics_variables.p_alpha_total_mw - + physics_variables.p_non_alpha_charged_mw - + pinj - + physics_variables.p_plasma_ohmic_mw - - physics_variables.p_plasma_rad_mw + self.exhaust.calculate_separatrix_power( + f_p_alpha_plasma_deposited=physics_variables.f_p_alpha_plasma_deposited, + p_alpha_total_mw=physics_variables.p_alpha_total_mw, + p_non_alpha_charged_mw=physics_variables.p_non_alpha_charged_mw, + p_hcd_injected_total_mw=pinj, + p_plasma_ohmic_mw=physics_variables.p_plasma_ohmic_mw, + p_plasma_rad_mw=physics_variables.p_plasma_rad_mw, + ) ) physics_variables.plfux_plasma_surface_neutron_avg_mw = ( @@ -9267,6 +9277,96 @@ def output_volt_second_information(self): po.oblnkl(self.outfile) +class PlasmaExhaust: + """Class to hold plasma exhaust calculations for plasma processing.""" + + def __init__(self): + self.outfile = constants.NOUT + self.mfile = constants.MFILE + + @staticmethod + def calculate_separatrix_power( + f_p_alpha_plasma_deposited: float, + p_alpha_total_mw: float, + p_non_alpha_charged_mw: float, + p_hcd_injected_total_mw: float, + p_plasma_ohmic_mw: float, + p_plasma_rad_mw: float, + ) -> float: + """ + Calculate the power crossing the separatrix (P_sep). + + :param f_p_alpha_plasma_deposited: Fraction of alpha power deposited in plasma. + :type f_p_alpha_plasma_deposited: float + :param p_alpha_total_mw: Total alpha power produced (MW). + :type p_alpha_total_mw: float + :param p_non_alpha_charged_mw: Power from non-alpha charged particles (MW). + :type p_non_alpha_charged_mw: float + :param p_hcd_injected_total_mw: Total power injected by heating and current drive (MW). + :type p_hcd_injected_total_mw: float + :param p_plasma_ohmic_mw: Ohmic heating power (MW). + :type p_plasma_ohmic_mw: float + :param p_plasma_rad_mw: Radiated power from plasma (MW). + :type p_plasma_rad_mw: float + :return: Power crossing the separatrix (MW). + :rtype: float + """ + + return ( + f_p_alpha_plasma_deposited * p_alpha_total_mw + + p_non_alpha_charged_mw + + p_hcd_injected_total_mw + + p_plasma_ohmic_mw + - p_plasma_rad_mw + ) + + @staticmethod + def calculate_psep_over_r_metric( + p_plasma_separatrix_mw: float, rmajor: float + ) -> float: + """ + Calculate the power crossing the separatrix per unit major radius (P_sep/R). + + :param p_plasma_separatrix_mw: Power crossing the separatrix (MW). + :type p_plasma_separatrix_mw: float + :param rmajor: Plasma major radius (m). + :type rmajor: float + :return: Power crossing the separatrix per unit major radius (MW/m). + :rtype: float + + """ + return p_plasma_separatrix_mw / rmajor + + @staticmethod + def calculate_eu_demo_re_attachment_metric( + p_plasma_separatrix_mw: float, + b_plasma_toroidal_on_axis: float, + q95: float, + aspect: float, + rmajor: float, + ) -> float: + """Calculate the EU DEMO divertor protection re-attachment metric for plasma exhaust. + + :param p_plasma_separatrix_mw: Power crossing the separatrix (MW). + :type p_plasma_separatrix_mw: float + :param b_plasma_toroidal_on_axis: Toroidal magnetic field on axis (T). + :type b_plasma_toroidal_on_axis: float + :param q95: Safety factor at 95% flux surface. + :type q95: float + :param aspect: Aspect ratio of the plasma. + :type aspect: float + :param rmajor: Plasma major radius (m). + :type rmajor: float + :return: EU DEMO re-attachment metric (MW T /m). + :rtype: float + + """ + + return (p_plasma_separatrix_mw * b_plasma_toroidal_on_axis) / ( + q95 * aspect * rmajor + ) + + class DetailedPhysics: """Class to hold detailed physics models for plasma processing."""