Handle heat-sink loss and update turbine controls
This commit is contained in:
@@ -37,7 +37,7 @@ def test_health_monitor_flags_core_failure():
|
||||
reactor = Reactor.default()
|
||||
state = reactor.initial_state()
|
||||
state.core.fuel_temperature = constants.MAX_CORE_TEMPERATURE
|
||||
failures = reactor.health_monitor.evaluate(state, True, True, [True, True, True], dt=200.0)
|
||||
failures = reactor.health_monitor.evaluate(state, True, True, [True, True], dt=200.0)
|
||||
assert "core" in failures
|
||||
reactor._handle_failure("core")
|
||||
assert reactor.shutdown is True
|
||||
@@ -52,3 +52,16 @@ def test_maintenance_recovers_component_health():
|
||||
assert restored is True
|
||||
assert pump.integrity == pytest.approx(0.8)
|
||||
assert pump.failed is False
|
||||
|
||||
|
||||
def test_secondary_pump_loss_triggers_scram_and_no_steam():
|
||||
reactor = Reactor.default()
|
||||
state = reactor.initial_state()
|
||||
# Make sure some power is present to trigger heat-sink logic.
|
||||
state.core.power_output_mw = 500.0
|
||||
reactor.secondary_pump_active = False
|
||||
reactor.control.manual_control = True
|
||||
reactor.control.rod_fraction = 0.1
|
||||
reactor.step(state, dt=1.0)
|
||||
assert reactor.shutdown is True
|
||||
assert all(t.electrical_output_mw == 0.0 for t in state.turbines)
|
||||
|
||||
Reference in New Issue
Block a user