Surface feedwater and governor telemetry on dashboard
This commit is contained in:
@@ -464,7 +464,11 @@ class ReactorDashboard:
|
||||
"Flow",
|
||||
f"{state.secondary_loop.mass_flow_rate:7.0f}/{self.reactor.secondary_pump.nominal_flow * len(self.reactor.secondary_pump_units):.0f} kg/s",
|
||||
),
|
||||
("Level", f"{state.secondary_loop.level*100:6.1f}%"),
|
||||
("Level", f"{state.secondary_loop.level*100:6.1f}% (Target {constants.SECONDARY_INVENTORY_TARGET*100:4.0f}%)"),
|
||||
(
|
||||
"Feedwater",
|
||||
f"valve {self.reactor.feedwater_valve*100:5.1f}% steam {state.secondary_loop.mass_flow_rate * max(0.0, state.secondary_loop.steam_quality):6.0f} kg/s",
|
||||
),
|
||||
("Inlet Temp", f"{state.secondary_loop.temperature_in:7.1f} K (Target {constants.SECONDARY_OUTLET_TARGET_K:4.0f})"),
|
||||
("Outlet Temp", f"{state.secondary_loop.temperature_out:7.1f} K (Target {constants.SECONDARY_OUTLET_TARGET_K:4.0f})"),
|
||||
("Pressure", f"{state.secondary_loop.pressure:5.2f}/{constants.MAX_PRESSURE:4.1f} MPa"),
|
||||
@@ -497,7 +501,15 @@ class ReactorDashboard:
|
||||
"Units Elec",
|
||||
" ".join([f"{t.electrical_output_mw:6.1f}MW" for t in state.turbines]) if state.turbines else "n/a",
|
||||
),
|
||||
("Throttle", f"{self.reactor.turbines[0].throttle:5.2f}" if self.reactor.turbines else "n/a"),
|
||||
(
|
||||
"Governor",
|
||||
(
|
||||
f"thr {self.reactor.turbines[0].throttle:4.2f}→{self._desired_throttle(state.turbines[0]):4.2f} "
|
||||
f"ΔP {(state.turbines[0].load_demand_mw - state.turbines[0].electrical_output_mw):6.1f} MW"
|
||||
)
|
||||
if state.turbines
|
||||
else "n/a",
|
||||
),
|
||||
(
|
||||
"Condenser",
|
||||
(
|
||||
@@ -786,6 +798,13 @@ class ReactorDashboard:
|
||||
enthalpy_kjkg = (constants.STEAM_LATENT_HEAT / 1_000.0)
|
||||
return (enthalpy_kjkg * mass_flow) / 1_000.0
|
||||
|
||||
def _desired_throttle(self, turbine_state) -> float:
|
||||
if not self.reactor.turbines:
|
||||
return 0.0
|
||||
turbine = self.reactor.turbines[0]
|
||||
demand = turbine_state.load_demand_mw
|
||||
return 0.4 if demand <= 0 else min(1.0, 0.4 + demand / max(1e-6, turbine.rated_output_mw))
|
||||
|
||||
def _update_trends(self, state: PlantState) -> None:
|
||||
self._trend_history.append((state.time_elapsed, state.core.fuel_temperature, state.core.power_output_mw))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user