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
4 changes: 4 additions & 0 deletions process/models/physics/bootstrap_current.py
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,10 @@ def bootstrap_fraction_sauter(self, plasma_profile: float) -> float:

# Calculate electron and ion temperature profiles
tempe = plasma_profile.teprofile.profile_y
# Check for any negative temperature in profile: always fatal eventually,
# report explicitly at source
if (tempe < 0).any():
raise ValueError("Negative temperature in plasma profile")
Comment on lines +1475 to +1476
Comment on lines +1473 to +1476
tempi = (
physics_variables.temp_plasma_ion_vol_avg_kev
/ physics_variables.temp_plasma_electron_vol_avg_kev
Expand Down
6 changes: 6 additions & 0 deletions process/models/physics/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,12 @@ def plasma_composition():
- znimp
)

# Negative znfuel can occur during solution and is always fatal,
# frequently resulting in a confusing bootstrap current error later.
# Catch early and explicitly instead
if znfuel < 0.0:
raise ValueError(f"znfuel is negative: {znfuel}")
Comment on lines +1167 to +1168

# ======================================================================

# Fuel ion density, nd_plasma_fuel_ions_vol_avg
Expand Down
Loading