The entropy balance states dS/dt = Q̇/T_b + Σṁ_in*s_in - Σṁ_out*s_out + S_gen, where S_gen ≥ 0 is entropy generation from irreversibilities. Reversible processes have S_gen = 0; all real processes have S_gen > 0. Quantifying entropy generation identifies sources of inefficiency: heat transfer across temperature differences, friction, mixing, and throttling.
The second law gives you a direction — entropy of an isolated system can never decrease — but the entropy balance equation turns that qualitative statement into a quantitative engineering tool. Think of it as an accounting equation for entropy, parallel to the energy balance you already know. Just as the energy balance tracks energy flowing in and out plus any generation, the entropy balance tracks entropy flowing in via heat transfer, entropy carried by mass flows, and entropy generated internally. The crucial difference from energy: entropy can be generated inside a system (by irreversibilities), but it cannot be destroyed. There is no entropy "consumption" term.
Reading the balance term by term helps build intuition. The heat transfer term Q̇/T_b accounts for entropy entering or leaving with heat; you must evaluate it at the boundary temperature T_b where the transfer occurs, not some average system temperature. This is why the same heat flow Q̇ carries more entropy when transferred at low temperature (large Q̇/T_b) than at high temperature (small Q̇/T_b) — a fact that underpins why low-temperature heat sources are thermodynamically wasteful. The mass flow terms Σṁ_in s_in and Σṁ_out s_out track entropy transported by fluid streams; specific entropy s is looked up in property tables just like enthalpy. These three terms together would give zero entropy change in a reversible process.
The entropy generation term S_gen ≥ 0 is what makes this equation useful for diagnosis. A reversible process has S_gen = 0 — it is an ideal limit never actually achieved. Any real process has S_gen > 0. The sources are precisely the irreversibilities you studied qualitatively: heat transfer across a finite temperature difference, viscous friction, unrestrained expansion, mixing of different substances, and throttling. The larger S_gen, the more the process destroys what engineers call "available work" — the capacity to do useful work is wasted as entropy production. This connection between S_gen and lost work is made precise in exergy analysis, which is where this topic leads.
For a steady-state open system (no storage), dS/dt = 0 and the entropy balance simplifies to: S_gen = Σṁ_out s_out − Σṁ_in s_in − Q̇/T_b. This is the form used in most device analysis. For an adiabatic device (Q̇ = 0), S_gen = Σṁ_out s_out − Σṁ_in s_in, and S_gen ≥ 0 requires that exit entropy is at least as large as inlet entropy. An isentropic device (the idealized limit) has both Q̇ = 0 and S_gen = 0, so s_out = s_in — constant specific entropy through the device. Real turbines and compressors are analyzed by comparing actual S_gen to zero: isentropic efficiency η_s measures how close the real device comes to its isentropic ideal. Entropy balance is thus the quantitative foundation for every efficiency metric in thermodynamics.