A computational model for intergranular stress corrosion cracking