Simulation of metals and alloys using quasi-harmonic lattice dynamics