Fix coolant demand to increase when outlet overheats

This commit is contained in:
Codex Agent
2025-11-23 01:11:33 +01:00
parent 35efbd79a2
commit 4f4e966d1d
3 changed files with 16 additions and 1 deletions

View File

@@ -61,8 +61,9 @@ class ControlSystem:
def coolant_demand(self, primary: CoolantLoopState) -> float:
desired_temp = 580.0
# Increase demand when outlet is hotter than desired, reduce when cooler.
error = (primary.temperature_out - desired_temp) / 100.0
demand = clamp(0.8 - error, 0.0, 1.0)
demand = clamp(0.8 + error, 0.0, 1.0)
LOGGER.debug("Coolant demand %.2f for outlet %.1fK", demand, primary.temperature_out)
return demand