🐍 Interactive Jupyter Notebook: lecture_11_specific_heats.ipynb
📥 Download Page as .ipynb (Python Notebook) 📑 Download Blank Slides (PDF)

11. Internal Energy, Enthalpy, Specific Heats of Ideal Gases, and Polytropic Processes

Term: Spring 2026
Instructor: Mukhamad Suhermanto
Primary References:


Learning Objectives:

  1. Define constant-volume and constant-pressure specific heats (\(c_v, c_p\)) from fundamental partial derivatives.
  2. Derive Mayer’s relation \(c_p - c_v = R\), the specific heat ratio \(k = c_p/c_v\), and the relations \(c_v = R/(k-1)\) and \(c_p = kR/(k-1)\) for ideal gases.
  3. Distinguish between variable specific heat integration and constant specific heat approximations for \(\Delta u\) and \(\Delta h\).
  4. Formulate the polytropic process \(P v^n = \text{const}\), deriving pressure-volume-temperature relations and boundary work integrals for \(n \ne 1\) and \(n = 1\).
  5. Analyze polytropic compression and expansion cycles using kilojoule.idealgas (COE 30, COE 51, COE 56).

11.1 Thermodynamic Definitions of Specific Heats

Specific heat is the energy required to raise the temperature of a unit mass of a substance by one degree (Moran et al. 2014), (Waitz and Spakovszky 2008). Thermodynamics defines specific heats rigorously as thermodynamic property derivatives:

\[ c_v \equiv \left( \frac{\partial u}{\partial T} \right)_v \tag{11.1} \]

\[ c_p \equiv \left( \frac{\partial h}{\partial T} \right)_P \tag{11.2} \]

Both \(c_v\) and \(c_p\) are intensive properties. In SI units they have units \(\text{kJ/(kg}\cdot\text{K)}\).

For an ideal gas, because \(u = u(T)\) and \(h = h(T)\), the partial derivatives become ordinary derivatives (Moran et al. 2014), (Wassgren 2025):

\[ c_v(T) = \frac{du}{dT} \quad \iff \quad du = c_v(T) \, dT \tag{11.3} \]

\[ c_p(T) = \frac{dh}{dT} \quad \iff \quad dh = c_p(T) \, dT \tag{11.4} \]

Key Idea: Specific Heats of Ideal Gases Depend Only on Temperature

Even if an ideal gas undergoes a process that is not constant volume, its change in internal energy is always \(du = c_v(T)dT\). Similarly, during any process, its change in enthalpy is \(dh = c_p(T)dT\). Specific heats of ideal gases depend strictly on temperature alone, not on pressure or process path.

11.2 Mayer’s Relation and the Specific Heat Ratio

Differentiating the ideal gas enthalpy definition \(h = u + RT\) with respect to temperature gives (Moran et al. 2014), (Wassgren 2025):

\[ \frac{dh}{dT} = \frac{du}{dT} + R \]

Substituting the definitions \(c_p = dh/dT\) and \(c_v = du/dT\) yields Mayer’s relation:

\[ c_p(T) - c_v(T) = R \tag{11.5} \]

We define the dimensionless specific heat ratio \(k\) (often denoted \(\gamma\) in aerospace and physics):

\[ k \equiv \frac{c_p}{c_v} \tag{11.6} \]

Since \(c_p > c_v > 0\) for all substances, \(k > 1\). Combining Eqs. (11.5) and (11.6) allows expressing \(c_v\) and \(c_p\) in terms of \(R\) and \(k\):

\[ c_v = \frac{R}{k - 1} \tag{11.7} \]

\[ c_p = \frac{k R}{k - 1} \tag{11.8} \]

For monotonic gases (e.g., Argon, Helium), \(k \approx 1.667\). For diatomic gases at room temperature (e.g., \(N_2, O_2, \text{Air}\)), \(k \approx 1.400\).

11.3 Variable vs. Constant Specific Heats

To compute finite changes between temperatures \(T_1\) and \(T_2\):

11.3.1 Variable Specific Heats (Exact)

Integrating Eqs. (11.3) and (11.4) accounts for molecular vibrational excitations at elevated temperatures:

\[ u(T_2) - u(T_1) = \int_{T_1}^{T_2} c_v(T) \, dT \tag{11.9} \]

\[ h(T_2) - h(T_1) = \int_{T_1}^{T_2} c_p(T) \, dT \tag{11.10} \]

In practice, values of \(u(T)\) and \(h(T)\) are tabulated directly in ideal gas tables (e.g., Moran Table A-22 for air) or evaluated using high-accuracy polynomial fits via kilojoule.idealgas.

11.3.2 Constant Specific Heat Approximation

When the temperature range \(\Delta T = T_2 - T_1\) is small or moderate, specific heats may be treated as constant evaluated at the average temperature \(T_{\text{avg}} = (T_1 + T_2)/2\):

\[ u_2 - u_1 \approx c_{v,\text{avg}} (T_2 - T_1) \tag{11.11} \]

\[ h_2 - h_1 \approx c_{p,\text{avg}} (T_2 - T_1) \tag{11.12} \]

11.4 Polytropic Processes of an Ideal Gas

A polytropic process is an expansion or compression governed by the pressure-volume relation (Moran et al. 2014), (Wassgren 2025):

\[ P v^n = \text{constant} = C \quad \iff \quad P_1 v_1^n = P_2 v_2^n \tag{11.13} \]

where \(n\) is the polytropic exponent (\(-\infty < n < \infty\)).

Combining Eq. (11.13) with the ideal gas law \(P = RT/v\) yields the temperature relations:

\[ \frac{T_2}{T_1} = \left( \frac{P_2}{P_1} \right)^{\frac{n-1}{n}} = \left( \frac{v_1}{v_2} \right)^{n-1} \tag{11.14} \]

11.4.1 Boundary Work Derivation

For \(n \ne 1\), the boundary work is:

\[ W_{\text{by}} = \int_1^2 P \, dV = C \int_1^2 V^{-n} \, dV = \frac{C(V_2^{1-n} - V_1^{1-n})}{1 - n} \]

Since \(C = P_1 V_1^n = P_2 V_2^n\):

\[ W_{\text{by}} = \frac{P_2 V_2 - P_1 V_1}{1 - n} = \frac{m R (T_2 - T_1)}{1 - n} \quad (n \ne 1) \tag{11.15} \]

For \(n = 1\) (\(PV = \text{const}\), isothermal process):

\[ W_{\text{by}} = \int_1^2 \frac{m R T}{V} \, dV = m R T \ln\left( \frac{V_2}{V_1} \right) = P_1 V_1 \ln\left( \frac{P_1}{P_2} \right) \quad (n = 1) \tag{11.16} \]

Exponent \(n\) Process Description \(P-v\) Characteristic
\(n = 0\) Isobaric (constant pressure) \(P = \text{const}\)
\(n = 1\) Isothermal (ideal gas) \(T = \text{const}\)
\(n = k\) Isentropic (ideal gas, reversible adiabatic) \(s = \text{const}\)
\(n \to \pm\infty\) Isochoric (constant volume) \(v = \text{const}\)

11.5 Polytropic Energy Balance and Specific Heat

Applying the First Law with constant specific heats to a polytropic process:

\[ Q_{\text{into}} = \Delta U + W_{\text{by}} = m c_v (T_2 - T_1) + \frac{m R (T_2 - T_1)}{1 - n} \]

Factoring out \(m(T_2 - T_1)\) and substituting \(R = c_v (k - 1)\):

\[ Q_{\text{into}} = m c_n (T_2 - T_1) \tag{11.17} \]

where the polytropic specific heat \(c_n\) is:

\[ c_n = c_v \left( 1 + \frac{k - 1}{1 - n} \right) = c_v \left( \frac{k - n}{1 - n} \right) \tag{11.18} \]

Notice that when \(n = k\), \(c_n = 0\), confirming that an \(n = k\) process is adiabatic (\(Q = 0\)).

import kilojoule.idealgas as idealgas
from kilojoule.units import Quantity

air = idealgas.Properties('Air')

# Initial state: 100 kPa, 300 K
P1 = Quantity(100, 'kPa')
T1 = Quantity(300, 'K')
V1 = Quantity(0.1, 'm^3')

# Polytropic compression: n = 1.3 to P2 = 600 kPa
n = 1.3
P2 = Quantity(600, 'kPa')

# T2/T1 = (P2/P1)^((n-1)/n)
T2 = T1 * (P2 / P1)**((n - 1) / n)
V2 = V1 * (P1 / P2)**(1 / n)

m = (P1 * V1 / (air.R * T1)).to('kg')

# Boundary work
W_by = ((P2 * V2 - P1 * V1) / (1 - n)).to('kJ')

# Exact heat transfer using variable specific heats via kilojoule
u1 = air.u(T=T1)
u2 = air.u(T=T2)
Delta_U = (m * (u2 - u1)).to('kJ')
Q_into = Delta_U + W_by

print(f"--- Polytropic Compression Analysis (n = {n}) ---")
print(f"Mass of Air m             : {m.magnitude:.4f} kg")
print(f"Final Temperature T2      : {T2.magnitude:.2f} K")
print(f"Final Volume V2           : {V2.to('m^3').magnitude:.5f} m^3")
print(f"Boundary Work W_by        : {W_by.magnitude:.2f} kJ")
print(f"Internal Energy Change dU : {Delta_U.magnitude:.2f} kJ")
print(f"Heat Transfer Q_into      : {Q_into.magnitude:.2f} kJ")
--- Polytropic Compression Analysis (n = 1.3) ---
Mass of Air m             : 0.1161 kg
Final Temperature T2      : 453.30 K
Final Volume V2           : 0.02525 m^3
Boundary Work W_by        : -17.17 kJ
Internal Energy Change dU : 11.23 kJ
Heat Transfer Q_into      : -5.94 kJ

11.6 Worked Example: Polytropic Compression with Heat Rejection (COE 30 / COE 51)

Example 11.1: Polytropic Air Compression with Cooling (COE 30)

Air is compressed in a piston-cylinder device from \(P_1 = 100 \text{ kPa}\), \(T_1 = 290 \text{ K}\) to \(P_2 = 800 \text{ kPa}\) following a polytropic path with \(n = 1.25\). The mass of air is \(m = 0.5 \text{ kg}\).

  1. Calculate the work done on the air during compression.
  2. Determine the net heat transfer using:
  1. Constant specific heats at \(300 \text{ K}\) (\(c_v = 0.718 \text{ kJ/(kg}\cdot\text{K)}\)).
  2. Variable specific heats evaluated via kilojoule.idealgas.
  1. Compare the error introduced by assuming constant specific heat.

Solution / Analysis

  1. Final temperature: \(T_2 = T_1 (P_2/P_1)^{(n-1)/n} = 290 \times (800/100)^{(0.25/1.25)} = 290 \times 8^{0.2} \approx 439.56 \text{ K}\).
  2. Work: \(W_{\text{by}} = \frac{m R(T_2 - T_1)}{1 - n}\).
  3. Heat transfer: \(Q = \Delta U + W_{\text{by}}\).
  • Constant specific heats: \(\Delta U = m c_v (T_2 - T_1)\).
  • Variable specific heats: \(\Delta U = m(u(T_2) - u(T_1))\). Let us solve this numerically.
from kilojoule.templates.default import *
import kilojoule.idealgas as idealgas

air = idealgas.Properties('Air', unit_system='kSI_K')
m_air = Quantity(0.5, 'kg')
P1 = Quantity(100, 'kPa')
T1 = Quantity(290, 'K')
P2 = Quantity(800, 'kPa')
n = 1.25

# Final temperature
T2 = T1 * (P2 / P1)**((n - 1) / n)

# Boundary work
W_by = (m_air * air.R * (T2 - T1) / (1 - n)).to('kJ')

# (a) Constant specific heat model (cv0 = 0.718 kJ/kg*K)
cv_const = Quantity(0.718, 'kJ/(kg*K)')
Delta_U_const = (m_air * cv_const * (T2 - T1)).to('kJ')
Q_const = Delta_U_const + W_by

# (b) Variable specific heat model
u1 = air.u(T=T1)
u2 = air.u(T=T2)
Delta_U_var = (m_air * (u2 - u1)).to('kJ')
Q_var = Delta_U_var + W_by

err_Q = float(abs(Q_const - Q_var) / abs(Q_var) * 100)

print(f"--- COE 30 Comparison of Constant vs Variable Specific Heat ---")
print(f"Final Temperature T2        : {T2.magnitude:.2f} K")
print(f"Boundary Work W_by          : {W_by.magnitude:.2f} kJ")
print(f"dU (Constant cv)            : {Delta_U_const.magnitude:.2f} kJ")
print(f"dU (Variable cv)            : {Delta_U_var.magnitude:.2f} kJ")
print(f"Heat Transfer Q (Constant)  : {Q_const.magnitude:.2f} kJ")
print(f"Heat Transfer Q (Variable)  : {Q_var.magnitude:.2f} kJ")
print(f"Percentage Error in Q       : {err_Q:.2f}%")

# Visualize compression paths on P-v diagram
p[131] = Quantity(100, 'kPa')
T[131] = Quantity(290, 'K')
states.fix(131, air)

# Isothermal compression to 800 kPa
p[132] = Quantity(800, 'kPa')
T[132] = T[131]
states.fix(132, air)

# Polytropic n=1.25 compression to 800 kPa
p[133] = Quantity(800, 'kPa')
v[133] = v[131] * (p[131]/p[133])**(1/1.25)
states.fix(133, air)

# Isentropic k=1.4 compression to 800 kPa
p[134] = Quantity(800, 'kPa')
s[134] = s[131]
states.fix(134, air)

pv11 = air.pv_diagram()
pv11.plot_state(states[131], label='1')
pv11.plot_state(states[132], label='2 (Isothermal)')
pv11.plot_state(states[133], label='2 (Polytropic n=1.25)')
pv11.plot_state(states[134], label='2 (Isentropic k=1.4)')
pv11.plot_process(states[131], states[132], path='isothermal', label='Isothermal')
pv11.plot_process(states[131], states[133], path='straight', label='n=1.25', linestyle='--')
pv11.plot_process(states[131], states[134], path='isentropic', label='Isentropic')
--- COE 30 Comparison of Constant vs Variable Specific Heat ---
Final Temperature T2        : 439.56 K
Boundary Work W_by          : -85.86 kJ
dU (Constant cv)            : 53.69 kJ
dU (Variable cv)            : 54.32 kJ
Heat Transfer Q (Constant)  : -32.17 kJ
Heat Transfer Q (Variable)  : -31.54 kJ
Percentage Error in Q       : 2.00%
Air P-v Diagram for Polytropic Compression Paths (COE 30)

Engineering Practice Problems (Self-Study Exercises)

Try each problem on paper first using the principles from this chapter, then expand the step-by-step solution to check your derivation.

Practice Problem 1 — Constant vs. Temperature-Dependent Specific Heats for Nitrogen Preheating

In a solar thermal receiver test rig, nitrogen gas (\(R = 0.2968\text{ kJ}/(\text{kg}\cdot\text{K})\)) is heated at atmospheric pressure from \(T_1 = 300\text{ K}\) (\(h_1 = 311.19\text{ kJ/kg}\)) to \(T_2 = 1100\text{ K}\) (\(h_2 = 1193.45\text{ kJ/kg}\)). Compare three methods for evaluating \(\Delta h\): (a) exact variable-specific-heat CoolProp/table difference \(h_2 - h_1\), (b) cold-air-standard constant \(c_p(300\text{ K}) = 1.0414\text{ kJ}/(\text{kg}\cdot\text{K})\), and (c) midpoint average \(c_{p,\text{avg}}(700\text{ K}) = 1.0981\text{ kJ}/(\text{kg}\cdot\text{K})\), reporting percentage error for (b) and (c).

🔍 Click to View Complete Step-by-Step Solution
  1. Exact Variable Specific Heat (CoolProp): \[\Delta h_{\text{exact}} = h_2 - h_1 = 1193.45 - 311.19 = 882.26\text{ kJ/kg}\]

  2. Room-Temperature Constant-\(c_p\) Approximation (\(300\text{ K}\)): \[\Delta h_{\text{cold}} = c_p(300\text{ K})(T_2 - T_1) = (1.0414)(1100 - 300) = 833.09\text{ kJ/kg}\] \[\text{Error} = \frac{|833.09 - 882.26|}{882.26} \times 100\% = 5.57\%\]

  3. Average Specific Heat at \(T_{\text{avg}} = 700\text{ K}\): \[\Delta h_{\text{avg}} = (1.0981)(800) = 878.46\text{ kJ/kg} \quad (\text{Error} = 0.43\%)\] Evaluating \(c_p\) at the process midpoint cuts the error by more than an order of magnitude! Final Result: \(\Delta h_{\text{exact}} = 882.26\text{ kJ/kg}\), \(\Delta h_{\text{cold}} = 833.09\text{ kJ/kg}\) (\(5.57\%\) err), \(\Delta h_{\text{avg}} = 878.46\text{ kJ/kg}\) (\(0.43\%\) err).


Practice Problem 2 — Polytropic Expansion of Air: Boundary Work and Heat Transfer Direction

Air (\(m = 1.40\text{ kg}\), \(R = 0.287\text{ kJ}/(\text{kg}\cdot\text{K})\), constant \(c_v = 0.728\text{ kJ}/(\text{kg}\cdot\text{K})\)) undergoes a quasi-equilibrium polytropic expansion (\(PV^{1.32} = \text{const}\)) in a cylinder from \(P_1 = 750\text{ kPa}\), \(T_1 = 620\text{ K}\) down to \(P_2 = 150\text{ kPa}\). Compute: (a) the final temperature \(T_2\), (b) the expansion boundary work \(W_b\), and (c) the heat transfer \(Q\), verifying why heat enters rather than leaves when \(1 < n < k\).

🔍 Click to View Complete Step-by-Step Solution
  1. Final Temperature via Polytropic Ideal-Gas Relation: \[T_2 = T_1 \left(\frac{P_2}{P_1}\right)^{\frac{n-1}{n}} = 620\left(\frac{150}{750}\right)^{\frac{0.32}{1.32}} = 419.71\text{ K}\]

  2. Polytropic Boundary Work & Internal Energy Change: \[W_b = \frac{m R (T_2 - T_1)}{1 - n} = \frac{(1.40)(0.287)(419.71 - 620)}{1 - 1.32} = +251.50\text{ kJ}\] \[\Delta U = m c_v (T_2 - T_1) = (1.40)(0.728)(419.71 - 620) = -204.14\text{ kJ}\]

  3. First Law Heat Transfer (\(Q = \Delta U + W_b\)): \[Q = -204.14 + 251.50 = +47.35\text{ kJ}\] Because \(k = 1 + R/c_v = 1.394 > n = 1.32\), the expansion falls more gently than an adiabatic (\(n=k\)) curve, requiring \(47.35\text{ kJ}\) of heat input! Final Result: \(T_2 = 419.71\text{ K}\), \(W_b = +251.50\text{ kJ}\), \(Q = +47.35\text{ kJ}\).


Practice Problem 3 — Rigid-Tank Resistance Heating of Carbon Dioxide with Jacket Heat Loss

A rigid \(V = 0.25\text{ m}^3\) vessel holds carbon dioxide (\(R = 0.1889\text{ kJ}/(\text{kg}\cdot\text{K})\), constant \(c_v = 0.657\text{ kJ}/(\text{kg}\cdot\text{K})\)) initially at \(P_1 = 200\text{ kPa}\) and \(T_1 = 300\text{ K}\). An internal heating element powered at \(110\text{ V}\) and \(12.0\text{ A}\) operates for \(2.0\text{ min}\) while the vessel loses \(22.4\text{ kJ}\) of heat to the room. Determine the \(\text{CO}_2\) mass \(m\), final temperature \(T_2\), and final pressure \(P_2\).

🔍 Click to View Complete Step-by-Step Solution
  1. Calculate Gas Mass in Tank: \[m = \frac{P_1 V}{R T_1} = \frac{(200)(0.25)}{(0.18892)(300)} = 0.8822\text{ kg}\]

  2. First Law Energy Balance (\(W_b = 0\), \(W_{\text{elec}} < 0\)): Electrical input is \(V I \Delta t = (110)(12.0)(120)/1000 = 158.4\text{ kJ}\), so: \[\Delta U = Q - W_{\text{elec}} = -22.4 - (-158.4) = +136.0\text{ kJ}\]

  3. Final Temperature & Pressure: From \(\Delta U = m c_v (T_2 - T_1)\) and constant-volume ideal-gas ratio \(P_2/P_1 = T_2/T_1\): \[T_2 = 300 + \frac{136.0}{(0.8822)(0.657)} = 534.6\text{ K}, \qquad P_2 = 200\left(\frac{534.6}{300}\right) = 356.4\text{ kPa}\] Final Result: \(m = 0.882\text{ kg}\), \(T_2 = 534.6\text{ K}\), \(P_2 = 356.4\text{ kPa}\).


Practice Problem 4 — Mayer’s Relation & Energy Partitioning During Isobaric Heating of Helium

Helium behaves as an ideal monatomic gas with specific heat ratio \(k = 5/3\) and gas constant \(R = 2.0769\text{ kJ}/(\text{kg}\cdot\text{K})\). A mass \(m = 0.35\text{ kg}\) is heated at constant pressure \(P = 300\text{ kPa}\) inside a frictionless cylinder from \(T_1 = 290\text{ K}\) to \(T_2 = 690\text{ K}\). Using Mayer’s relation (\(c_p - c_v = R\)), derive \(c_v\) and \(c_p\), compute \(\Delta U\), \(W_b\), and \(Q = \Delta H\), and determine the exact fraction of input heat \(W_b / Q\) converted directly into expansion work.

🔍 Click to View Complete Step-by-Step Solution
  1. Derive \(c_v\) and \(c_p\) from \(R\) and \(k = 5/3\): Since \(c_p - c_v = R\) and \(c_p/c_v = k\): \[c_v = \frac{R}{k - 1} = \frac{2.0769}{2/3} = 3.1153\text{ kJ}/(\text{kg}\cdot\text{K}), \qquad c_p = c_v + R = 5.1922\text{ kJ}/(\text{kg}\cdot\text{K})\]

  2. Evaluate \(\Delta U\), \(W_b\), and \(Q = \Delta H\): With \(\Delta T = 400\text{ K}\): \[\Delta U = m c_v \Delta T = (0.35)(3.1153)(400) = 436.15\text{ kJ}\] \[W_b = m R \Delta T = (0.35)(2.0769)(400) = 290.77\text{ kJ}, \qquad Q = \Delta H = m c_p \Delta T = 726.91\text{ kJ}\]

  3. Work-to-Heat Fraction: Notice \(W_b / Q = R / c_p = (k - 1)/k = 2/5 = 0.400\) (40.0%) for every monatomic ideal gas heated at constant pressure! Final Result: \(c_v = 3.115\), \(c_p = 5.192\text{ kJ}/(\text{kg}\cdot\text{K})\), \(W_b = 290.77\text{ kJ}\), \(Q = 726.91\text{ kJ}\) (\(W_b/Q = 40.0\%\)).

Summary & Key Takeaways


References, Suggested Reading & Video Lectures

Moran, Michael J., Howard N. Shapiro, Daisie D. Boettner, and Margaret B. Bailey. 2014. Fundamentals of Engineering Thermodynamics. 8th ed. Hoboken, NJ: John Wiley & Sons.
Waitz, Ian A., and Zoltan S. Spakovszky. 2008. 16.unified: Thermodynamics and Propulsion. Cambridge, MA: MIT OpenCourseWare, Massachusetts Institute of Technology.
Wassgren, Carl. 2021. Thermodynamics I (ME 200) Video Lecture Series. School of Mechanical Engineering, Purdue University. https://www.youtube.com/@cw2306/playlists.
———. 2025. Notes on Thermodynamics, Fluid Mechanics, and Gas Dynamics. West Lafayette, IN: School of Mechanical Engineering, Purdue University. https://engineering.purdue.edu/~wassgren/notes/NotesOnThermodynamicsFluidMechanicsAndGasDynamics_Wassgren.pdf.
Yan, Claire Yu. 2022. Introduction to Engineering Thermodynamics. BCcampus Open Education. https://open.umn.edu/opentextbooks/textbooks/introduction-to-engineering-thermodynamics.