Add enthalpy tracking and dashboard metrics

This commit is contained in:
Codex Agent
2025-11-25 20:23:25 +01:00
parent 3cb72f7ff0
commit 327fca7096
9 changed files with 124 additions and 61 deletions

View File

@@ -84,12 +84,13 @@ class ControlSystem:
power_floor = 0.0
if core_power_mw is not None:
power_fraction = clamp(core_power_mw / constants.NORMAL_CORE_POWER_MW, 0.0, 1.5)
power_floor = 0.15 + 0.2 * power_fraction
# Allow warmer operation when electrical load is already being served (turbines online),
# but keep a higher floor when idling so test scenarios still converge near 3 GW.
if electrical_output_mw is not None and electrical_output_mw > 10.0:
power_floor *= 0.6
power_floor = 0.2 + 0.25 * power_fraction
demand = max(demand, power_floor)
# At power, keep primary pumps near full speed to preserve pressure/subcooling.
if core_power_mw is not None and core_power_mw > 500.0:
demand = max(demand, 0.8)
elif core_power_mw is not None and core_power_mw > 100.0:
demand = max(demand, 0.6)
demand = clamp(demand, 0.0, 1.0)
LOGGER.debug(
"Coolant demand %.2f (temp_error=%.2f, power_floor=%.2f) for outlet %.1fK power %.1f MW elec %.1f MW",