Entropy generation Does entropy generation fully define if the process is possible or not? For example if I have a piston cylinder device expands freely and isothermally from 200kpa to 10kpa - which is not possible because of the atmosheric pressure - but here we find entropy generation is positive !
 A: The question brings up a point that is frequently lost: For a process to be feasible it is not enough for the total entropy generation from initial-to-final state to be zero, it must be zero in every step of the process.

Let's see why the experiment you propose is not feasible. We start with a rigid insulated box divided into parts: $A$ is the system, $B$ is the surroundings. If $B$ is very large it becomes the atmosphere, but this is not important. Both systems are at the same temperature but at different pressures. Now we move the piston isothermally by a small amount so that the volume of part $A$ changes by $\Delta V$ and the volume of $B$ by $-\Delta V$. During this step the energy of part $A$ changes by $\Delta U$ and part $B$ by $-\Delta U$ (the box is an isolated system).
We will calculate entropy changes using the entropy equation
$$
   dS = \frac{dU}{T} + \frac{P dV}{T}
$$
For small $\Delta V$:
$$
  \Delta S_A = \frac{\Delta U}{T} +  \frac{P_A \Delta V}{T}
$$
$$
  \Delta S_B = -\frac{\Delta U}{T} -  \frac{P_B \Delta V}{T}
$$
The entropy generation is
$$
   S_\text{gen} = \Delta S_A + \Delta S_B =(P_A-P_B)\frac{\Delta V}{T}\geq 0
$$
This must be positive, or zero at most. This means that if $P_A>P_B$ then $\Delta V>0$, i.e., $A$ moves into $B$; if $P_A<P_B$ then $\Delta V<0$, i.e., $B$ moves into $A$.
Conclusion The expansion is feasible as long as the high pressure part expands into the low pressure part. This of course we know from simply looking at the forces on the piston. The point is that the second law gives the right answer. So, once we reach the point where pressures are equal, any further expansion would require negative entropy generation and is therefore unfeasible. That's the equilibrium state and once it is reached, the system will remain there. 
