diff --git a/TODO.md b/TODO.md index 6ddcfdb..29af1c9 100644 --- a/TODO.md +++ b/TODO.md @@ -12,4 +12,4 @@ - Adjust HX/pressure handling to use stored energy (saturation clamp and pressure rise) and validate steam formation with both pumps at ~3 GW. Use realistic tube-side material assumptions (Inconel 690/SS cladding) and clamp steam quality to phase-equilibrium enthalpy. - Update turbine power mapping to consume steam enthalpy/quality and align protection trips with real steam presence; drive inlet steam around 6–7 MPa, quality/enthalpy-based flow to ~550–600 MW(e) per machine class if steam is available. - Add integration test: cold start → gens/pumps 2/2 → ramp to ~3 GW → confirm steam quality threshold at the secondary drum → enable all turbines and require electrical output. Include a step that tolerates one secondary pump off for a period to prove redundancy still yields steam. -- [ ] Dashboard follow-ups: clarify or replace turbine “Steam P” field (currently shows loop pressure, not turbine-driving steam); consider removing it if no better signal is available. +- [x] Dashboard follow-ups: replace turbine “Steam P” with a more useful steam availability signal (enthalpy × steam flow). diff --git a/src/reactor_sim/dashboard.py b/src/reactor_sim/dashboard.py index 4191cbf..b963f3b 100644 --- a/src/reactor_sim/dashboard.py +++ b/src/reactor_sim/dashboard.py @@ -490,7 +490,7 @@ class ReactorDashboard: [ ("Turbines", " ".join(self._turbine_status_lines())), ("Rated Elec", f"{len(self.reactor.turbines)*self.reactor.turbines[0].rated_output_mw:7.1f} MW"), - ("Steam P", f"{self._steam_pressure(state):5.2f} MPa"), + ("Steam Avail", f"{self._steam_available_power(state):7.1f} MW"), ("Unit1 Elec", f"{state.turbines[0].electrical_output_mw:7.1f} MW" if state.turbines else "n/a"), ( "Unit2 Elec", @@ -733,11 +733,15 @@ class ReactorDashboard: lines.append(("Relief valves", ", ".join(reliefs) if reliefs else "Closed")) return lines - def _steam_pressure(self, state: PlantState) -> float: - # Only report steam pressure if quality/flow indicate steam is present. - if state.secondary_loop.steam_quality < 0.05 or state.secondary_loop.mass_flow_rate < 100.0: + def _steam_available_power(self, state: PlantState) -> float: + mass_flow = state.secondary_loop.mass_flow_rate * max(0.0, state.secondary_loop.steam_quality) + if mass_flow <= 1.0: return 0.0 - return state.secondary_loop.pressure + if state.turbines: + enthalpy_kjkg = max(0.0, state.turbines[0].steam_enthalpy) + else: + enthalpy_kjkg = (constants.STEAM_LATENT_HEAT / 1_000.0) + return (enthalpy_kjkg * mass_flow) / 1_000.0 def _update_trends(self, state: PlantState) -> None: self._trend_history.append((state.time_elapsed, state.core.fuel_temperature, state.core.power_output_mw))