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

@@ -30,8 +30,9 @@ def test_secondary_heats_to_saturation_before_boiling():
def test_secondary_generates_steam_when_energy_exceeds_sensible_heat():
solver = ThermalSolver()
loop = _secondary_loop(temp_in=330.0, flow=180.0, pressure=0.5)
loop.inventory_kg *= 0.1 # reduce mass to let boil-up happen quickly
sat_temp = saturation_temperature(loop.pressure)
solver.step_secondary(loop, transferred_mw=120.0, dt=1.0)
assert loop.temperature_out == pytest.approx(sat_temp, rel=0.02)
solver.step_secondary(loop, transferred_mw=120.0, dt=100.0)
assert loop.temperature_out == pytest.approx(sat_temp, rel=0.05)
assert loop.steam_quality > 0.0
assert loop.steam_quality < 1.0