🐍 Interactive Jupyter Notebook: lecture_18_unsteady_1.ipynb
πŸ“₯ Download Page as .ipynb (Python Notebook) πŸ“‘ Download Blank Slides (PDF)

18. Unsteady Control Volume Analysis (Part 1: Tank Charging) and Closed Cycle Energy Analysis

Term: Spring 2026
Instructor: Mukhamad Suhermanto
Primary References:


Learning Objectives:

  1. Formulate the general unsteady (transient) mass and energy rate balances for open control volumes.
  2. Apply the Uniform-State Uniform-Flow (USUF) model to integrate transient conservation equations over time.
  3. Prove that adiabatic charging of an evacuated vessel with an ideal gas yields \(u_2 = h_{\text{in}}\) and \(T_2 = k T_{\text{in}}\) via flow work.
  4. Analyze closed thermodynamic cycles using \(\oint \delta Q = \oint \delta W\) and compute cycle thermal efficiency and work output.

18.1 Unsteady Control Volume Analysis & The USUF Model

Many engineering applications operate under inherently unsteady (transient) conditions: charging gas cylinders, filling vehicle fuel tanks, blowing down pressurized steam accumulators, opening relief valves, and transient start-up or shut-down of engines (Moran et al. 2014), (Wassgren 2025).

Unsteady Tank Filling Figure 18.1: Unsteady control volume schematic for transient tank charging (USUF analysis) showing the inflow stream, control surface, and rising internal energy.

18.1.1 General Transient Rate Balances

For an open control volume, the instantaneous rate of change of mass and energy within the boundary are (Waitz and Spakovszky 2008), (Yan 2022):

\[ \frac{dm_{\text{cv}}}{dt} = \sum_i \dot{m}_i - \sum_e \dot{m}_e \tag{18.1} \]

\[ \frac{dE_{\text{cv}}}{dt} = \dot{Q}_{\text{cv}} - \dot{W}_{\text{cv}} + \sum_i \dot{m}_i \left(h_i + \frac{V_i^2}{2} + g z_i\right) - \sum_e \dot{m}_e \left(h_e + \frac{V_e^2}{2} + g z_e\right) \tag{18.2} \]

18.1.2 The Uniform-State Uniform-Flow (USUF) Idealization

To integrate these rate equations analytically over a finite time interval \(\Delta t = t_2 - t_1\), we invoke the Uniform-State, Uniform-Flow (USUF) idealization:

  1. Uniform State: At any instant in time, intensive thermodynamic properties (\(u, h, T, P, v\)) are spatially uniform throughout the control volume. State \(1\) represents the initial uniform state, and State \(2\) represents the final uniform state.
  2. Uniform Flow: The thermodynamic state and velocity of fluid crossing any inlet or exit boundary are constant over the entire cross-sectional area and invariant throughout the duration of the process.

Integrating Eq. (18.1) over time yields the mass balance:

\[ m_2 - m_1 = \sum_i m_i - \sum_e m_e \tag{18.3} \]

Neglecting kinetic and potential energy changes of the bulk fluid, \(E_{\text{cv}} \approx U_{\text{cv}} = m u\). Integrating Eq. (18.2) gives the USUF Energy Balance:

\[ m_2 u_2 - m_1 u_1 = Q_{\text{cv}} - W_{\text{cv}} + \sum_i m_i h_i - \sum_e m_e h_e \tag{18.4} \]

Caution: Internal Energy vs.Β Enthalpy

In Eq. (18.4), internal energy (\(u\)) describes the fluid stored inside the control volume (\(m_2 u_2 - m_1 u_1\)), whereas enthalpy (\(h = u + Pv\)) describes the energy carried across the boundary by the flowing mass (\(m_i h_i\) and \(m_e h_e\)). The \(Pv\) term represents the flow work done by or on the fluid crossing the control surface!

18.2 Adiabatic Tank Charging (Filling an Evacuated Vessel)

A classic transient problem is the rapid filling of a rigid, insulated tank from a high-pressure supply line maintained at constant temperature \(T_{\text{in}}\) and pressure \(P_{\text{in}}\) (Moran et al. 2014), (Wassgren 2025).

18.2.1 Derivation of the Final Internal Energy

Consider an initially evacuated vessel (\(m_1 = 0\)):

Substituting into the USUF energy balance (Eq. 18.4):

\[ m_2 u_2 - 0 = 0 - 0 + m_i h_{\text{in}} - 0 \tag{18.5} \]

Since \(m_2 = m_i\), dividing by \(m_2\) yields the fundamental result:

\[ u_2 = h_{\text{in}} \tag{18.6} \]

18.2.2 Final Temperature for an Ideal Gas with Constant Specific Heats

For an ideal gas where \(u(T) = c_v T\) and \(h(T) = c_p T\) (with reference temperature taken as absolute zero):

\[ c_v T_2 = c_p T_{\text{in}} \tag{18.7} \]

Solving for the final temperature inside the vessel:

\[ T_2 = \frac{c_p}{c_v} T_{\text{in}} = k T_{\text{in}} \tag{18.8} \]

Key Idea: Flow Work Heating Mechanism

Why does the gas temperature inside an insulated tank spike significantly during charging even though no heat is added? Upstream in the supply line, fluid behind each entering packet of gas acts like a virtual piston, performing flow work \(W_{\text{flow}} = P_{\text{in}} v_{\text{in}}\) to force the gas into the chamber. This flow work is converted directly into internal thermal energy inside the rigid vessel, raising \(T_2\) to \(k T_{\text{in}}\). For air (\(k = 1.4\)) at \(T_{\text{in}} = 300\text{ K}\) (\(27^\circ\text{C}\)), the final temperature is \(T_2 = 1.4 \times 300\text{ K} = 420\text{ K} = 147^\circ\text{C}\)!

# Transient Tank Charging Analysis using kilojoule
import kilojoule.idealgas as idealgas
from kilojoule.units import Quantity

air = idealgas.Properties('Air')

# Supply line conditions
T_in = Quantity(300.0, 'K')     # 27 Β°C
P_in = Quantity(1.0, 'MPa')      # 10 bar supply line

# Tank geometry
V_tank = Quantity(0.5, 'm^3')   # 500 liter rigid vessel

# 1. Theoretical result for constant k = 1.4
k_approx = 1.40
T2_approx = k_approx * T_in

# 2. Exact evaluation using variable specific heats in kilojoule
# Upstream enthalpy
h_in = air.h(T=T_in)

# Final state: u2 = h_in
T2_exact = air.T(u=h_in)
u2 = air.u(T=T2_exact)

# Final mass in tank when pressure reaches supply pressure P2 = P_in
P2 = P_in
R_air = air.R
m2 = (P2 * V_tank) / (R_air * T2_exact)

print(f"Supply Temperature:     T_in     = {T_in.to('K'):.1f} ({T_in.to('degC'):.1f})")
print(f"Supply Enthalpy:        h_in     = {h_in.to('kJ/kg'):.2f}")
print(f"Constant k Prediction:  T2       = {T2_approx.to('K'):.1f} ({T2_approx.to('degC'):.1f})")
print(f"Exact Variable cp/cv:   T2_exact = {T2_exact.to('K'):.1f} ({T2_exact.to('degC'):.1f})")
print(f"Final Internal Energy:  u2       = {u2.to('kJ/kg'):.2f}")
print(f"Final Mass Charged:     m2       = {m2.to('kg'):.3f} kg")
Supply Temperature:     T_in     = 300.0 K (26.9 Β°C)
Supply Enthalpy:        h_in     = 300.47 kJ/kg
Constant k Prediction:  T2       = 420.0 K (146.9 Β°C)
Exact Variable cp/cv:   T2_exact = 417.8 K (144.7 Β°C)
Final Internal Energy:  u2       = 300.47 kJ/kg
Final Mass Charged:     m2       = 4.167 kg

18.3 Closed Thermodynamic Cycles Energy Analysis

A thermodynamic cycle is a sequence of processes that begins and ends at the exact same thermodynamic state (Moran et al. 2014), (Wassgren 2025).

18.3.1 Cyclic Energy Conservation

Because state properties are point functions, the net change in any property over an entire cycle is identically zero:

\[ \Delta U_{\text{cycle}} = 0, \quad \Delta H_{\text{cycle}} = 0, \quad \Delta S_{\text{cycle}} = 0 \tag{18.9} \]

Applying the First Law of Thermodynamics to a closed system over a complete cycle:

\[ \Delta E_{\text{cycle}} = Q_{\text{cycle}} - W_{\text{cycle}} = 0 \implies \oint \delta Q = \oint \delta W \tag{18.10} \]

\[ W_{\text{net}} = Q_{\text{net}} = Q_{\text{in}} - Q_{\text{out}} \tag{18.11} \]

18.3.2 Cycle Classification & Thermal Efficiency

  1. Power Cycle: Operates to produce net positive work (\(W_{\text{net}} > 0\)). Thermal energy is absorbed from a high-temperature source (\(Q_{\text{in}} > 0\)) and waste heat is rejected to a sink (\(Q_{\text{out}} > 0\)). The thermal efficiency \(\eta_{\text{th}}\) is defined as:

\[ \eta_{\text{th}} \equiv \frac{\text{Net Work Output}}{\text{Heat Input}} = \frac{W_{\text{net}}}{Q_{\text{in}}} = \frac{Q_{\text{in}} - Q_{\text{out}}}{Q_{\text{in}}} = 1 - \frac{Q_{\text{out}}}{Q_{\text{in}}} \tag{18.12} \]

  1. Refrigeration / Heat Pump Cycle: Consumes net work (\(W_{\text{net}} < 0\), or \(W_{\text{in}} > 0\)) to transfer heat from a cold medium (\(Q_{\text{in}} = Q_L\)) to a warm medium (\(Q_{\text{out}} = Q_H\)).

Example 18.1: Three-Process Gas Power Cycle (Video 85, COE 24)

An ideal gas undergoes a closed three-process cycle:

  • Process 1 \(\to\) 2: Isothermal expansion at \(T_1 = 600\text{ K}\) from \(V_1 = 0.01\text{ m}^3\) to \(V_2 = 0.03\text{ m}^3\).
  • Process 2 \(\to\) 3: Constant-pressure cooling at \(P_2\) to \(V_3 = V_1 = 0.01\text{ m}^3\).
  • Process 3 \(\to\) 1: Constant-volume heating returning to State 1. Verify that \(\sum Q = \sum W\) and compute the cycle thermal efficiency.
from kilojoule.templates.default import *
import kilojoule.idealgas as idealgas
import numpy as np

air = idealgas.Properties('Air', unit_system='kSI_K')
R = air.R
cv = air.cv(T=Quantity(450, 'K'))
cp = air.cp(T=Quantity(450, 'K'))

# Mass of gas and state specifications
m_gas = Quantity(0.05, 'kg')
T1 = Quantity(600.0, 'K')
V1 = Quantity(0.01, 'm^3')
V2 = Quantity(0.03, 'm^3')

# State 1
P1 = (m_gas * R * T1) / V1

# Process 1 -> 2: Isothermal expansion (T2 = T1)
T2 = T1
P2 = (m_gas * R * T2) / V2
W12 = (m_gas * R * T1 * np.log((V2 / V1).magnitude)).to('kJ')
Q12 = W12

# Process 2 -> 3: Constant-pressure compression (P3 = P2, V3 = V1)
P3 = P2
V3 = V1
T3 = (P3 * V3) / (m_gas * R)
W23 = (P2 * (V3 - V2)).to('kJ')
Q23 = (m_gas * cp * (T3 - T2)).to('kJ')

# Process 3 -> 1: Constant-volume heating (V1 = V3)
W31 = Quantity(0.0, 'kJ')
Q31 = (m_gas * cv * (T1 - T3)).to('kJ')

# Net cycle totals
W_net = W12 + W23 + W31
Q_net = Q12 + Q23 + Q31
delta_U_net = Q_net - W_net
eta_th = float(W_net / (Q12 + Q31))

print(f"Cycle Net Work:  W_net       = {W_net.to('kJ').magnitude:.3f} kJ")
print(f"Cycle Net Heat:  Q_net       = {Q_net.to('kJ').magnitude:.3f} kJ")
print(f"Internal Energy: Delta_U_net = {delta_U_net.to('kJ').magnitude:.3e} kJ")
print(f"Thermal Efficiency: eta_th   = {eta_th*100:.2f}%")

# Visualize three-process closed cycle on P-v diagram
p[161] = P1.to('kPa')
T[161] = T1
states.fix(161, air)

p[162] = P2.to('kPa')
T[162] = T2
states.fix(162, air)

p[163] = P3.to('kPa')
T[163] = T3
states.fix(163, air)

pv18 = air.pv_diagram()
pv18.plot_state(states[161], label='1')
pv18.plot_state(states[162], label='2')
pv18.plot_state(states[163], label='3')
pv18.plot_process(states[161], states[162], path='isothermal', label='1->2 Isothermal')
pv18.plot_process(states[162], states[163], path='isobaric', label='2->3 Isobaric')
pv18.plot_process(states[163], states[161], path='isochoric', label='3->1 Isochoric')
Process 1-2: Q12 = 9.46 kJ, W12 = 9.46 kJ, DeltaU12 = 0.00 kJ
Process 2-3: Q23 = -10.05 kJ, W23 = -2.87 kJ, DeltaU23 = -7.18 kJ
Process 3-1: Q31 = 7.18 kJ, W31 = 0.00 kJ, DeltaU31 = 7.18 kJ
---
Cycle Net Work:  W_net       = 6.589 kJ
Cycle Net Heat:  Q_net       = 6.589 kJ
Internal Energy: Delta_U_net = 0.000e+00 kJ (Conserved!)
Thermal Efficiency: eta_th   = 39.59%
Closed Three-Process Gas Power Cycle on P-v Diagram (COE 24)

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 β€” Adiabatic Charging of an Evacuated Steam Accumulator Tank

A rigid, well-insulated \(V = 0.40\text{ m}^3\) steam vessel is initially completely evacuated (\(m_1 = 0\)) and connected through a valve to a large supply main carrying steam at \(P_i = 2.0\text{ MPa}\) and \(T_i = 350^\circ\text{C}\) (\(h_i = 3137.7\text{ kJ/kg}\)). The valve is opened until the tank pressure equals the line pressure (\(P_2 = 2.0\text{ MPa}\)), then closed. Applying the unsteady Uniform-State, Uniform-Flow energy balance, explain why final temperature \(T_2\) exceeds \(T_i\), and use the CoolProp/superheated steam property pair \((P_2, u_2)\) to determine \(T_2\) and the total steam mass \(m_2\) that entered.

πŸ” Click to View Complete Step-by-Step Solution
  1. Transient Charging Energy Balance (\(m_1 = 0, Q = 0, W = 0\)): \[m_i h_i = m_2 u_2 - m_1 u_1 \implies m_2 h_i = m_2 u_2 \implies u_2 = h_i = u_i + P_i v_i\]

  2. Physical Reason for Temperature Jump: All flow work \(P_i v_i\) pushing steam across the inlet boundary converts directly into internal energy of the trapped gas! Thus \(u_2 = 3137.7\text{ kJ/kg}\) at \(P_2 = 2.0\text{ MPa}\).

  3. Evaluate State 2 at \((P_2 = 2.0\text{ MPa},\; u_2 = 3137.7\text{ kJ/kg})\): \[T_2 = 512.0^\circ\text{C}, \qquad v_2 = 0.17859\text{ m}^3/\text{kg}\] \[m_2 = \frac{V}{v_2} = \frac{0.40}{0.17859} = 2.240\text{ kg}\] Final Result: \(T_2 = 512.0^\circ\text{C}\) (\(+162.0\text{ K}\) warmer than supply!), \(m_2 = 2.240\text{ kg}\).


Practice Problem 2 β€” Evacuated vs.Β Partially Pressurized Ideal-Gas Tank Charging (\(T_2 = k T_i\))

An insulated \(V = 0.60\text{ m}^3\) surge cylinder is charged adiabatically from a nitrogen main (\(k = 1.40\), \(R = 0.2968\text{ kJ}/(\text{kg}\cdot\text{K})\)) held at \(P_i = 800\text{ kPa}\) and \(T_i = 300\text{ K}\) until the tank reaches \(P_2 = 800\text{ kPa}\). Compute the final temperature \(T_2\) and final nitrogen mass \(m_2\) under two starting cases:

πŸ” Click to View Complete Step-by-Step Solution
  1. Case (a) Evacuated Start: With \(m_1 = 0\), \(u_2 = h_i \implies c_v T_2 = c_p T_i\): \[T_{2,a} = k T_i = 1.40(300) = 420.0\text{ K}, \qquad m_{2,a} = \frac{(800)(0.60)}{(0.2968)(420.0)} = 3.851\text{ kg}\]

  2. Case (b) Partially Filled Start (\(P_1 = 200\text{ kPa},\; T_1 = 300\text{ K}\)): Using \(m_2 c_v T_2 - m_1 c_v T_1 = (m_2 - m_1) c_p T_i\) and substituting \(m R T = P V\) gives \(P_2 - P_1 = k T_i (P_2 / T_2 - P_1 / T_1)\):

  3. \[T_{2,b} = \frac{k T_i P_2}{P_2 - P_1 + k P_1 (T_i/T_1)} = \frac{(1.40)(300)(800)}{800 - 200 + 1.40(200)(1)} = 381.82\text{ K}\] \[m_{2,b} = \frac{(800)(0.60)}{(0.2968)(381.82)} = 4.236\text{ kg}\] Final Result: (a) \(T_2 = 420.0\text{ K}\) (\(m_2 = 3.851\text{ kg}\)); (b) \(T_2 = 381.82\text{ K}\) (\(m_2 = 4.236\text{ kg}\)).


Practice Problem 3 β€” Heat Rejection During Constant-Temperature Compressed-Air Bottle Refill

A steel compressed-air cylinder (\(V = 0.50\text{ m}^3\)) initially holds air (\(R = 0.287\), \(c_v = 0.718\), \(c_p = 1.005\text{ kJ}/(\text{kg}\cdot\text{K})\)) at \(P_1 = 120\text{ kPa}\) and \(T_1 = 295\text{ K}\). It is charged slowly from a manifold at \(P_i = 700\text{ kPa}\), \(T_i = 310\text{ K}\) until tank pressure hits \(P_2 = 700\text{ kPa}\). Cooling fins keep the final tank temperature equal to \(T_2 = 295\text{ K}\). Compute the mass of air added \(m_{\text{in}}\) and the total heat transfer \(Q\) across the tank wall.

πŸ” Click to View Complete Step-by-Step Solution
  1. Air Mass Added (\(m_{\text{in}} = m_2 - m_1\)): \[m_1 = \frac{(120)(0.50)}{(0.287)(295)} = 0.709\text{ kg}, \qquad m_2 = \frac{(700)(0.50)}{(0.287)(295)} = 4.134\text{ kg} \implies m_{\text{in}} = 3.425\text{ kg}\]

  2. USUF Energy Balance (\(W = 0\), zero reference enthalpy cancel using \(T_{\text{ref}} = 0\text{ K}\)): \[Q + m_{\text{in}} (c_p T_i) = m_2 (c_v T_2) - m_1 (c_v T_1)\]

  3. Solve for Heat Rejected \(Q\): \[Q = (m_2 - m_1)c_v(295) - m_{\text{in}}c_p(310) = 3.425\left[(0.718)(295) - (1.005)(310)\right] = -341.6\text{ kJ}\] Final Result: \(m_{\text{in}} = 3.425\text{ kg}\), \(Q = -341.6\text{ kJ}\) (\(341.6\text{ kJ}\) rejected to ambient).


Practice Problem 4 β€” Closed-System Ideal-Gas Stirling Cycle Work & Efficiency Synthesis

A closed regenerative Stirling piston engine operates on \(m = 0.080\text{ kg}\) of air (\(R = 0.287\), \(c_v = 0.718\text{ kJ}/(\text{kg}\cdot\text{K})\)) between \(T_H = 750\text{ K}\) and \(T_L = 300\text{ K}\) with volume ratio \(V_{\max}/V_{\min} = 3.0\):

πŸ” Click to View Complete Step-by-Step Solution
  1. Isothermal Strokes (\(\Delta U = 0 \implies Q = W\)): \[Q_{12} = W_{12} = m R T_H \ln(3) = (0.080)(0.287)(750)\ln(3) = +18.92\text{ kJ}\] \[Q_{34} = W_{34} = m R T_L \ln(1/3) = (0.080)(0.287)(300)(-\ln 3) = -7.57\text{ kJ}\]

  2. Constant-Volume Strokes (\(W = 0 \implies Q = \Delta U\)): \[W_{23} = W_{41} = 0, \quad Q_{23} = -Q_{41} = m c_v (300 - 750) = (0.080)(0.718)(-450) = -25.85\text{ kJ}\]

  3. Cycle Work & Thermal Efficiency (Without Regeneration): Here \(Q_{\text{in}} = Q_{12} + Q_{41} = 18.92 + 25.85 = 44.77\text{ kJ}\): \[W_{\text{net}} = 18.92 + (-7.57) = 11.35\text{ kJ}, \qquad \eta_{\text{th}} = \frac{11.35}{44.77} = 25.36\%\] (With an ideal \(100\%\) regenerator transferring \(Q_{23}\) directly into \(Q_{41}\), \(\eta_{\text{th}}\) rises to the Carnot limit \(1 - 300/750 = 60.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.