Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions process/data_structure/physics_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)"""
Expand Down Expand Up @@ -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, \
Expand Down Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion process/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
114 changes: 107 additions & 7 deletions process/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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 = (
Expand Down Expand Up @@ -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."""

Expand Down
Loading