From 6262e53952e13828e175a7febd151841aba8d958 Mon Sep 17 00:00:00 2001 From: Jonathan Maddock <78556175+jonmaddock@users.noreply.github.com> Date: Tue, 11 Mar 2025 11:22:00 +0000 Subject: [PATCH] Continuous kludge to keep pdivt > 0 --- process/physics.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/process/physics.py b/process/physics.py index eadcc389b8..ebec167d15 100644 --- a/process/physics.py +++ b/process/physics.py @@ -2240,9 +2240,12 @@ def physics(self): - physics_variables.p_plasma_rad_mw ) - # The following line is unphysical, but prevents -ve sqrt argument - # Should be obsolete if constraint eqn 17 is turned on - physics_variables.pdivt = max(0.001e0, physics_variables.pdivt) + # KLUDGE: Ensure pdivt is continuously positive (physical, rather than + # negative potential power), as required by other models (e.g. + # Physics.calculate_density_limit()) + physics_variables.pdivt = physics_variables.pdivt / ( + 1 - np.exp(-physics_variables.pdivt) + ) # if double null configuration share the power # over the upper and lower divertor, where physics_variables.ftar gives