(downward) it will be compressed and because in that case $\mathbf u
\cdot \mathbf g > 0$ we get a positive heat source. Conversely, the
fluid will cool down if it moves against the direction of gravity.
+
+ Implementing this requires one additional step, however. As mentioned in the
+ introduction, we use a rather simplified model for gravity in which the
+ gravity force diminishes with depth, as if Earth had a homogenous
+ density. That isn't the case, however: the earth core is much denser than
+ the mantle, and gravity actually tops out at the core
+ mantle boundary. A consequence of this is that our computations predict
+ pressures around 80 GPa at the core mantle boundary, whereas in reality the
+ value is closer to 140 GPa. With a pressure wrong by so much, we can't
+ expect compression heating to be accurate.
+
+ A more realistic model for the gravity vector in the program would take the
+ spatially variable density into account, and that wouldn't actually be
+ terribly complicated: by integrating the PDE for the gravity potential under
+ the assumption that $\rho(\mathbf x)=\rho(r)$, we get
+ @f[
+ \varphi(r) = 4\pi G \int_0^r \frac 1{t^2} \int_0^t s^2 \rho(s) \; ds \; dt,
+ @f]
+ and consequently for the gravity vector
+ @f[
+ \mathbf g = - 4\pi G \frac 1{r^2} \left(
+ \int_0^r s^2 \rho(s) \; ds \right)
+ \frac{\mathbf x}{\|\mathbf x\|}.
+ @f]
+ This expression reduces to the one we use for the case that the density is
+ constant, but a more complete model would, for example, assume that the
+ density varies with the radius (in the simplest case it could be constant in
+ various layers). In either case, it can relatively easily be evaluated if
+ for non-trivial models of $\rho(r)$. Of course, a really complete model
+ would consider that $\rho$ can also vary in the tangential direction, for
+ example in a time dependent way as a consequence of the thermal expansion of
+ rocks as a result of the convection. Taking into account this self
+ gravitational effect of convection would be much harder, however.
</ul>