Suppose that I have crystalline system made of 2 species, let say A and B (e.g. NaCl). I've built a supercell and I want to substitute individual element C in place of A or B (only one atom at a time, in different sites of A or B). How to calculate the most stable (in terms of energy) substitution site (or how to compare energies of different substitutions)?
This is not so obvious because elements A and B give different contribution to total energy, so when I substitute element C in place of A or B, I will get different energies and their simple comparison is wrong idea.