The entropy change of a system is the sum of two parts:
- Entropy transferred from the surroundings to the system (across the interface with the surroundings) as a result of heat flow, and given by $\int{\frac{dq}{T_B}}$, where dq is the differential heat flow across the boundary interface between the system and surroundings and $T_B$ is the temperature at the boundary through which this same heat flow takes place.
- Entropy generation $\sigma$ within the system as a result of irreversibility driven by internal viscous friction, internal conductive heat transfer, and internal mass diffusion. In a reversible process, this contribution to the entropy change is zero, and, in an irreversible process, this contribution is always positive
So, $$\Delta S=\int{\frac{dq}{T_B}}+\sigma$$or, expressed as an inequality,
$$\Delta S\geq \int{\frac{dq}{T_B}}$$Also, in a reversible process, the system and surroundings temperatures are equal, so that, at the boundary, $T_B=T$, where T is the system temperature.