# What is the sign of the work done by a gas with below atmospheric pressure?

In thermodynamics, given a piston containing a fixed quantity of gas, when the gas is heated the piston expands and does work on the environment. Using the convention that

$$\Delta U_{in} = Q_{in} - W_{out}$$

the work done is positive and is measured by

$$W_{out} = \int P \cdot dV$$

If the same gas is cooled to below atmospheric pressure, then the atmosphere will do work on the gas (nominally equal to the amount of heat that is withdrawn from it). In this case, the $dV$ will be negative, so the direction of the work sign is negative.

My confusion is this: it is still possible to extract work from a piston that is being compressed by atmospheric pressure (e.g. a Newcomen-style engine ). But then seems as though the work gets "double-counted"- done ON the piston system but also extracted BY the mechanism. On the one hand, I can say that the work done by the system is negative, since the area inside the P-V curve doesn't depend on atmospheric pressure, and this work is outside the P-V curve, and the sign of the heat transfer is negative, etc. On the other hand, the work done on the real world is definitely positive. How do I reconcile this?

• The net work done by the atmosphere is $0$, so it doesn't affect the global analysis of the cycle, but it does answer the question asked of how it affects the processes locally. – Sean E. Lake Oct 8 '16 at 23:39