55 lines
1.8 KiB
Python
55 lines
1.8 KiB
Python
"""Steam generator and turbine performance models."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
import logging
|
|
|
|
from . import constants
|
|
from .state import CoolantLoopState, TurbineState
|
|
|
|
LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
@dataclass
|
|
class SteamGenerator:
|
|
drum_volume_m3: float = 200.0
|
|
|
|
def steam_enthalpy(self, loop: CoolantLoopState) -> float:
|
|
base = 2_700.0 # kJ/kg saturated steam
|
|
quality_adjustment = 500.0 * loop.steam_quality
|
|
return base + quality_adjustment
|
|
|
|
|
|
@dataclass
|
|
class Turbine:
|
|
generator_efficiency: float = constants.GENERATOR_EFFICIENCY
|
|
mechanical_efficiency: float = constants.STEAM_TURBINE_EFFICIENCY
|
|
rated_output_mw: float = 400.0 # cap per unit electrical output
|
|
|
|
def step(
|
|
self,
|
|
loop: CoolantLoopState,
|
|
state: TurbineState,
|
|
steam_power_mw: float = 0.0,
|
|
) -> None:
|
|
enthalpy = 2_700.0 + loop.steam_quality * 600.0
|
|
mass_flow = loop.mass_flow_rate * 0.6
|
|
available_power = max(steam_power_mw, (enthalpy * mass_flow / 1_000.0) / 1_000.0)
|
|
shaft_power_mw = available_power * self.mechanical_efficiency
|
|
electrical = shaft_power_mw * self.generator_efficiency
|
|
if electrical > self.rated_output_mw:
|
|
electrical = self.rated_output_mw
|
|
shaft_power_mw = electrical / max(1e-6, self.generator_efficiency)
|
|
condenser_temp = max(305.0, loop.temperature_in - 20.0)
|
|
state.steam_enthalpy = enthalpy
|
|
state.shaft_power_mw = shaft_power_mw
|
|
state.electrical_output_mw = electrical
|
|
state.condenser_temperature = condenser_temp
|
|
LOGGER.debug(
|
|
"Turbine output: shaft=%.1fMW electrical=%.1fMW condenser=%.1fK",
|
|
shaft_power_mw,
|
|
electrical,
|
|
condenser_temp,
|
|
)
|