Efficient Thermal Modelling and Topology Optimization for Additive Manufacturing