Numerical simulations in both two- and three-dimensions are performed to investigate the hypothesis that D " is a thermo-chemical boundary layer. A layer of dense, compositionally-distinct material above the CMB reduces the characteristic horizontal lengthscales and interior mantle temperature. In three-dimensions, the layer forms a spoke pattern, with entrainment in upwelling cylinders, even for systems which are heated entirely from within. Long-term stability of the layer requires rather high density contrasts if the Boussinesq approximation is assumed, but geophysically reasonable density contrasts using a compressible formulation with depth-dependent properties. Temperature-dependent viscosity and internal heating also promote greater layer stability. Even if the core heat flux is zero, the layer can become several 100 K higher than the mantle;above it, due to trapped radiogenically-produced heat. The combination of high deep-mantle viscosity and other depth-dependent parameters allows a stable layer with very high topography, leading to huge, thermo-chemical 'megaplumes' extending at least half way through the lower mantle. These stationary megaplumes are stable for long geological times and may correspond to the 'megaplumes' imaged tomographically under Africa and the Pacific, as well as acting as a geochemical reservoir and providing an explanation for various other geophysical observations. The dense layer increases the lateral heterogeneity in density and probably seismic velocity in the deep mantle, although the signature of the layer may be partly masked by cancellation of thermal and chemical effects. The interaction of thermal convection with a preexisting dense, homogeneous layer does not cause short-wavelength heterogeneity per se (although sharp edges may be generated), and thus some additional mechanism, such as the introduction of fresh heterogeneity by slabs, must be active to explain seismic observations of short-scale D " variation. Unfortunately, these mechanisms tend to produce a layer boundary too gradual to produce a strong seismic reflection, perhaps leading to a phase change as the prefered explanation of the "Lay discontinuity".