A lattice simulation investigation of the migration of chloride ions in doped polypyrrole and polythiophene