Viscous heating in heterogeneous media as applied to the thermal interaction between the crust and mantle