Prevent turbine output without steam

This commit is contained in:
Codex Agent
2025-11-22 23:40:45 +01:00
parent 627e93a381
commit 64eed8a539
2 changed files with 32 additions and 0 deletions

View File

@@ -31,3 +31,25 @@ def test_turbine_spools_toward_target_output():
turbine.step(loop, state, steam_power_mw=300.0, dt=dt)
assert state.electrical_output_mw == pytest.approx(target_electric, rel=0.05)
def test_turbine_produces_no_power_without_steam():
turbine = Turbine()
loop = CoolantLoopState(
temperature_in=295.0,
temperature_out=295.0,
pressure=6.0,
mass_flow_rate=20_000.0,
steam_quality=0.0,
)
state = TurbineState(
steam_enthalpy=0.0,
shaft_power_mw=0.0,
electrical_output_mw=0.0,
condenser_temperature=300.0,
)
turbine.step(loop, state, steam_power_mw=0.0, dt=1.0)
assert state.electrical_output_mw == 0.0
assert state.shaft_power_mw == 0.0