# Irreversibility of heat transfer between two reservoirs

In a closed system the entropy change is given by $\Delta s=s_{gen}+\int \delta Q/T$. If $s_{gen}=0$, the state change is called reversible.

Why is a heat flux between a hot and a cold reservoirs called irreversible? I understand that $\Delta s>0$, but why should there be a positive $s_{gen}$?

The formula you have written applies to a system, with $S_{gen}$ being the entropy generated in the interior of the system, and $\int~dQ/T$ being the entropy flux across the system's boundary. To apply this equation to the example of heat exchange $Q$ between two heat reservoirs at temperatures $T_1$ and $T_2$, with $T_1>T_2$, you must first define your system. If you take the hot reservoir or cold reservoir as your system, then indeed there is no entropy generated within their interior, and only flux term remains (equal to $-Q/T_1$ or $+Q/T_2$ depending on your choice of system). However if you take both of them together as a system, then flux term will become zero (because heat flux is then internal) while entropy generation term will be non-zero (equal to $Q/T_2-Q/T_1$).
For any process to be labeled as irreversible, entropy change not of any particular system but that of the entire universe (system+surroundings) must be considered. Obviously, for the universe flux terms are always zero (there is nothing else to exchange heat with), and any increase in entropy is always $S_{gen}$.
So, $$\Delta S_h=-Q/T_h$$ $$\Delta S_c=Q/T_c$$ $$\Delta S_w=Q/T_h-Q/T_c+s_{gen}=0$$and $$\Delta S_{universe}=\Delta S_h+\Delta S_c+\Delta S_w=s_{gen}=Q/T_c-Q/T_h$$