A numerical model of crevice corrosion for passive and active metals