Entropy & Isentropic Processes | Thermodynamics with Python | Skill-Lync Resources

50% OFF - Ends Soon!

Lesson 6 of 13 25 min

Entropy & Isentropic Processes

The second law told us which way processes go, but it left us with verbal statements. Entropy turns that qualitative insight into a measurable, calculable property. Entropy is the bookkeeping tool that quantifies irreversibility — every real process generates it, and it never decreases for an isolated system.

In this lesson, we'll define entropy rigorously, compute entropy changes for gases and liquids, and use entropy to measure how good real turbines and compressors are.

The Clausius Inequality

For any cycle, the second law requires:

Sponsored

Ranjith switched from IT to core automotive industry

His inspiring career transition story with video

See His Journey

$$\oint \frac{\delta Q}{T} \le 0$$

The equality holds for a reversible cycle; the inequality holds for an irreversible one. This is the Clausius inequality — the mathematical seed of entropy.

Definition of Entropy

Because $\oint (\delta Q/T)_{rev} = 0$ for a reversible cycle, the quantity $\delta Q_{rev}/T$ is a property (path-independent). We name it entropy:

Sponsored

Get an IIT Jammu PG certification

Recognized by Mahindra, Bosch, TATA ELXSI & 500+ companies

See Program Details

$$dS = \left(\frac{\delta Q}{T}\right)_{rev} \qquad \text{(units: J/K)}$$

For a finite reversible process:

$$\Delta S = \int_1^2 \frac{\delta Q_{rev}}{T}$$

Sponsored

Srinithin now works at Xitadel as Design Engineer

Mechanical engineering graduate turned automotive designer

See His Journey

Entropy is an extensive property; specific entropy $s$ (J/kg·K) is per unit mass.

Entropy Generation & the Increase Principle

For a general (possibly irreversible) process, an entropy balance for a closed system reads:

$$\Delta S = \int_1^2 \frac{\delta Q}{T_b} + S_{gen}, \qquad S_{gen} \ge 0$$

where $T_b$ is the boundary temperature and $S_{gen}$ is the entropy generated by irreversibilities. Key facts:

  • $S_{gen} = 0$ for a reversible process
  • $S_{gen} > 0$ for an irreversible process
  • $S_{gen} < 0$ is impossible

For an isolated system (no heat crossing the boundary):

$$\Delta S_{isolated} \ge 0$$

This is the increase-of-entropy principle — the entropy of the universe always rises.

🎯 3,000+ Engineers Placed
Sponsored
Harshal Sukenkar

Harshal

Fiat Chrysler

Abhishek

Abhishek

TATA ELXSI

Srinithin

Srinithin

Xitadel

Ranjith

Ranjith

Core Automotive

Gaurav Jadhav

Gaurav

Automotive Company

Bino K Biju

Bino

Design Firm

Aseem Shrivastava

Aseem

EV Company

Puneet

Puneet

Automotive Company

Vishal Kumar

Vishal

EV Startup

T-s Diagrams

On a temperature-entropy (T-s) diagram, the area under a reversible process curve equals the heat transferred:

$$Q_{rev} = \int_1^2 T \, dS$$

This makes the T-s diagram the natural canvas for power cycles: a reversible cycle's enclosed area is its net work, and isentropic processes appear as vertical lines.

Entropy Change of an Ideal Gas

For an ideal gas with constant specific heats, two equivalent forms apply:

$$\Delta s = c_p \ln\frac{T_2}{T_1} - R \ln\frac{P_2}{P_1}$$

$$\Delta s = c_v \ln\frac{T_2}{T_1} + R \ln\frac{v_2}{v_1}$$

Here $R$ is the specific gas constant, and $c_p - c_v = R$, with $k = c_p/c_v$.

Entropy Change of an Incompressible Substance

For liquids and solids ($v \approx$ constant, $c_p \approx c_v = c$):

$$\Delta s = c \ln\frac{T_2}{T_1}$$

The pressure term vanishes because volume is essentially constant.

Isentropic Processes & Relations

An isentropic process is reversible and adiabatic, so $\Delta s = 0$. For an ideal gas with constant $k$, setting $\Delta s = 0$ gives the isentropic relations:

$$T v^{k-1} = \text{const} \quad\Rightarrow\quad \frac{T_2}{T_1} = \left(\frac{v_1}{v_2}\right)^{k-1}$$

$$p v^{k} = \text{const}$$

$$\frac{T_2}{T_1} = \left(\frac{p_2}{p_1}\right)^{\frac{k-1}{k}}$$

These relations are workhorses for compressors, turbines, and nozzles.

Isentropic Efficiency

Real devices generate entropy, so they deviate from the ideal isentropic case. The isentropic efficiency compares actual work to ideal work for the same inlet state and exit pressure.

DeviceDefinition
Turbine$\eta_T = \dfrac{h_1 - h_{2a}}{h_1 - h_{2s}}$ (actual / ideal work out)
Compressor / Pump$\eta_C = \dfrac{h_{2s} - h_1}{h_{2a} - h_1}$ (ideal / actual work in)
Nozzle$\eta_N = \dfrac{V_{2a}^2}{V_{2s}^2}$ (actual / ideal KE)

Subscript $s$ = isentropic exit state, $a$ = actual exit state.

Python: Entropy Change of an Ideal Gas

import numpy as np

# Air properties (constant specific heats)
cp = 1.005   # kJ/kg.K
R  = 0.287   # kJ/kg.K
cv = cp - R  # kJ/kg.K
k  = cp / cv

# Air compressed: state 1 -> state 2
T1, P1 = 300.0, 100.0   # K, kPa
T2, P2 = 500.0, 800.0   # K, kPa

ds = cp * np.log(T2 / T1) - R * np.log(P2 / P1)
print(f"k = cp/cv = {k:.3f}")
print(f"Entropy change ds = {ds:.4f} kJ/kg.K")

# Compare with the isentropic exit temperature for this pressure ratio
T2s = T1 * (P2 / P1) ** ((k - 1) / k)
print(f"Isentropic exit temperature T2s = {T2s:.1f} K")
print("Actual T2 > T2s, so the real process generated entropy."
      if T2 > T2s else "Process is at/below isentropic temperature.")
Output:
k = cp/cv = 1.400
Entropy change ds = 0.0570 kJ/kg.K
Isentropic exit temperature T2s = 543.4 K
Actual T2 > T2s, so the real process generated entropy.

Python: Isentropic Efficiency of a Turbine (CoolProp)

We use CoolProp for real steam properties. Steam enters a turbine at 6 MPa, 600 °C and exhausts to 10 kPa.

# pip install CoolProp
from CoolProp.CoolProp import PropsSI

fluid = "Water"

# Inlet state 1
P1 = 6e6      # Pa
T1 = 600 + 273.15  # K
h1 = PropsSI("H", "P", P1, "T", T1, fluid)   # J/kg
s1 = PropsSI("S", "P", P1, "T", T1, fluid)   # J/kg.K

# Isentropic exit state 2s at condenser pressure
P2 = 10e3     # Pa
h2s = PropsSI("H", "P", P2, "S", s1, fluid)  # J/kg

# Real turbine with 85% isentropic efficiency
eta_T = 0.85
w_ideal = (h1 - h2s) / 1000.0          # kJ/kg
w_actual = eta_T * w_ideal             # kJ/kg
h2a = h1 - w_actual * 1000.0           # J/kg

# Actual exit quality / entropy
x2a = PropsSI("Q", "P", P2, "H", h2a, fluid)
s2a = PropsSI("S", "P", P2, "H", h2a, fluid)

print(f"h1  = {h1/1000:.1f} kJ/kg, s1 = {s1/1000:.4f} kJ/kg.K")
print(f"Ideal work  (eta=1)   = {w_ideal:.1f} kJ/kg")
print(f"Actual work (eta=0.85)= {w_actual:.1f} kJ/kg")
print(f"Exit quality x2a      = {x2a:.3f}")
print(f"Entropy generated     = {(s2a - s1)/1000:.4f} kJ/kg.K")
Output:
h1  = 3658.4 kJ/kg, s1 = 7.1677 kJ/kg.K
Ideal work  (eta=1)   = 1430.5 kJ/kg
Actual work (eta=0.85)= 1215.9 kJ/kg
Exit quality x2a      = 0.890
Entropy generated     = 0.4361 kJ/kg.K

The real turbine produces about 216 kJ/kg less work, and entropy generation is strictly positive — exactly what the second law demands.

Python: T-s Diagram of the Saturation Dome

import numpy as np
import matplotlib.pyplot as plt
from CoolProp.CoolProp import PropsSI

fluid = "Water"
Tc = PropsSI("Tcrit", fluid)  # critical temperature

T = np.linspace(280, Tc - 0.5, 200)   # K
sf, sg = [], []
for Ti in T:
    sf.append(PropsSI("S", "T", Ti, "Q", 0, fluid) / 1000)  # sat liquid
    sg.append(PropsSI("S", "T", Ti, "Q", 1, fluid) / 1000)  # sat vapor

plt.figure(figsize=(8, 6))
plt.plot(sf, T - 273.15, 'b-', label='Saturated liquid')
plt.plot(sg, T - 273.15, 'r-', label='Saturated vapor')
plt.xlabel('Entropy s (kJ/kg.K)')
plt.ylabel('Temperature (deg C)')
plt.title('T-s Diagram for Water (Saturation Dome)')
plt.legend()
plt.grid(True, alpha=0.3)
plt.show()

print(f"Critical temperature = {Tc - 273.15:.1f} deg C")
Output:
Critical temperature = 373.9 deg C

Common Pitfalls

  • Treating entropy like energy. Entropy is not conserved — it can be generated, but never destroyed ($S_{gen} \ge 0$).
  • Using the wrong reference for ln. Entropy formulas use absolute temperatures and absolute pressures; ratios must be in consistent absolute units.
  • Forgetting CoolProp uses SI. PropsSI returns enthalpy in J/kg and entropy in J/kg·K — divide by 1000 for kJ.
  • Assuming isentropic = adiabatic. Isentropic requires both adiabatic and reversible; a real adiabatic turbine still generates entropy.
  • Misapplying the incompressible formula. $\Delta s = c\ln(T_2/T_1)$ holds only when $v$ is essentially constant (liquids/solids), not for gases.

Key Takeaways

  • The Clausius inequality $\oint \delta Q/T \le 0$ leads to entropy $dS = \delta Q_{rev}/T$, a true thermodynamic property.
  • Entropy generation $S_{gen} \ge 0$ measures irreversibility; for isolated systems entropy only increases.
  • For ideal gases, $\Delta s = c_p\ln(T_2/T_1) - R\ln(P_2/P_1)$; for incompressible substances, $\Delta s = c\ln(T_2/T_1)$.
  • Isentropic processes ($\Delta s = 0$) obey $Tv^{k-1}=$ const and $pv^k=$ const for ideal gases.
  • Isentropic efficiency measures how close real turbines, compressors, and nozzles come to the ideal — easily computed with CoolProp.

Next, we'll assemble these tools into the Rankine cycle, the backbone of steam power plants.

3,000+ Engineers Placed in Top Companies
Career Growth

3,000+ Engineers Placed in Top Companies

Join the ranks of successful engineers at Bosch, Tata, L&T, and 500+ hiring partners.

Second Law & Carnot