Example Combined Cycle - Nouman090/ThermoSim GitHub Wiki

Description

The exhaust gas from a Brayton (gas turbine) cycle provides heat to a bottoming Rankine (steam) cycle.

Complete Code

from ThermoSim import (
    ThermodynamicModel, Compressor, Turbine, Pump, HeatExchanger,
)
from ThermoSim.plotting import CyclePlotter

Model = ThermodynamicModel()
Model.set_dead_state()

# ═══════════════════════════════════════════
#  TOPPING CYCLE: Brayton (Air)
# ═══════════════════════════════════════════
m_air = 1.0

Model.add_point('Air', 'B1', P=1e5, T=300, Mass_flowrate=m_air)
Model.add_point('Air', 'B2', P=10e5)
Model.add_point('Air', 'B3', P=10e5, T=1500)
Model.add_point('Air', 'B4', P=1e5)

Compressor(Model, 'Gas_Compressor', 'B1', 'B2',
           n_isen=0.85)

HeatExchanger(Model, 'Combustor', PPT=5, HEX_type='SimpleHEX',
              HeatAdded=True,
              Hot_In_state=None, Hot_Out_state=None,
              Cold_In_state='B2', Cold_Out_state='B3')

Turbine(Model, 'Gas_Turbine', 'B3', 'B4',
        n_isen=0.90)

# ═══════════════════════════════════════════
#  BOTTOMING CYCLE: Rankine (Water)
# ═══════════════════════════════════════════
m_steam = 0.15

Model.add_point('water', 'R1', P=50e5, T=500+273.15, Mass_flowrate=m_steam)
Model.add_point('water', 'R2', P=0.1e5)
Model.add_point('water', 'R3', P=0.1e5, Q=0)
Model.add_point('water', 'R4', P=50e5)

# HRSG: gas exhaust (B4) heats water (R4 → R1)
Model.add_point('Air', 'B5', P=1e5, Mass_flowrate=m_air)   # stack gas

HeatExchanger(Model, 'HRSG', PPT=15, HEX_type='double_pipe',
              HeatAdded=None,
              Hot_In_state='B4', Hot_Out_state='B5',
              Cold_In_state='R4', Cold_Out_state='R1',PPT_graph=True)

Turbine(Model, 'Steam_Turbine', 'R1', 'R2',
        n_isen=0.85)

HeatExchanger(Model, 'Condenser', PPT=5, HEX_type='SimpleHEX',
              HeatAdded=False,
              Hot_In_state='R2', Hot_Out_state='R3',
              Cold_In_state=None, Cold_Out_state=None)

Pump(Model, 'Feed_Pump', 'R3', 'R4',
     n_isen=0.85, Calculate=True)

# ═══════════════════════════════════════════
#  RESULTS
# ═══════════════════════════════════════════
Model.Solve(verbose=1, max_iter=20)
print(Model)

plotter = CyclePlotter(Model)
plotter.plot_exergy_bar(as_percentage=True)
plotter.plot_energy_summary()