A general dynamic model for multiphase electrolytic systems