Tutorial - Nouman090/ThermoSim GitHub Wiki
Example problem
A geothermal Organic Rankine Cycle (ORC) system uses isobutane as the working fluid and water as the heating source. Hot water enters the evaporator at 158°C and 600 kPa, with a mass flow rate of 500 kg/s, and exits at a restricted temperature of 90°C. The working fluid, isobutane, evaporates at a pressure of 3250 kPa and condenses at 410 kPa. Cooling is provided by ambient air entering the condenser at 3°C with a mass flow rate of 8500 kg/s. You are required to model the thermodynamic performance of the cycle:
- Estimate the maximum isobutane flow rate based on heat availability,
- Turbine and pump work,
- Efficiency of the cycle

Solution:
First, we will set the known parameters
import ThermoSim
Model = ThermoSim.ThermodynamicModel()
T1 = 158+273.15 # Hot Water Inlet temperature
T2 = 90+273.15 # Hot water outlet
T3 = None
T4 = None
T5 = None
T6 = None
T7 = 3 + 273.15 # Air temperature
T8 = None
P1 = 6e5 #Hot Water Inlet Pressure
P2 = None
P3 = 3250e3 # Turbine Inlet Pressure
P4 = 410e3 # Turbine Outlet Pressure
P5 = None
P6 = None
P7 = 1.01e5 # Atmospheric Pressure
P8 = None
m_brine = 500
water = 'water'
w_fluid = 'Isobutane'
cooling_fluid = 'Air'
m_air = 8500
Now we make some assumptions and try to find other parameters.
#Assumptions
# No Pressure drop in HEX so
P2 = P1 # Eveporator: Hot side pressure of inlet and outlet is same
P5 = P4 # Eveporatore: cold side pressure of inlet and outlet is same
P6 = P3 # Condenser: Hot side pressure of inlet and outlet is same
P8 = P7 # Condenser: cold side pressure of inlet and outlet is same
# Consider 10K superheat for working fluid at evaporator outlet
T3 = Model.Prop(w_fluid, StatePointName = "demo", P = P3,Q = 1).T+10
# Consider 20K subcooling of working fluid at condenser outlet
T5 = Model.Prop(w_fluid,StatePointName="xxx",P = P5,Q = 0).T - 20
# Consider Pump and Turbines Isentropic efficiency
n_expn = .75
n_pump = 0.75
PPT = 5
Now we add the state points to our model.
Model.add_point(water, StatePointName = '1',P = P1, T = T1,Mass_flowrate=m_brine)
Model.add_point(water, StatePointName = '2',P = P2, T = T2)
Model.add_point(w_fluid, StatePointName = '3',P = P3, T = T3)
Model.add_point(w_fluid, StatePointName = '4',P = P4, T = T4)
Model.add_point(w_fluid, StatePointName = '5',P = P5, T = T5)
Model.add_point(w_fluid, StatePointName = '6',P = P6, T = T6)
Model.add_point(cooling_fluid, StatePointName = '7',P = P7, T = T7,Mass_flowrate=m_air)
Model.add_point(cooling_fluid, StatePointName = '8',P = P8, T = T8)
Model.Point_print()
Massflowrate of the working fluid is unknown so mass flowrate at state point 5 and 6 is set to 1 kg/s. It will show a warnig massage. As soon as we calculate the mass flowrate of the working fluid, we will recalculate the pump.
Pump = Model.Pump(Model, 'Pump', In_state = '5', Out_state = '6',n_isen=n_pump,Calculate=True)
Now solve the evaporator. Here, only missing paramtere is working fluids mass flow rate.
Evaporator = Model.HeatExchanger(Model, 'Evaporator', PPT = PPT, HEX_type = 'Evaporator', Hot_In_state = '1', Hot_Out_state = '2', Cold_In_state = '6', Cold_Out_state = '3',Calculate=True,PPT_graph=True)
As we know the mass flow rate of the working fluid, we recalculate the pump for accurate power of the pump.
Pump.Cal()
Now we solve the turbine and the condenser.
Turbine = Model.Turbine(Model, 'Turbine', In_state = '3', Out_state = '4',n_isen=n_expn,Calculate=True)
Condenser = Model.HeatExchanger(Model, 'Condenser', PPT = PPT, HEX_type = 'Condenser', Hot_In_state = '4', Hot_Out_state = '5', Cold_In_state = '7', Cold_Out_state = '8',Calculate=True,PPT_graph=True)
Model.Point_print()
You can print all the component and state point by using the following command.
print(Model)
Now we can calculate and print the required parameters
working_fluid_massflowrate = Evaporator.Cold_Mass_flowrate
Turbine_work = Turbine.work
Pump_work = Pump.work
Q_in = Evaporator.Q
ORC_efficiency = (Turbine_work-Pump_work)/Q_in*100
print(f"Working Fluid's Mass Flowrate: {working_fluid_massflowrate} kg/s")
print(f"Turbine Power: {Turbine_work} W\n"
f"Pump Power: {Pump_work} W")
print(f"Cycle Efficiency: {ORC_efficiency} %")
Tips
- You can add this
Model.Point_print()after every component to fidn which state point is solved.