# Does the Gas do Work When I remove the barrier? [duplicate]

Let's suppose I have 2 boxes, one with gas molecules in. The other without. I then magically remove the barrier connecting the two gasses. The pressure inside the box and volume taken up by the gas have both changed. But the gas has done no work.

My question is simple, based on the definition of work done by a gas$$W = \int pdV$$ it seems to me like the gas should be doing work, but I know it's not, so I am clearly missing something.

• I think this formula works only if the system is in thermal equilibrium throughout the process. The scenario you wrote isn't in thermal equilibrium during the expansion of the gas. Commented Aug 2 at 19:22
• But temperature is a measure of average kinetic energy per molecule, and removing the barrier doesn't change this so the temperature is constant - assuming ideal gas Commented Aug 2 at 19:28
• I didn't say that you need to have an isothermal process (process which conserves temperature), I'm saying something stronger: Your system is not in thermodynamic equilibrium! Commented Aug 2 at 19:33
• To state differently the of course correct answer by quantum mechanic. The true formula for the work done considers the pressure AGAINST which the system expands. This pressure is only equal to the internal one at equilibrium or in quasi static processes. In which case you recover the formula you gave. In the case of a vacuum, the pressure against which the gas expand is 0! Commented Aug 2 at 19:36
• This question is similar to: Why there's no work in adiabatic free expansion?. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Aug 3 at 11:59

The meta-question is: on what is the work being done? When there was a barrier, particles were colliding with the barrier, they were bouncing off and changing their momentum, which implied that there was a force by the particles on the barrier (known as "pressure") and by the barrier on the particles (that led to the momentum kick).

When the barrier is removed, the particles have nothing on which to push, so they have nothing on which to do work. And there is nothing pushing back on the particles, so there is no work being done on the gas.

It is true, as pointed out in the comments, that $$W=\int P(V) dV$$ only holds for quasistatic processes, in which the pressure of the gas is approximately constant throughout the gas. This is not what is breaking down in this situation; the gas is not moving so quickly that it can't come to equilibrium throughout itself.** What is breaking down is that this type of work comes from force times displacement, so if there is no force then there is no work (here: there is no pressure). It's like saying "how much energy would it take for a ball moving in space to keep moving in that direction" and the answer is zero, if nothing is stopping it.

** There may be a bit of debate of this point on Wikipedia. As the gas expands into the empty chamber, is the density on the left the same as on the right? You might actually get a gradient of densities initially, as some particles start moving into the empty space, so they say that there might not be full equilibrium throughout the gas. But again, pressure exists as a concept only if there is something on which the forces act, so if you let the particles bounce around for a little bit they'll come to equilibrium throughout the bigger volume without having had to push to get there.

• Maybe a little bit of an odd question, but if instead of magically removing the barrier, I was to gradually move it, at a very slow rate towards the right (such as to ensure a quasistatic process), would the equation then hold? And would the gas then be doing work? Commented Aug 2 at 19:46
• @cookiecainsy not odd at all, but you can figure this out based on my answer! The question that you need to consider: which particles are the ones causing the gas to change its volume - the ones that hit the gradually moving barrier or the ones going through the gradually widening gap? I specifically said that it is not quasistaticness (quasistaticity? quasistatistics?) breaking down here, it is that work comes from force acting on something Commented Aug 2 at 20:24

The equation $$W = \int pdV$$ is for the boundary work done by the system on its surroundings. If the gas is the system, the rigid boxes the boundary, and everything outside the boxes the surroundings, then the gas does no work.

But within the boxes upon removal of the common wall there is work being done by one part of the gas on the other. See the diagrams below. A pressure gradient is produced during the expansion such that the gas towards the left has a higher local pressure than the gas towards the right (the evacuated space). This results in the gas towards the left doing work on the gas towards the right "pushing" into the evacuated space. However, the energy transferred from the gas towards the left equals the energy gained by the gas towards the right, for a net work of zero.

Hope this helps.

• Thanks for your answer, you answered a related question of mine yesterday physics.stackexchange.com/questions/823185/… . I really appreciate your help, however, relating to the question you answered yesterday, would you able to confirm whether or not the gas is pushing on the cylinder in the first stage of the Carnot cycle? I apologise for asking another question like this, but I seem to be finding this concept difficult. Commented Aug 3 at 17:16
• @cookiecainsy pushing on the cylinder? Did you mean piston? Commented Aug 3 at 17:25
• yes, sorry I should have made that clear Commented Aug 3 at 17:27
• @cookiecainsy Yes the gas pushes on the piston Commented Aug 3 at 18:07
• okay and during the first adiabatic expansion, (step 2) why does the temperature of the gas inside the cylinder decrease? If the gas is ideal, changing volume should have no affect on temperature? Commented Aug 3 at 18:12

Expansion of ideal gas in vacuum doesn't do any work. In dW=pdV p is the pressure of the environment, which is 0, so W=0 as well. Which is logical, the higher the pressure against expansion, the more work is done by expanding some volume.