Learn how to calculate the work function of a surface by your favourite DFT code:
calculating a work function with Quantum Espresso