Skip to content

Steam & cooling utilities

Utility-side calculations: steam heating duty and condensate, cooling-water duty and return temperature, and steam-turbine shaft work, all consistent with the reference-fluid steam tables in fugacio.thermo.

utilities

Steam and cooling-water utilities on reference-grade (IAPWS-95) water.

The economics layer prices utilities per gigajoule; this module supplies the physical side: how many kg/s of steam a reboiler actually condenses, what a cooling-water circuit's return flow is, how much shaft power a backpressure turbine extracts from a header. All of it runs on the IAPWS-95 steam tables from fugacio.thermo.helmholtz: real latent heats at the header pressure (not a constant 2257 kJ/kg), real liquid heat capacities, real isentropic enthalpy drops. It stays differentiable end to end, so a total-annual-cost objective can take exact gradients through the utility balances with respect to column duties, header pressures, or approach temperatures.

Sign conventions match fugacio.sim.units.heater: duties are signed heat added to the process (so a condenser's duty is negative); utility functions accept either sign and size on the magnitude.

Classes:

Name Description
SteamHeatingResult

Steam consumption of a heating duty.

CoolingWaterResult

Cooling-water circulation for a cooling duty.

SteamTurbineResult

Expansion of steam through a turbine with an isentropic efficiency.

Functions:

Name Description
steam_heating

Steam flow required to deliver a heating duty from a saturated header.

cooling_water

Cooling-water flow to absorb a duty over a supply/return temperature rise.

steam_turbine

Expand steam from (p_in, t_in) to p_out and extract shaft work.

saturated_steam_temperature

Saturation temperature (K) of steam at pressure (Pa) from IAPWS-95.

steam_quality_after_letdown

Vapor quality after an isenthalpic letdown from one header to another.

condensate_flash_fraction

Fraction of saturated condensate that flashes when let down in pressure.

steam_enthalpy

Molar enthalpy (J/mol) of steam/water at a header condition.

SteamHeatingResult dataclass

SteamHeatingResult(
    mass_flow: Array,
    molar_flow: Array,
    t_steam: Array,
    t_condensate: Array,
    p: Array,
    duty: Array,
    dh_specific: Array,
)

Steam consumption of a heating duty.

Attributes:

Name Type Description
mass_flow Array

Steam consumed (kg/s).

molar_flow Array

Steam consumed (mol/s).

t_steam Array

Steam supply temperature (K), saturation plus any superheat.

t_condensate Array

Condensate return temperature (K).

p Array

Header pressure (Pa).

duty Array

Heat delivered to the process (W, positive).

dh_specific Array

Specific heat released per kilogram of steam (J/kg).

CoolingWaterResult dataclass

CoolingWaterResult(
    mass_flow: Array,
    molar_flow: Array,
    t_supply: Array,
    t_return: Array,
    duty: Array,
)

Cooling-water circulation for a cooling duty.

Attributes:

Name Type Description
mass_flow Array

Circulating water (kg/s).

molar_flow Array

Circulating water (mol/s).

t_supply Array

Supply temperature (K).

t_return Array

Return temperature (K).

duty Array

Heat removed from the process (W, positive).

SteamTurbineResult dataclass

SteamTurbineResult(
    power: Array,
    mass_flow: Array,
    t_out: Array,
    q_out: Array,
    h_in: Array,
    h_out: Array,
    h_out_isentropic: Array,
    two_phase: Array,
)

Expansion of steam through a turbine with an isentropic efficiency.

Attributes:

Name Type Description
power Array

Shaft power extracted (W, positive).

mass_flow Array

Steam flow (kg/s).

t_out Array

Outlet temperature (K).

q_out Array

Outlet vapor quality (nan if the outlet is single-phase).

h_in Array

Inlet molar enthalpy (J/mol).

h_out Array

Outlet molar enthalpy (J/mol).

h_out_isentropic Array

Isentropic outlet molar enthalpy (J/mol).

two_phase Array

Whether the outlet sits inside the dome (wet steam).

steam_heating

steam_heating(
    duty: ArrayLike,
    *,
    pressure: ArrayLike = STEAM_LEVELS["lp"],
    superheat: ArrayLike = 0.0,
    condensate_subcooling: ArrayLike = 0.0,
) -> SteamHeatingResult

Steam flow required to deliver a heating duty from a saturated header.

Steam arrives at pressure with optional superheat (K above saturation) and leaves as condensate condensate_subcooling K below saturation; the released enthalpy is evaluated from IAPWS-95, so the latent heat shrinks correctly as the header pressure rises toward the critical point.

Parameters:

Name Type Description Default
duty ArrayLike

Heat to deliver to the process (W); the sign is ignored.

required
pressure ArrayLike

Steam header pressure (Pa, absolute).

STEAM_LEVELS['lp']
superheat ArrayLike

Supply superheat above saturation (K).

0.0
condensate_subcooling ArrayLike

Condensate return subcooling below saturation (K).

0.0

Returns:

Type Description
SteamHeatingResult

A SteamHeatingResult; differentiable in every argument.

cooling_water

cooling_water(
    duty: ArrayLike,
    *,
    t_supply: ArrayLike = 303.15,
    t_return: ArrayLike = 318.15,
    pressure: ArrayLike = 400000.0,
) -> CoolingWaterResult

Cooling-water flow to absorb a duty over a supply/return temperature rise.

Enthalpies of the liquid water are taken from IAPWS-95 at the circuit pressure (no constant-cp approximation, however small the difference).

Parameters:

Name Type Description Default
duty ArrayLike

Heat to remove from the process (W); the sign is ignored.

required
t_supply ArrayLike

Cooling-water supply temperature (K).

303.15
t_return ArrayLike

Cooling-water return temperature (K); must exceed supply.

318.15
pressure ArrayLike

Circuit pressure (Pa).

400000.0

Returns:

Type Description
CoolingWaterResult

A CoolingWaterResult; differentiable in every argument.

steam_turbine

steam_turbine(
    mass_flow: ArrayLike,
    *,
    p_in: ArrayLike,
    t_in: ArrayLike,
    p_out: ArrayLike,
    isentropic_efficiency: ArrayLike = 0.75,
) -> SteamTurbineResult

Expand steam from (p_in, t_in) to p_out and extract shaft work.

The ideal outlet comes from an isentropic (P, s) resolution of IAPWS-95 (wet outlets handled by the two-phase dome logic of fugacio.thermo.helmholtz.state_ps); the real outlet enthalpy is h_in - eta * (h_in - h_s). Gradients flow through both state solves, so turbine power can be differentiated with respect to throttle pressure, inlet superheat, or backpressure: the classic Rankine design knobs.

Parameters:

Name Type Description Default
mass_flow ArrayLike

Steam flow (kg/s).

required
p_in ArrayLike

Inlet pressure (Pa).

required
t_in ArrayLike

Inlet temperature (K); must be superheated vapor.

required
p_out ArrayLike

Outlet (back)pressure (Pa).

required
isentropic_efficiency ArrayLike

Fraction of the ideal enthalpy drop extracted.

0.75

Returns:

Type Description
SteamTurbineResult

A SteamTurbineResult; differentiable in every argument.

saturated_steam_temperature

saturated_steam_temperature(pressure: ArrayLike) -> Array

Saturation temperature (K) of steam at pressure (Pa) from IAPWS-95.

The driving-force side of reboiler design: pinch margins against a header's condensing temperature, differentiable in the pressure.

steam_quality_after_letdown

steam_quality_after_letdown(
    p_supply: ArrayLike,
    p_use: ArrayLike,
    *,
    superheat: ArrayLike = 0.0,
) -> Array

Vapor quality after an isenthalpic letdown from one header to another.

Saturated (or slightly superheated) steam throttled across a letdown valve flashes to the lower header pressure at constant enthalpy; the result is the outlet quality (> 1 is impossible; nan marks a superheated, single-phase outlet, matching fugacio.thermo.helmholtz.FluidState).

condensate_flash_fraction

condensate_flash_fraction(
    p_trap: ArrayLike, p_flash: ArrayLike
) -> Array

Fraction of saturated condensate that flashes when let down in pressure.

Saturated liquid at p_trap flashed isenthalpically to p_flash (a flash-steam recovery drum); returns the vapor fraction.

steam_enthalpy

steam_enthalpy(
    pressure: ArrayLike,
    *,
    quality: ArrayLike | None = None,
    temperature: ArrayLike | None = None,
) -> Array

Molar enthalpy (J/mol) of steam/water at a header condition.

Provide quality for a state on the dome or temperature for a single-phase state (exactly one of the two).