Eigenstress model for electrochemistry of solid surfaces