Theoretical description of heavy impurity transport and its application to the modelling of tungsten in JET and ASDEX upgrade