Add enthalpy-based secondary boil-off and turbine mapping

This commit is contained in:
Codex Agent
2025-11-25 17:47:37 +01:00
parent 4162ecf712
commit 0f54540526
7 changed files with 113 additions and 38 deletions

View File

@@ -266,3 +266,31 @@ def test_auto_control_resets_shutdown_and_moves_rods():
assert reactor.shutdown is False
assert reactor.control.manual_control is False
assert reactor.control.rod_fraction < 0.95
def test_full_power_reaches_steam_and_turbine_output():
"""Integration: cold start -> pumps/gens on -> ramp to ~3 GW -> steam -> turbines online."""
reactor = Reactor.default()
state = reactor.initial_state()
reactor.step(
state,
dt=1.0,
command=ReactorCommand(
generator_units={1: True, 2: True},
primary_pumps={1: True, 2: True},
secondary_pumps={1: True, 2: True},
rod_manual=False,
),
)
for i in range(600):
cmd = None
if i == 200:
cmd = ReactorCommand(secondary_pumps={2: False})
if i == 300:
cmd = ReactorCommand(secondary_pumps={2: True})
if i == 400:
cmd = ReactorCommand(turbine_on=True, turbine_units={1: True, 2: True, 3: True})
reactor.step(state, dt=1.0, command=cmd)
assert state.secondary_loop.steam_quality > 0.02
assert state.total_electrical_output() > 50.0