This study introduces a mathematical model for electrolytic chemical reactions, employing an energy variation approach grounded in classical thermodynamics. Our model combines electrostatics and chemical reactions within well-defined energetic and dissipative functionals. Extending the energy variation method to open systems consisting of charge, mass, and energy inputs, this model explores energy transformation from one form to another. Electronic devices and biological channels and transporters are open systems. By applying this generalized approach, we investigate the conversion of an electrical current to a proton flow by cytochrome c oxidase, a vital mitochondrial enzyme contributing to ATP production, the ‘energetic currency of life’. This model shows how the enzyme’s structure directs currents and mass flows governed by energetic and dissipative functionals. The interplay between electron and proton flows, guided by Kirchhoff’s current law within the mitochondrial membrane and the mitochondria itself, determines the function of the systems, where electron flows are converted into proton flows and gradients. This important biological system serves as a practical example of the use of energy variation methods to deal with electrochemical reactions in open systems. We combine chemical reactions and Kirchhoff’s law in a model that is much simpler to implement than a full accounting of all the charges in a chemical system.