Modeling of grain boundary structures and properties in intermetallic compounds