Binding energy

I wish to calculate binding energy of grain boundary with solutes. What is the right way to do that.