Some one-dimensional models of a heterogeneous solid are presented consisting of a succession of slabs with different anharmonic properties. The equation for the temperature variation in these models due to passage of a longitudinal elastic wave can be solved exactly in the approximation of weak attenuation. The solutions are given in terms of the forced oscillation plus the temperature wave solutions to the homogeneous equation needed to match the boundary conditions of continuity of temperature and thermal current. Thermoelastic attenuation due to this temperature variation is compared to that of Zener's classical approach. For periodic arrangement of slab properties or upon use of Zener's boundary condition of vanishing thermal current, the temperature-wave approach reproduces Zener-type attenuation. However, a succession of slabs with a random, uncorrelated distribution of the Gruneisen constant leads to a new result with attenuation proportional to the three-halves power of the wave frequency in the low-frequency limit. The results are discussed in the context of seismoacoustic wave attenuation.