Index / Sheet list
Thermodynamics & fluid mechanics

The first law of thermodynamics explained with solved problems

Energy is never created or destroyed, only moved as heat and work. Here is what that means for closed and open systems, with two problems solved step by step.

On this page
  1. The concept
  2. Assumptions
  3. Where the first law is used
  4. What the first law doesn’t tell you

The first law of thermodynamics is the law of conservation of energy applied to heat and work. Energy can cross the boundary of a system only as heat or as work, and whatever goes in and doesn’t come out is stored in the system. Every engine, compressor, boiler and refrigerator is analysed by starting here.

The concept

Draw a boundary around the thing you want to study: the system. Everything outside is the surroundings. Energy crosses the boundary in two ways:

  • Heat (Q) flows because of a temperature difference, for example from a flame into a cylinder.
  • Work (W) is energy transferred by a force moving through a distance, for example gas pushing a piston or a shaft turning.

Energy stored inside the system is its internal energy (U): the kinetic and potential energy of its molecules, which shows up mostly as temperature. The first law simply balances the books.

Gasinternal energy UHeat in, QWork out, Wpiston risesSystem boundarynothing crosses it but heat and workQ − W = ΔUheat in positive, work out positive
A closed system: the gas inside the cylinder. Heat Q crosses the boundary at the bottom, work W leaves as the piston rises, and the difference stays in the gas as a rise in internal energy, ΔU = Q − W.

Closed systems

A closed system has a fixed mass: nothing flows in or out, as with gas trapped in a cylinder.

Q−W=ΔU=m cv (T2−T1)(ideal gas)Q - W = \Delta U = m\,c_v\,(T_2 - T_1) \quad \text{(ideal gas)}

Open systems (steady flow)

An open system, or control volume, has mass flowing through it: a turbine, pump, compressor, nozzle or heat exchanger. Each kilogram of fluid carries its own energy in, and pushing it in and out takes work too. Combining the internal energy with that flow work gives enthalpy, h=u+pvh = u + pv. For steady flow:

Q˙−W˙=m˙[(h2−h1)+V22−V122+g (z2−z1)]\dot Q - \dot W = \dot m \left[ (h_2 - h_1) + \frac{V_2^2 - V_1^2}{2} + g\,(z_2 - z_1) \right]

For an ideal gas, h2−h1=cp (T2−T1)h_2 - h_1 = c_p\,(T_2 - T_1).

Sign convention

This guide uses the common engineering convention: heat into the system is positive, and work done by the system is positive. Some textbooks count work done on the system as positive and write ΔU=Q+W\Delta U = Q + W. Both are correct as long as you stay consistent.

Assumptions

  • The system boundary is clearly defined, and only heat and work cross it (closed system), or the flow is steady with one inlet and one outlet (open system).
  • Kinetic and potential energy changes are ignored unless velocities or heights change a lot.
  • Air behaves as an ideal gas with constant specific heats: R = 287 J/kg·K, c_v = 718 J/kg·K, c_p = 1005 J/kg·K.
  • Processes are slow enough that pressure is uniform in the gas (quasi-static), so W=∫p dVW = \int p\,dV.

Solved problem 1: heating gas in a cylinder

A piston-cylinder holds 0.5 kg of air at 200 kPa and 300 K. It is heated at constant pressure until it reaches 500 K. Find the work done, the change in internal energy and the heat supplied.

Step 1: volumes from the ideal gas law.

V1=mRT1p=0.5×287×300200 000=0.2153 m3,V2=0.5×287×500200 000=0.3588 m3V_1 = \frac{mRT_1}{p} = \frac{0.5 \times 287 \times 300}{200\,000} = 0.2153\ \text{m}^3, \qquad V_2 = \frac{0.5 \times 287 \times 500}{200\,000} = 0.3588\ \text{m}^3

Step 2: boundary work at constant pressure.

W=p (V2−V1)=200 000×0.1435=28 700 JW = p\,(V_2 - V_1) = 200\,000 \times 0.1435 = 28\,700\ \text{J}

Step 3: change in internal energy.

ΔU=m cv (T2−T1)=0.5×718×200=71 800 J\Delta U = m\,c_v\,(T_2 - T_1) = 0.5 \times 718 \times 200 = 71\,800\ \text{J}

Step 4: heat from the first law.

Q=ΔU+W=71 800+28 700=100 500 JQ = \Delta U + W = 71\,800 + 28\,700 = 100\,500\ \text{J}

Check: at constant pressure Q=m cp ΔT=0.5×1005×200=100 500Q = m\,c_p\,\Delta T = 0.5 \times 1005 \times 200 = 100\,500 J. ✓

AnswerW = 28.7 kJ, ΔU = 71.8 kJ, Q = 100.5 kJ

Notice that most of the heat (about 71 %) stays in the gas as internal energy; only about 29 % comes out as work. That is why heating a gas at constant pressure is a poor way to make work, and why engines use cycles that compress the gas first.

Solved problem 2: an air compressor (steady flow)

A compressor takes in 0.5 kg/s of air at 300 K and delivers it at 450 K. It loses 5 kW of heat to its surroundings. Inlet and outlet velocities and heights are about equal. Find the power needed to drive it.

Step 1: write the steady flow energy equation, dropping the kinetic and potential energy terms.

Q˙−W˙=m˙ cp (T2−T1)\dot Q - \dot W = \dot m\,c_p\,(T_2 - T_1)

Step 2: put in the numbers. Heat leaves, so Q˙=−5\dot Q = -5 kW.

−5−W˙=0.5×1.005×(450−300)=75.4 kW-5 - \dot W = 0.5 \times 1.005 \times (450 - 300) = 75.4\ \text{kW}

Step 3: solve.

W˙=−5−75.4=−80.4 kW\dot W = -5 - 75.4 = -80.4\ \text{kW}

The negative sign means work is done on the air, not by it.

AnswerThe compressor needs 80.4 kW of shaft power

Where the first law is used

  • Engines: the heat released by burning fuel equals the work output plus the heat lost in the exhaust and coolant. See Otto and Diesel cycles.
  • Heat exchangers: the heat lost by the hot fluid equals the heat gained by the cold one.
  • Cooling of electronics and machines: the power dissipated must leave as heat, which sets the size of the fan or heat sink. See heat transfer fundamentals.
  • Pumps, fans and turbines: the shaft power equals the change in the fluid’s energy plus losses.

What the first law doesn’t tell you

The first law says energy is conserved, but not which way it flows or how much of the heat can become work. A cup of coffee never gets hotter by drawing heat from a cold room, even though that wouldn’t break the first law. The second law sets those limits, and gives the Carnot efficiency as the ceiling for any engine.

Key points

  • Energy crosses a system boundary only as heat or work; the rest is stored as internal energy.
  • Closed system: Q − W = ΔU. Steady flow: Q̇ − Ẇ = ṁ(Δh + ΔV²/2 + gΔz).
  • Choose a sign convention, write it down and keep it.
  • The first law balances energy; the second law decides how much heat can become work.

In practice

See it in CAD

Our projects that put this topic to work.

Need this designed or explained for your team?

We design parts and machines in CAD, make the drawings for manufacturing and train teams. Tell us what you are working on.