The second law of Thermodynamics states, It is impossible for a cyclic process connected to a reservoir at one temperature to produce a positive amount of work in the surroundings.
A cyclic process is one in which the system returns to its inital state. A simple steam engine undergoes an expansion step (the power stroke), followed by a compression (exhaust stroke) in which the piston, and thus the engine, returns to its initial state before the process repeats.
“At one temperature” means that the expansion and compression steps operate isothermally. This means that ΔU = 0; just enough heat is absorbed by the system to perform the work required to raise the weight, so for this step q = –w.
“A positive amount of work in the surroundings” means that the engine does more work on the surroundings than the surroundings do on the engine. Without this condition the engine would be useless.
Note carefully that the Second Law applies only to a cyclic process— isothermal expansion of a gas against a non-zero pressure always does work on the surroundings, but an engine must repeat this process continually; to do so it must be returned to its initial state at the end of every cycle. When operating isothermally, the work –w it does on the surroundings in the expansion step (power stroke) is nullified by the work +w the surroundings must do on the system in order to complete the cycle.
The second law can be stated alternately:
It is impossible to construct a machine operating in cycles that will convert heat into work without producing any other changes. Thus the Second Law does allow an engine to convert heat into work, but only if “other changes” (transfer of a portion of the heat directly to the surroundings) are allowed. And since heat can only flow spontaneously from a source at a higher temperature to a sink at a lower temperature, the impossibility of isothermal conversion of heat into work is implied.
A device that violates the Second Law of Thermodynamics is formally known as a perpetual motion machine of the second kind. (A perpetual motion machine of the first kind is one that would violate the First Law.)
The second law can also be explained by focusing more on the equations involved.
The second law states that there exists a useful state variable called entropy S. The change in entropy delta S is equal to the heat transfer delta Q divided by the temperature T.
delta S = delta Q / T
For a given physical process, the combined entropy of the system and the environment remains a constant if the process can be reversed. If we denote the initial and final states of the system by "i" and "f":
Sf = Si (reversible process)
An example of a reversible process is ideally forcing a flow through a constricted pipe. Ideal means no boundary layer losses. As the flow moves through the constriction, the pressure, temperature and velocity change, but these variables return to their original values downstream of the constriction. The state of the gas returns to its original conditions and the change of entropy of the system is zero. Engineers call such a process an isentropic process. Isentropic means constant entropy.
The second law states that if the physical process is irreversible, the combined entropy of the system and the environment must increase. The final entropy must be greater than the initial entropy for an irreversible process:
Sf > Si (irreversible process)
An example of an irreversible process is the problem discussed in the second paragraph. A hot object is put in contact with a cold object. Eventually, they both achieve the same equilibrium temperature. If we then separate the objects they remain at the equilibrium temperature and do not naturally return to their original temperatures. The process of bringing them to the same temperature is irreversible.