Sovereign 8s.is mirror of standardgalactic/electrolyzer
  • Python 98.7%
  • Makefile 1.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hammond, Rob e91e919821
Some checks failed
Testing / build (3.11) (push) Has been cancelled
Testing / build (3.12) (push) Has been cancelled
Testing / build (3.13) (push) Has been cancelled
Test Documentation Build / build (push) Has been cancelled
put pypi workflows in correct location
2026-02-27 09:20:17 -08:00
.github put pypi workflows in correct location 2026-02-27 09:20:17 -08:00
docs Added to readme, bumped min python version and CI versions (#85) 2026-02-18 19:49:26 -07:00
electrolyzer bump version 2026-02-27 09:18:43 -08:00
examples Develop -> Main (v0.1.1) (#67) 2025-11-07 14:30:28 -07:00
tests Develop -> Main (v0.1.1) (#67) 2025-11-07 14:30:28 -07:00
.editorconfig Initial skeleton. 2022-10-19 13:46:16 -06:00
.gitignore Initial skeleton. 2022-10-19 13:46:16 -06:00
.pre-commit-config.yaml Develop -> Main (v0.1.1) (#67) 2025-11-07 14:30:28 -07:00
AUTHORS.rst Initial skeleton. 2022-10-19 13:46:16 -06:00
CITATION.cff Develop -> Main (v0.1.1) (#67) 2025-11-07 14:30:28 -07:00
CONTRIBUTING.rst add release note for updated process 2026-02-26 13:01:18 -08:00
HISTORY.rst Initial skeleton. 2022-10-19 13:46:16 -06:00
LICENSE Initial skeleton. 2022-10-19 13:46:16 -06:00
Makefile Initial skeleton. 2022-10-19 13:46:16 -06:00
MANIFEST.in Initial skeleton. 2022-10-19 13:46:16 -06:00
pyproject.toml add missing bump2version dependency 2026-02-26 13:06:28 -08:00
README.md Remove contributing, citation, and license sections 2026-02-18 19:50:51 -07:00

Electrolyzer

CI Status Lint

Electrolyzer is a controls-oriented engineering model for hydrogen production systems. It simulates multi-stack electrolyzer operation, supports PEM and alkaline cell models, tracks degradation, and includes levelized cost of hydrogen (LCOH) analysis utilities.

What this repo provides

  • Time-series simulation of one or more stacks with supervisory control logic.
  • PEM and alkaline electrochemical cell models with polarization curve fitting.
  • Degradation tracking (steady, fatigue, and on/off cycling) with optional penalty modes.
  • Cost and LCOH analysis tools tied to simulation outputs.
  • YAML-based modeling configuration with a JSON schema for validation and defaults.

Project structure

Installation

Python 3.11+ is required.

pip install .

Optional extras:

pip install ".[examples]"   # notebooks + example dependencies
pip install -e ".[develop]"  # dev + docs tooling
pip install -e ".[all]"      # everything

More detail is in docs/installing.md.

Quick start

Run a simulation from a YAML configuration and a power signal:

import numpy as np

from electrolyzer.simulation.bert import run_electrolyzer

power_signal = np.ones(3600) * 1e6  # 1 MW for 1 hour, in Watts
elec_sys, results = run_electrolyzer("examples/example_02_electrolyzer/modeling_options.yaml", power_signal)

print(results.head())

Compute LCOH using the same signal:

import numpy as np

from electrolyzer.tools.analysis.run_lcoh import run_lcoh

power_signal = np.ones(3600) * 1e6
lcoe = 0.04418  # $/kWh

lcoh_breakdown, lcoh_value = run_lcoh(
    "examples/example_04_lcoh/cost_modeling_options.yaml",
    power_signal,
    lcoe,
)

print(lcoh_value)

Modeling configuration

Models are configured with YAML files validated against a JSON schema. The schema defines defaults and accepted ranges for parameters like stack rating, cell geometry, degradation rates, and control policy settings.

Key configuration blocks:

  • electrolyzer.supervisor: system rating and number of stacks.
  • electrolyzer.controller: control strategy and decision policy flags.
  • electrolyzer.stack: stack sizing, cell type, and operational settings.
  • electrolyzer.degradation: degradation rates and end-of-life parameters.
  • electrolyzer.cell_params: PEM or alkaline cell model parameters.
  • electrolyzer.costs: LCOH input data for capex, opex, feedstock, and finance.

Control strategies

The supervisor supports multiple control modes for stack scheduling and power distribution:

  • PowerSharingRotation, SequentialRotation
  • EvenSplitEagerDeg, EvenSplitHesitantDeg
  • SequentialEvenWearDeg, SequentialSingleWearDeg
  • BaselineDeg
  • DecisionControl (composed from policy flags in the YAML)

See electrolyzer/simulation/supervisor.py for logic.

Degradation modeling

Each stack tracks voltage degradation from steady operation, fatigue, and on/off cycling. You can choose whether degradation penalizes hydrogen production or increases power draw. The end-of-life voltage delta drives replacement calculations in the LCOH workflow.

Outputs

run_electrolyzer returns a supervisor object and a pandas.DataFrame of time-series results. The frame includes overall power and curtailment plus per-stack columns for degradation, cycles, uptime, hydrogen production rate, and current density.

Examples

Documentation

Docs are in docs. The landing page is docs/intro.md. If you build the Jupyter Book locally, the generated site lands in docs/_build/html.

Testing

pytest