Electrolyzer model

This page sets out the physics the electrolyzer models solve, every symbol and the model quantity it corresponds to, a worked operating point you can check by hand, and how to read a solved schedule back against the equations.

What the unit represents

The unit boundary encloses the electrolyzer stack, the gas-liquid separators on the anode and cathode sides, and the internal electrolyte recirculation loop. Each stream crossing the boundary is therefore single-phase:

Port

Direction

Carries

inlet_water

in

liquid make-up water (or electrolyte)

outlet_cathode_gas

out

cathode product gases, plus undissolved unreacted CO2 on a CO2 electrolyzer

outlet_anode_gas

out

anode product gas (oxygen by default), plus crossover CO2

outlet_liquid

out, optional

electrolyte bleed and any liquid products

inlet_co2

in, CO2 electrolyzer only

CO2 feed

The operator’s lever is the current density \(j[t]\). Using current per unit electrode area keeps the operating range and the cell resistance comparable across stacks of different size. The stack current is \(I[t] = j[t] \, A_{cell}\), and every other quantity (products, power, heat, water use, gas volumes) follows from it through the relations below. With the coefficients fixed and no ohmic loss, every relation is linear in current density, so a schedule optimization over many time points stays a linear program.

Nomenclature

Symbol

Meaning

Units

Type

Model name

\(j[t]\)

current density

A/cm²

decision variable, \(0 \le j \le j_{rated}\)

current_density[t]

\(j_{rated}\)

rated (maximum) current density

A/cm²

config

rated_current_density

\(A_{cell}\)

active electrode area of one cell

cm²

config

electrode_area

\(I[t]\)

stack current, \(j[t] \, A_{cell}\)

A

derived

current[t]

\(N_{cells}\)

cells in series

–

config

n_cells

\(F\)

Faraday constant, 96 485.33

C/mol

constant

–

\(\dot{n}_e[t]\)

electron flow through the stack

mol/s

derived

electron_flow[t]

\(FE_k\)

Faradaic efficiency of product \(k\) (share of charge producing it)

–

fitted parameter

faradaic_efficiency_{k}

\(z_k\)

electrons transferred per mole of product \(k\)

–

product table

electrons

\(\dot{n}_k[t]\)

molar production rate of product \(k\)

mol/s

derived

production_{k}[t]

\(V_{cell}\)

cell voltage before ohmic loss

V

fitted parameter

cell_voltage

\(ASR\)

area-specific cell resistance (ohmic_loss=True only)

Ω·cm²

fitted parameter

area_specific_resistance

\(V_{op}[t]\)

cell voltage including ohmic loss

V

derived

operating_voltage[t]

\(V_{tn}\)

thermoneutral cell voltage

V

config

thermoneutral_voltage

\(f_{BoP}\)

balance-of-plant draw as a fraction of stack power

–

fitted parameter

bop_fraction

\(P_{elec}[t]\)

electrical draw of the whole unit

kW

derived

power_electrical[t]

\(\dot{Q}_{waste}[t]\)

stack heat released above thermoneutral

kW

derived

waste_heat[t]

\(T_{op}, P_{op}\)

separator temperature and pressure

K, Pa

config

operating_temperature, operating_pressure

\(R\)

gas constant, 8.314

J/(mol·K)

constant

–

\(\dot{V}_{cathode}[t], \dot{V}_{anode}[t]\)

gas outlet volumetric flows at \(T_{op}, P_{op}\)

m³/h

derived

outlet_cathode_gas_state.flow_vol_phase[t, ...], outlet_anode_gas_state.flow_vol_phase[t, ...]

\(\nu_{r,k}\)

moles of reactant \(r\) consumed per mole of product \(k\) (negative if produced)

–

product table

reactants[r]

\(\dot{n}_{r,consumed}[t]\)

molar consumption of reactant \(r\)

mol/s

derived

consumption_{r}[t]

\(\dot{V}_{consumed}[t]\)

water consumed by the cell reactions

m³/h

derived

water_consumption[t]

\(\dot{V}_{make\text{-}up}[t]\)

make-up water fed

m³/h

decision variable

inlet_water_state.flow_vol_phase[t, ...]

\(b\)

electrolyte bleed per unit volume of water consumed

–

fitted parameter

bleed_fraction

\(V_{liq}[t]\)

separator liquid inventory

m³

derived, bounded

liquid_volume[t]

\(\Delta t\)

time step

h

time grid

time_block.dt

\(k_m\)

CO2 mass-transfer coefficient, \(D_{CO_2}/\delta_{BL}\) (CO2Electrolyzer only)

m/s

fitted parameter

mass_transfer_coefficient

\(C_{CO_2,bulk}\)

CO2 concentration in the bulk electrolyte (CO2Electrolyzer only)

mol/m³

fitted parameter

co2_bulk_concentration

\(C_{CO_2,local}[t]\)

CO2 concentration at the cathode (CO2Electrolyzer only)

mol/m³

derived

co2_local_concentration[t]

“Fitted parameter” means a fixed value in a schedule optimization that parameter estimation can regress from plant data.

Equations

Electrochemistry

Charge passes through every cell in series, so the electron flow is the stack current times the cell count. Each product takes its Faradaic share of that charge (Faraday’s law):

\[\dot{n}_e[t] = \frac{N_{cells} \, I[t]}{F} \qquad \dot{n}_k[t] = \frac{FE_k \, \dot{n}_e[t]}{z_k}\]

The Faradaic efficiencies of the cathode products sum to at most 1, and so do those of the anode products. Any shortfall is charge lost to reactions that are not modeled.

A cathode product named by balance_product takes no Faradaic efficiency of its own. Its rate is whatever charge the other cathode products leave:

\[z_b \, \dot{n}_b[t] = \dot{n}_e[t] - \sum_{k \ne b} z_k \, \dot{n}_k[t]\]

reported as charge_balance_{b}. This keeps the charge balance closed when the other products’ Faradaic relations are replaced by fitted curves, and \(\dot{n}_b \ge 0\) stops those curves from using more charge than the stack passes. CO2Electrolyzer uses hydrogen evolution as the balance product by default.

Cell voltage and ohmic loss

The ohmic_loss flag sets whether cell resistance enters the operating voltage:

\[\begin{split}V_{op}[t] = \begin{cases} V_{cell} & \texttt{ohmic\_loss=False} \\ V_{cell} + ASR \; j[t] & \texttt{ohmic\_loss=True} \end{cases}\end{split}\]

The ohmic term is resistance loss through the membrane, electrolyte and contacts, and it grows with current density. Because power is voltage times current, ohmic_loss=True makes power quadratic in \(j\). The schedule then needs a nonlinear (or quadratic-capable) solver and solves more slowly, and the model logs a warning when it is enabled. A higher \(ASR\) is also a natural proxy for membrane degradation. It is a fixed parameter for now, which you can update in place as the stack ages.

Power and heat

\[P_{elec}[t] = N_{cells} \, V_{op}[t] \, I[t] \, (1 + f_{BoP}) \qquad \dot{Q}_{waste}[t] = N_{cells} \, I[t] \, (V_{op}[t] - V_{tn})\]

Only the part of the cell voltage above thermoneutral turns into heat, so the ohmic loss ends up as stack heat. At \(V_{op} = V_{tn}\) the stack runs thermally neutral, and below it the stack would absorb heat (a negative \(\dot{Q}_{waste}\)). The balance-of-plant draw (pumps, power electronics, controls) is counted in \(P_{elec}\) but not in the stack heat. Stack voltage efficiency on a higher-heating-value basis is \(V_{tn} / V_{op}\).

Gas outlets

Each gas outlet leaves at the separator temperature and pressure, and its volume follows from the ideal-gas law:

\[\dot{V}_{cathode}[t] = \frac{R \, T_{op}}{P_{op}} \Big(\sum_{k \in \text{cathode gas}} \dot{n}_k[t] + (1 - d) \, \dot{n}_{CO_2,unreacted}[t]\Big) \qquad \dot{V}_{anode}[t] = \frac{R \, T_{op}}{P_{op}} \Big(\sum_{k \in \text{anode}} \dot{n}_k[t] + \dot{n}_{CO_2,crossover}[t]\Big)\]

The CO2 terms are zero on a water electrolyzer.

Water and the separator inventory

Each reactant is consumed in proportion to the production of every product, cathode and anode, that lists it:

\[\dot{n}_{r,consumed}[t] = \sum_k \nu_{r,k} \, \dot{n}_k[t] \qquad \dot{V}_{consumed}[t] = \frac{M_{H_2O}}{\rho_{liq}} \, \dot{n}_{H_2O,consumed}[t]\]

The separators hold a liquid inventory, so make-up water can arrive at a different time from when the stack consumes it:

\[V_{liq}[t] = V_{liq}[t-1] + \Delta t \, \big(\dot{V}_{make\text{-}up}[t] - (1 + b) \, \dot{V}_{consumed}[t]\big)\]
\[V_{liq}[0] = V_{liq,initial} \qquad f_{min} \, V_{sep} \le V_{liq}[t] \le f_{max} \, V_{sep}\]

\(b\) is zero unless the unit has a liquid outlet. With a liquid outlet, that outlet carries the bleed \(b \, \dot{V}_{consumed}[t]\) plus the volume of any liquid products. Liquid products are made and drawn off in the same loop, so they leave without changing the inventory.

Assumptions and limits

  • Linear polarization at most. With ohmic_loss=False, specific energy (kWh per kg of product) does not change with load. ohmic_loss=True adds the ohmic slope but leaves out activation and mass-transport losses. For a full polarization curve, replace power_electrical_relation with a fitted curve (see swap_relation()).

  • Constant Faradaic efficiency. A fitted Faradaic-efficiency curve replaces faradaic_relation_{k} in the same way. The balance product, if one is set, picks up the rest of the charge.

  • Fixed CO2 mass transport. In CO2Electrolyzer, \(k_m\) is a fixed parameter, so the optimizer cannot raise electrolyte flow to raise the transport limit. The electrolyte recirculation pump is counted in \(f_{BoP}\).

  • Fixed temperature and pressure. The separators sit at \(T_{op}, P_{op}\). The model has no thermal dynamics or warm-up, and \(\dot{Q}_{waste}\) is reported but not balanced against a cooling loop.

  • Ideal gas, dry products. Gas volumes ignore water vapour and gas crossover through the membrane, and the model makes no purity calculation.

  • Current can change freely from step to step. The unit itself has no ramp-rate or minimum-load constraint. Degradation is not modeled over the horizon: \(ASR\) is fixed within a solve.

Worked example: PEM water electrolyzer at rated current

WaterElectrolyzer with its PEM defaults: 100 cells of 1000 cm², rated current density 2 A/cm², \(V_{cell} = 1.9\) V, \(V_{tn} = 1.48\) V, no ohmic loss, no balance-of-plant draw, 60 °C and 30 bar, a 15-minute time step. Run at \(j = 2\) A/cm², so \(I = 2000\) A:

Quantity

Hand calculation

Model value

electron flow

\(100 \times 2000 / 96\,485.33\)

electron_flow = 2.0729 mol/s

hydrogen

\(1.0 \times 2.0729 / 2\)

production_H2 = 1.0364 mol/s = 7.52 kg/h

oxygen

\(1.0 \times 2.0729 / 4\)

production_O2 = 0.5182 mol/s = 59.7 kg/h

electrical draw

\(100 \times 1.9 \times 2000 \times 1.0\)

power_electrical = 380 kW

specific energy

\(380 / 7.52\)

50.5 kWh/kg H2

stack heat

\(100 \times 2000 \times (1.9 - 1.48)\)

waste_heat = 84 kW

voltage efficiency (HHV)

\(1.48 / 1.9\)

78 %

water consumed

\(1.0364 \times 18.015 \text{ g/mol}\)

water_consumption = 0.0672 m³/h (8.94 kg per kg H2)

cathode gas volume

\(1.0364 \times 8.314 \times 333.15 / 3\times10^6\)

3.445 m³/h at 60 °C, 30 bar

anode gas volume

half the cathode volume

1.723 m³/h

inventory, one step with no make-up

\(0.5 - 0.25 \times 0.0672\)

liquid_volume 0.500 → 0.4832 m³

As a check, the heat value of the hydrogen (about 39.4 kWh/kg × 7.52 kg/h ≈ 296 kW) plus the stack heat (84 kW) adds back up to the 380 kW drawn.

Reading a solved schedule

In a flexibility study the optimizer picks \(j[t]\) (and the make-up water timing) at every step, usually to shift load into cheaper hours while meeting a production target. Every quantity in the nomenclature table is available at each time point of the solved model. These are the views that answer the usual questions:

Question

Plot against time

Model names

When does the stack run, and how hard?

current density next to the electricity price

current_density[t], tariff

What does it cost to run?

electrical draw

power_electrical[t] (the series sent to costing)

Is the production target met?

hydrogen rate and its running total

production_H2[t], cumulative sum × \(\Delta t\)

How much cooling is needed?

stack heat

waste_heat[t]

Is the water supply shifting in time?

make-up versus consumption, and the inventory against its fill window

inlet_water_state.flow_vol_phase[t, ...], water_consumption[t], liquid_volume[t]

How efficient is each hour?

specific energy

power_electrical[t] / production_H2[t]

With no ohmic loss and constant \(FE\), hydrogen output, power and heat are all proportional to current, so their curves have the same shape and differ only in scale. With ohmic loss or a fitted polarization curve, the specific energy rises at high current density. The optimizer then has a reason to run longer at part load instead of at full current in fewer hours.

A solved model’s values can be collected into a table for plotting:

import pandas as pd
import pyomo.environ as pyo

u = m.unit  # the solved electrolyzer
times = list(m.time_block.time_index)
results = pd.DataFrame(
    {
        "j_A_cm2": [pyo.value(u.current_density[t]) for t in times],
        "power_kW": [pyo.value(u.power_electrical[t]) for t in times],
        "h2_mol_s": [pyo.value(u.production_H2[t]) for t in times],
        "waste_heat_kW": [pyo.value(u.waste_heat[t]) for t in times],
        "liquid_m3": [pyo.value(u.liquid_volume[t]) for t in times],
    },
    index=times,
)
results["h2_kg_h"] = results["h2_mol_s"] * 2.016e-3 * 3600

Products and anode reactions

Each cathode product is an ElectrochemicalProduct. Its reactants map gives the moles of each reactant consumed per mole of product, and a negative entry means the reaction produces that reactant. For example, CO2 → CO + ½ O2 has reactants = {"CO2": 1}, and H2O → H2 + ½ O2 has reactants = {"H2O": 1}. The model builds one consumption_{r} Expression per reactant named in either table; water is always built, since it drives the separator inventory. Gas products leave through the gas outlet on their side and liquid products through the liquid outlet.

The anode reaction is a second product table, anode_products, which follows the same Faraday’s law. The default is oxygen evolution at a Faradaic efficiency of 1. A chlorine anode would instead list Cl2 (\(z = 2\), reactants = {"NaCl": 2}) with an oxygen side reaction, and a hypochlorite anode lists NaClO as a liquid product. Product names must be unique across both tables.

Stoichiometry can be counted per overall reaction or per half-reaction, as long as the sum over both tables is right. The default counts the overall-reaction water on hydrogen, so oxygen consumes none. On a half-reaction basis, an alkaline cell lists 2 H2O per H2 at the cathode and −2 H2O per O2 at the anode, which nets to the same water use while letting a chlorine side reaction at the anode carry its own, different water balance.

Water electrolyzer

WaterElectrolyzer fixes the products to hydrogen at the cathode and oxygen at the anode. Its technology sets the defaults below, and any option given explicitly overrides them:

Technology

\(V_{cell}\)

\(T_{op}\)

\(P_{op}\)

PEM

1.9 V

60 °C

30 bar

AEM

2.0 V

50 °C

35 bar

An AEM stack’s KOH bleed is modeled with has_liquid_outlet and bleed_fraction.

CO2 electrolyzer

CO2Electrolyzer takes a configurable product table (default CO at a Faradaic efficiency of 0.9 plus hydrogen at 0.1, \(V_{cell} = 3.0\) V, 25 °C) and adds a CO2 feed inlet. The cell reactions consume

\[\dot{n}_{CO_2,consumed}[t] = \sum_k \nu_{CO_2,k} \, \dot{n}_k[t]\]

where \(\nu_{CO_2,k}\) is the product’s reactants["CO2"], reported as consumption_CO2[t]. Carbonate formation carries \(c\) (co2_crossover_per_electron) moles of CO2 per mole of electrons to the anode. That is about 0.5 in an alkaline or neutral membrane electrode assembly and about 0 in acid:

\[\dot{n}_{CO_2,crossover}[t] = c \, \dot{n}_e[t]\]

The feed follows from the single-pass conversion \(X\) (single_pass_conversion, consumed plus crossover over fed), and the rest of the feed leaves unreacted:

\[\dot{n}_{CO_2,feed}[t] = \frac{\dot{n}_{CO_2,consumed}[t] + \dot{n}_{CO_2,crossover}[t]}{X} \qquad \dot{n}_{CO_2,unreacted}[t] = \dot{n}_{CO_2,feed}[t] - \dot{n}_{CO_2,consumed}[t] - \dot{n}_{CO_2,crossover}[t]\]

A buffered electrolyte, such as bicarbonate, holds part of the unreacted CO2 in solution. A fraction \(d\) (co2_dissolved_fraction) leaves dissolved in the electrolyte, and the rest leaves with the cathode gas:

\[\dot{n}_{CO_2,dissolved}[t] = d \, \dot{n}_{CO_2,unreacted}[t]\]

co2_dissolved[t] is reported as a molar flow only. The dilute dissolved CO2 does not change the liquid outlet volume, and the outlet carries no speciation. A linearized kinetic model of the aqueous and gas split is planned to replace the fixed fraction.

Mass-transport limit

CO2 reaches the cathode by diffusing across a boundary layer of thickness \(\delta_{BL}\), which electrolyte flow controls. Fick’s law gives the CO2 concentration at the cathode from the CO2 the cells use, both by reduction and by buffering the hydroxide the cathode generates (the carbonate term \(c \, \dot{n}_e\)). This follows eq. 2 of Matthews et al., ACS Catal. 2025, 15, 381:

\[C_{CO_2,local}[t] = C_{CO_2,bulk} - \frac{\dot{n}_{CO_2,consumed}[t] + \dot{n}_{CO_2,crossover}[t]}{k_m \, N_{cells} \, A_{cell}} \qquad k_m = \frac{D_{CO_2}}{\delta_{BL}}\]

Setting mass_transfer_coefficient builds co2_local_concentration[t] and the constraint co2_transport_limit[t], which keeps it non-negative. The constraint is written multiplied through by \(k_m\), so it stays linear if \(k_m\) is regressed:

\[\dot{n}_{CO_2,consumed}[t] + \dot{n}_{CO_2,crossover}[t] \le k_m \, C_{CO_2,bulk} \, N_{cells} \, A_{cell}\]

With \(D_{CO_2} = 1.97 \times 10^{-9}\) m²/s, a flow cell with \(\delta_{BL}\) between 11 and 235 µm has \(k_m\) between roughly \(8 \times 10^{-6}\) and \(2 \times 10^{-4}\) m/s. The default \(C_{CO_2,bulk}\) is 34 mol/m³, CO2-saturated electrolyte at 1 atm and 25 °C. Without mass_transfer_coefficient, the unit has no transport limit.

Selectivity also depends on transport. Faster flow raises CO2 reduction rates at a given potential, while hydrogen evolution barely changes. A fitted faradaic_relation_{k} captures this at the fitted flow, and the balance product absorbs the rest of the charge.

Property packages

Every port is single-phase. The liquid make-up inlet and the liquid outlet share liquid_property_package. Each gas port builds from its own package when one is given (cathode_gas_property_package, anode_gas_property_package, or co2_property_package) and from gas_property_package otherwise, so each gas stream can carry a different gas.

Swappable relations

Each product’s faradaic_relation_{k} and the power_electrical_relation are registered relations, so a fitted Faradaic-efficiency curve or polarization curve replaces them in place (see swap_relation()). The balance product’s charge_balance_{b}, the separator holdup and the CO2 transport limit are conservation laws and are never swapped.