The heat dissipation function is derived for media in which viscous and inelastic (plastic) flows occur. It is shown that the heat dissipation is a quadratic expression in the components of the stress tensor, the strain tensor, and the time derivative of the latter tensor, where the coefficients are simple algebraic functions of the coefficients which occur in the stress-strain relation. The heat dissipation functions for ordinary viscous fluids (with shear and volume viscosity), and for Maxwell, Kelvin (Voigt), Poynting-Thomson, Jeffreys, Prandtl-Reuss, Bingham, Saint Venant, and Hooke media are special cases of the more general expression which is derived. For Kelvin media (and for ordinary viscous fluids) the heat dissipation function reduces to the Rayleigh dissipation function. From the non-negative character of the entropy production and from stability considerations some inequalities are derived for the coefficients which occur in the theory.