Note
Go to the end to download the full example code.
Rankine cycle#
Calculate the efficiency of a Rankine vapor power cycle using a pure fluid model for water.
Requires: Cantera >= 2.5.0
import cantera as ct
Parameters#
eta_pump = 0.6 # pump isentropic efficiency
eta_turbine = 0.8 # turbine isentropic efficiency
p_max = 8.0e5 # maximum pressure
Helper Functions#
def pump(fluid, p_final, eta):
"""Adiabatically pump a fluid to pressure p_final, using
a pump with isentropic efficiency eta."""
h0 = fluid.h
s0 = fluid.s
fluid.SP = s0, p_final
h1s = fluid.h
isentropic_work = h1s - h0
actual_work = isentropic_work / eta
h1 = h0 + actual_work
fluid.HP = h1, p_final
return actual_work
def expand(fluid, p_final, eta):
"""Adiabatically expand a fluid to pressure p_final, using
a turbine with isentropic efficiency eta."""
h0 = fluid.h
s0 = fluid.s
fluid.SP =s0, p_final
h1s = fluid.h
isentropic_work = h0 - h1s
actual_work = isentropic_work * eta
h1 = h0 - actual_work
fluid.HP = h1, p_final
return actual_work
def printState(n, fluid):
print('\n***************** State {0} ******************'.format(n))
print(fluid.report())
Evaluate Rankine Cycle#
# Create an object representing water:
w = ct.Water()
Start with saturated liquid water at 300 K:
***************** State 1 ******************
water:
temperature 300 K
pressure 3528.2 Pa
density 996.59 kg/m^3
mean mol. weight 18.016 kg/kmol
vapor fraction 0
phase of matter liquid-gas-mix
1 kg 1 kmol
--------------- ---------------
enthalpy -1.5858e+07 -2.857e+08 J
internal energy -1.5858e+07 -2.857e+08 J
entropy 3913.2 70500 J/K
Gibbs function -1.7032e+07 -3.0685e+08 J
heat capacity c_p 4181.3 75330 J/K
heat capacity c_v 4131 74425 J/K
Pump it adiabatically to p_max
:
***************** State 2 ******************
water:
temperature 300.14 K
pressure 8e+05 Pa
density 996.91 kg/m^3
mean mol. weight 18.016 kg/kmol
vapor fraction 0
phase of matter liquid
1 kg 1 kmol
--------------- ---------------
enthalpy -1.5857e+07 -2.8568e+08 J
internal energy -1.5858e+07 -2.8569e+08 J
entropy 3915 70532 J/K
Gibbs function -1.7032e+07 -3.0685e+08 J
heat capacity c_p 4178.6 75282 J/K
heat capacity c_v 4127.9 74368 J/K
Heat it at constant pressure until it reaches the saturated vapor state at this pressure:
***************** State 3 ******************
water:
temperature 443.62 K
pressure 8e+05 Pa
density 4.1587 kg/m^3
mean mol. weight 18.016 kg/kmol
vapor fraction 1
phase of matter liquid-gas-mix
1 kg 1 kmol
--------------- ---------------
enthalpy -1.3202e+07 -2.3784e+08 J
internal energy -1.3394e+07 -2.4131e+08 J
entropy 10183 1.8346e+05 J/K
Gibbs function -1.7719e+07 -3.1922e+08 J
heat capacity c_p 2464.4 44399 J/K
heat capacity c_v 1764.5 31790 J/K
expand back to p1
:
turbine_work = expand(w, p1, eta_turbine)
printState(4, w)
***************** State 4 ******************
water:
temperature 300 K
pressure 3528.2 Pa
density 0.030558 kg/m^3
mean mol. weight 18.016 kg/kmol
vapor fraction 0.83516
phase of matter liquid-gas-mix
1 kg 1 kmol
--------------- ---------------
enthalpy -1.3822e+07 -2.4902e+08 J
internal energy -1.3938e+07 -2.511e+08 J
entropy 10700 1.9277e+05 J/K
Gibbs function -1.7032e+07 -3.0685e+08 J
heat capacity c_p inf inf J/K
heat capacity c_v nan nan J/K
Calculate the efficiency:
eff = (turbine_work - pump_work)/heat_added
print('efficiency = ', eff)
efficiency = 0.23320858648784495
Total running time of the script: (0 minutes 0.017 seconds)