For a given concentration level of doping, it may correspond to too many possible atomic configurations, especially for the case with inhomogenous distribution of dopant. Therefore it is difficult to figure out which one is the possible one in the simulation. That is to say, one cannot simulate the case with a given concentration level of doping in a straightforward manner. The crude approximation is to consider the homogenous distribution of dopant.
For a metal, its work function can be computed via ab-inito calculation.