Mathematics for the fluid Earth