Skip to content
Open
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
14 changes: 10 additions & 4 deletions process/models/physics/confinement_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class ConfinementTimeData:
"""Plasma energy confinement time in seconds."""
p_plasma_loss_mw: float
"""Total plasma loss power in MW."""
hstar: float
"""Non-radiation corrected H factor on energy confinement times"""


class PlasmaConfinementTime(Model):
Expand Down Expand Up @@ -936,8 +938,11 @@ def calculate_confinement_time(

# Calculate H* non-radiation corrected H factor
# Note: we will assume the IPB-98y2 scaling.
if self.data.physics.i_rad_loss == ConfinementRadiationLossModel.CORE_ONLY:
self.data.physics.hstar = (
if (
ConfinementRadiationLossModel(self.data.physics.i_rad_loss)
== ConfinementRadiationLossModel.CORE_ONLY
):
hstar = (
hfact
* (
p_plasma_loss_mw
Expand All @@ -952,7 +957,7 @@ def calculate_confinement_time(
elif (
self.data.physics.i_rad_loss == ConfinementRadiationLossModel.FULL_RADIATION
):
self.data.physics.hstar = (
hstar = (
hfact
* (
p_plasma_loss_mw
Expand All @@ -964,7 +969,7 @@ def calculate_confinement_time(
** 0.31

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only work for the selected scaling if the loss power index is (1-0.31), so really just the IPB98 scalings in this case

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be turned into an issue. This PR is just stopping hstar being incorrectly set every time calculate_confinement_time is called

)
elif self.data.physics.i_rad_loss == ConfinementRadiationLossModel.NO_RADIATION:
self.data.physics.hstar = hfact
hstar = hfact

# Calculation of the transport power loss terms
# Transport losses in Watts/m3 are 3/2 * n.e.T / tau , with T in eV
Expand Down Expand Up @@ -1002,6 +1007,7 @@ def calculate_confinement_time(
t_ion_energy_confinement=t_ion_energy_confinement,
t_plasma_energy_confinement=t_energy_confinement,
p_plasma_loss_mw=p_plasma_loss_mw,
hstar=hstar,
)

@staticmethod
Expand Down
1 change: 1 addition & 0 deletions process/models/physics/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,7 @@ def run(self):
confinement_time_data.t_ion_energy_confinement
)
self.data.physics.p_plasma_loss_mw = confinement_time_data.p_plasma_loss_mw
self.data.physics.hstar = confinement_time_data.hstar

# Total transport power from scaling law (MW)
self.data.physics.p_electron_transport_loss_mw = (
Expand Down
1 change: 1 addition & 0 deletions process/models/stellarator/stellarator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2295,6 +2295,7 @@ def st_phys(self, output):
confinement_time_data.t_ion_energy_confinement
)
self.data.physics.p_plasma_loss_mw = confinement_time_data.p_plasma_loss_mw
self.data.physics.hstar = confinement_time_data.hstar

self.data.physics.ntau, self.data.physics.nTtau = (
self.physics.confinement.calculate_double_and_triple_product(
Expand Down
Loading