Skip to content

Nernst Equation is incorrect #63

@nRiccobo

Description

@nRiccobo

While tracking issue #61, I saw a bug in the Nernst Equation in calc_open_circuit_voltage().

The partial pressures inside in the ln() component are backwards.

** See equation 8 of (1).

E = E_rev + (RT/nF) * ln((p_h2) * sqrt(p_o2))

The partial pressures of each gas is calculated by Dalton's Law, in equation 5, 6. p_h2 is the partial pressure of hydrogen and is found with p_cathode and p_h2o_sat because hydrogen exits at the cathode. The partial pressure of oxygen is found with p_anode - p_h2o_sat. The code currently has these two quantities flipped.

To Reproduce
See calc_open_circuit_voltage() in cell.py. Compare General Nernst Equation with equation 8 of the following reference.

(1) Vesa, Ruusskanen et al 2017. PEM Water Electrolyzer model for power hardware-in-the-loop. 10.1016/j.ijhydene.2017.03.046

Electrolyzer Version
0.1.0

System Information (please complete the following information):

  • OS: Mac
  • Python version: 3.8

Metadata

Metadata

Labels

bugSomething isn't workingcleanup

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions