Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
81b99f9
added updated degradation calcs
ZackTully Jan 25, 2023
8b39392
New degradation rates
ZackTully Feb 7, 2023
12f7860
updated test for new deg calcs
ZackTully Feb 10, 2023
ec863f5
updat pre-commit yaml
ZackTully Feb 10, 2023
f1c61b7
remove whitespace
ZackTully Feb 10, 2023
29e8928
Merge pull request #1 from ZackTully/fix/deg_rates
ZackTully Feb 11, 2023
6c9b16e
update test_regression
ZackTully Feb 15, 2023
3a1b668
fix test_regression
ZackTully Feb 15, 2023
8642ff4
fix test_regression
ZackTully Feb 15, 2023
491355a
troubleshooting tests
ZackTully Feb 15, 2023
ae62555
test_regression total h2 4 decimals
ZackTully Feb 15, 2023
c51f876
Merge branch 'develop' into fix/deg_rates
ZackTully Feb 15, 2023
761168e
Update test_run_electrolyzer.py
ZackTully Feb 15, 2023
916554a
Merge branch 'NREL:develop' into develop
ZackTully Feb 16, 2023
76f6e74
Merge pull request #2 from ZackTully/fix/deg_rates
ZackTully Feb 16, 2023
441b3b4
Merge pull request #3 from NREL/develop
ZackTully Feb 19, 2023
cb5a103
Merge branch 'NREL:develop' into develop
ZackTully Feb 22, 2023
b91c246
Added example #6, conversion efficiency
nRiccobo Apr 26, 2023
add505e
changed formatting for tests
elenya-grant May 17, 2023
b36e4dc
reformatted for cleaned up deg rates
elenya-grant May 17, 2023
b3d43ba
Merge branch 'develop' into develop
nRiccobo May 18, 2023
77ef9ee
delete duplicate example
ZackTully May 22, 2023
0e38f87
small formatting changes
ZackTully May 22, 2023
7c917cb
WIP adjust modeling schema for alkaline cells
ZackTully May 22, 2023
224535f
Bump isort version for pre-commit bugfix (#60)
camirmas Jun 12, 2023
daa7f94
alkaline example formatting
ZackTully Jul 9, 2023
7baf194
update test validation
ZackTully Jul 9, 2023
550e98c
update test_validation.py
ZackTully Jul 9, 2023
135aa34
Merge branch 'develop' into develop
nRiccobo Aug 2, 2023
b63d726
Merge pull request #52 from nRiccobo/develop
nRiccobo Aug 2, 2023
2aaf03a
updating test_run_electrolyzer with new modeling schema
ZackTully Aug 2, 2023
87dfcd1
fit_params difference
ZackTully Aug 3, 2023
8bbf71c
save for power_to_current debug
ZackTully Aug 3, 2023
cd4417c
troubleshooting before test_run_lcoh.py
ZackTully Aug 3, 2023
ccd7071
test_optimization new schema
ZackTully Aug 7, 2023
c189360
tidying up a bit
ZackTully Aug 7, 2023
89b5017
controller example debugging
ZackTully Aug 7, 2023
18a3e0f
changed modeling schema interface in test_optimization
ZackTully Aug 7, 2023
77b8248
removing unnecessary comment blocks and unused files
ZackTully Aug 8, 2023
4167add
updating examples for new schema
ZackTully Aug 8, 2023
37dfe92
Issue #61: Update Cathod Pressure to be 30bar
nRiccobo Aug 9, 2023
5489636
Had to update LCOH test because of changes to cell voltage. Life Tota…
nRiccobo Aug 18, 2023
dc98d55
add generic citation file
ZackTully Sep 19, 2023
13c52f8
Merge pull request #66 from nRiccobo/update/p_cathode
nRiccobo Sep 20, 2023
19285fe
delete unneeded comments
ZackTully Oct 18, 2023
e3b9e88
Merge remote-tracking branch 'origin/develop' into esg/alkaline
ZackTully Oct 18, 2023
f059e62
Merge remote-tracking branch 'origin/develop' into esg/alkaline
bayc Oct 18, 2023
5dece7c
resolve merge conflicts
ZackTully Oct 18, 2023
0830110
resolve merge conflicts
ZackTully Oct 18, 2023
474c21f
Updated dryer loss to 0.2%. Test stack lowered the kWh/kg. Test run_e…
nRiccobo Dec 7, 2023
3b1e6fb
Test lcoh results in a lower lcoh.
nRiccobo Dec 7, 2023
5338ccf
Updated membrane thickness in calc_ohmic_overpot. 20 microns is close…
nRiccobo Dec 7, 2023
b0718d3
Updated test stack and fit params. Needed to update example_01 by add…
nRiccobo Dec 7, 2023
a3098f7
Updated run_electrolyzer test. Hydrogen output increased
nRiccobo Dec 7, 2023
3cc0deb
Updated run_lcoh test. Results show a lower lcoh
nRiccobo Dec 7, 2023
9d6b62a
Merge pull request #72 from nRiccobo/develop
bayc Dec 20, 2023
35c93ad
Merge branch 'esg/alkaline' of https://github.com/ZackTully/electroly…
bayc Jan 26, 2024
4150924
Merge remote-tracking branch 'origin/develop' into esg/alkaline
bayc Jan 26, 2024
847058a
updating reg test value after changes from merge
bayc Jan 26, 2024
5ed2cbd
changed PEM_Cell class to PEMCell
bayc Jan 26, 2024
fb611dc
updating relative imports to explicit
bayc Jan 26, 2024
ca5eea2
updating Alkaline_Cell class to AlkalineCell
bayc Jan 26, 2024
d3a171a
adding typing for stack.cell
bayc Jan 26, 2024
8d7e659
fixing linting
bayc Jan 26, 2024
6f0acf5
removing commented code
bayc Jan 26, 2024
155f39c
Add alkaline electrolyzer model (#62)
bayc Jan 26, 2024
e913ad8
WIP: Reformatting repo into BERT structure
johnjasa Feb 3, 2025
9d7004f
updated all py file import paths
elenya-grant Feb 3, 2025
9459bcd
updated jupyter notebook import paths
elenya-grant Feb 3, 2025
b4e83fa
updated pre-commit config
elenya-grant Feb 10, 2025
583eb36
Merge pull request #79 from elenya-grant/dev/bert_reorg
johnjasa Feb 19, 2025
319dae9
Prep for release (#82)
johnjasa Mar 18, 2025
638d890
Update pyproject.toml
johnjasa Mar 19, 2025
0d88b3a
Feature/bert basic (#81)
elenya-grant Sep 24, 2025
83caad7
Adding readme
johnjasa Nov 7, 2025
09d301c
Merging
johnjasa Nov 7, 2025
085f969
Merge branch 'main' of https://github.com/NREL/electrolyzer into HEAD
johnjasa Feb 19, 2026
0b12ba9
Added to readme, bumped min python version and CI versions (#85)
johnjasa Feb 19, 2026
d211998
Remove contributing, citation, and license sections
johnjasa Feb 19, 2026
9252ed7
Bumping version
johnjasa Feb 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/workflows/black.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
Expand Down
148 changes: 125 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,139 @@
============
Electrolyzer
============
# Electrolyzer

[![CI Status](https://github.com/NREL/electrolyzer/actions/workflows/ci.yml/badge.svg)](https://github.com/NREL/electrolyzer/actions/workflows/ci.yml)
[![Lint](https://github.com/NREL/electrolyzer/actions/workflows/black.yml/badge.svg)](https://github.com/NREL/electrolyzer/actions/workflows/black.yml)

.. image:: https://github.com/NREL/electrolyzer/actions/workflows/ci.yml/badge.svg
:target: https://github.com/NREL/electrolyzer/actions/workflows/ci.yml
:alt: CI Status
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.

.. image:: https://github.com/NREL/electrolyzer/actions/workflows/black.yml/badge.svg
:target: https://github.com/NREL/electrolyzer/actions/workflows/black.yml
:alt: Lint
## What this repo provides

Electrolyzer contains performance and cost modeling of H2 production.
- 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

* Free software: Apache Software License 2.0
- Core simulation: [electrolyzer/simulation](electrolyzer/simulation)
- Cell models: [electrolyzer/simulation/cell_models](electrolyzer/simulation/cell_models)
- Validation/schema: [electrolyzer/tools/validation.py](electrolyzer/tools/validation.py), [electrolyzer/tools/modeling_schema.yaml](electrolyzer/tools/modeling_schema.yaml)
- LCOH analysis: [electrolyzer/tools/analysis](electrolyzer/tools/analysis)
- Examples: [examples](examples)
- Documentation: [docs](docs)

Quick Installation
------------
## Installation

``pip install git+https://github.com/NREL/electrolyzer.git``
Python 3.11+ is required.

For further installation instructions, see the `installing.md` file in the docs folder.
```bash
pip install .
```

Features
--------
Optional extras:

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

Credits
-------
More detail is in [docs/installing.md](docs/installing.md).

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
## Quick start

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
Run a simulation from a YAML configuration and a power signal:

```python
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:

```python
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.

- Schema: [electrolyzer/tools/modeling_schema.yaml](electrolyzer/tools/modeling_schema.yaml)
- Example PEM configuration: [examples/example_02_electrolyzer/modeling_options.yaml](examples/example_02_electrolyzer/modeling_options.yaml)
- Example alkaline configuration: [examples/example_06_alkaline/default_alkaline.yaml](examples/example_06_alkaline/default_alkaline.yaml)

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](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

- Basic simulation: [examples/example_02_electrolyzer/example_run.py](examples/example_02_electrolyzer/example_run.py)
- Polarization curve fitting: [examples/example_01_polarization/example_run.py](examples/example_01_polarization/example_run.py)
- Controller behavior: [examples/example_05_controller/example_05_controller_options.py](examples/example_05_controller/example_05_controller_options.py)
- Alkaline configuration: [examples/example_06_alkaline/alkaline_example_run.py](examples/example_06_alkaline/alkaline_example_run.py)
- LCOH calculation: [examples/example_04_lcoh/cost_example_run.py](examples/example_04_lcoh/cost_example_run.py)

## Documentation

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

## Testing

```bash
pytest
```
4 changes: 2 additions & 2 deletions docs/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ For most use cases, installing from source will be the preferred installation ro
cd electrolyzer
```

3. Create a new virtual environment and change to it. Using Conda Python 3.11 (choose your favorite
3. Create a new virtual environment and change to it. Using Conda Python 3.13 (choose your favorite
supported version) and naming it 'electrolyzer_env' (choose your desired name):

```bash
conda create --name electrolyzer_env python=3.11 -y
conda create --name electrolyzer_env python=3.13 -y
conda activate electrolyzer_env
```

Expand Down
4 changes: 2 additions & 2 deletions docs/intro.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Welcome to the Electrolyzer Documentation

This repo contains electrolyzer models for use in techno-economic analysis of hydrogen production systems.
The models are designed to be used in conjunction with the [HOPP](https://github.com/NREL/HOPP) and [H2Integrate (formerly GreenHEART)](https://github.com/NREL/greenheart) models developed by the National Renewable Energy Laboratory (NREL).
This repo contains electrolyzer models for use in technoeconomic analysis of hydrogen production systems.
The models are designed to be used in conjunction with the [H2Integrate](https://github.com/NatLabRockies/H2Integrate) tools developed by the National Laboratory of the Rockies.

```{tableofcontents}
```
2 changes: 1 addition & 1 deletion electrolyzer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

__author__ = """Christopher Bay"""
__email__ = "christopher.bay@nrel.gov"
__version__ = "0.1.0"
__version__ = "0.1.1"

# noqa
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ build-backend = "setuptools.build_meta"
[project]
name = "electrolyzer"
dynamic = ["version"]
authors = [{name = "NREL", email = "christopher.bay@nrel.gov"}]
authors = [{name = "NLR", email = "christopher.bay@nlr.gov"}]
readme = {file = "README.md", content-type = "text/markdown"}
description = "A controls-oriented engineering electrolyzer model."
requires-python = ">=3.9, <3.12"
requires-python = ">=3.11"
license = {file = "LICENSE"}
dependencies = [
"numpy",
Expand All @@ -32,9 +32,9 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]

[project.optional-dependencies]
Expand Down