AlphaPEM
AlphaPEM is an open-source software package for simulating proton exchange membrane fuel cell (PEMFC) systems using physics-based models for embedded applications.
Install / Use
/learn @gassraphael/AlphaPEMREADME
AlphaPEM
AlphaPEM is an open-source software package for simulating proton exchange membrane fuel cell (PEMFC) systems for embedded applications. It is based on a physics-based, finite-volume, pseudo-two-dimensional (1D+1D), dynamic, two-phase, and non-isothermal model. It quickly simulates the internal states and voltage dynamics of PEMFC systems for all current densities and operating conditions imposed on it. In particular, it is possible to apply a step current density or use current profiles to generate polarization curves or electrochemical impedance spectroscopy (EIS) curves. It can also automatically calibrate the undetermined parameters of the model to simulate a given real fuel cell system.
A detailed presentation of this program has been published in the peer-reviewed journal SoftwareX (limited to version V1.0). Furthermore, comprehensive documentation in Numpy style for the software functions is available.
Improvements to AlphaPEM are discussed in the roadmap section.
Important note: AlphaPEM is an ongoing research project and is not a commercial product. Therefore, the latest online version may contain bugs, and not all features may be available. The current work is detailled in the work in progress section. Relatively stable versions are listed in the Major updates section.

Table of Contents
- Installation
- Start
- Major updates
- Work in progress
- Roadmap
- Related publications
- Contributions
- Contact
Installation
Installation from source (to develop AlphaPEM locally)
To install AlphaPEM, follow these steps in a shell:
-
Clone the repository:
git clone https://github.com/gassraphael/AlphaPEM.git -
Navigate to the project directory:
cd AlphaPEM -
Update the Python package manager, pip, to the latest available version:
pip install --upgrade pip -
Create a new environment, referred to here as env, and activate it:
python3 -m venv env source env/bin/activate -
Install the required dependencies:
python3 -m pip install -r requirements.txt
Installation via pip (to use AlphaPEM in other projects)
To use AlphaPEM as a library in other projects, you can install it directly from GitHub using pip:
pip install alphapem @ git+https://github.com/gassraphael/AlphaPEM.git
Then, import the AlphaPEM class in your Python code:
from alphapem import AlphaPEM
This allows you to export and integrate the AlphaPEM package into your own applications without cloning the entire repository.
Start
You have two main ways to run AlphaPEM:
Using the graphical user interface (GUI)
The GUI provides a quick way to configure and run simulations without modifying the source code. However, it does not yet grant access to all the functionalities of the code.
-
Execute the GUI file:
python3 src/alphapem/interfaces/GUI.py -
In the GUI (as shown in the figure of AlphaPEM section):
-
Select a predefined fuel cell specification from the 'Fuel cell' dropdown menu. Operating conditions and parameters can also be adjusted by selecting 'Enter your specifications' in this menu.
-
Choose the configuration you prefer for the auxiliaries, voltage zone, purge, display and plot under 'Model configuration'.
-
Select your desired simulation type at the bottom of the GUI (e.g., current density step, polarization curve, or EIS curve).
-
-
Run the simulation to generate results (internal states and voltage dynamics) in the /results directory.
Using the command line (programmers)
The main.py file is used for standard operation and provides full control for programmers. This allows for using any physically acceptable current density function, beyond the predefined configurations of the GUI.
-
Modify parameters and input current densities directly in the appropriate configuration files (e.g., src/alphapem/config/parameters.py or src/alphapem/config/current_densities.py) if needed.
-
Select a predefined fuel cell specification, a given configuration and the desired simulation directly at the beginning of the src/alphapem/application/run_simulation.py file.
-
Execute the main file to generate results (internal states and voltage dynamics) in the /results directory:
python3 src/alphapem/application/run_simulation.py
-
Automated parameter calibration (advanced)
To adapt AlphaPEM to a new, specific fuel cell, you must calibrate the undetermined physical parameters (like GDL porosity) using experimental data. This functionality is not yet available from the GUI. The calibration uses a genetic algorithm (PyGAD) to match simulated results to experimental data.
-
Input Experimental Data: place experimental polarization curves (at least three) into the file: src/alphapem/config/pola_exp_values.
-
Configure Parameters: input the operating conditions and accessible physical parameters of your fuel cell system in: src/alphapem/parametrisation/calibration_modules.
-
Run Calibration: execute the calibration program (preferably on a computing cluster due to computational cost):
python3 src/alphapem/parametrisation/calibration.py -
Major updates
- V1.4 - under construction - This version of AlphaPEM includes:
- the redesign of the AlphaPEM architecture so that the code is closer to industry standards.
- V1.3 - 2026.02.16 - This version of AlphaPEM includes:
- the addition of O2 flow to Pt particules which improves the modeling of overvoltage due to flooding at high curent densities.
- the limiting liquid water saturation coefficient ($s_{lim}$) has been definitively removed, as this model replaces it.
- the addition of liquid water flow inside the GC (with the sorption flow at the GDL/GC interface).
- the spatial extension to 1D+1D (except thermal evolution which remains 1D for now).
- the addition of O2 flow to Pt particules which improves the modeling of overvoltage due to flooding at high curent densities.
- V1.2 - 2025.12.11 - This version of AlphaPEM includes:
- the addition of convective flow between the inlet, gas channels, and outlet of the cell, thereby removing the Pukrushpan equations (from Michigan University).
- auxiliaries are temporarily removed, as they require reconstruction.
- the addition of the MPL to the simulated cell, in both the anode and cathode.
- effective diffusive flows for the dissolved water insided the CLs are introduced.
- the addition of the open-source ZSW GenStack as a calibrated fuel cell case study.
- the addition of convective flow between the inlet, gas channels, and outlet of the cell, thereby removing the Pukrushpan equations (from Michigan University).
- V1.1 - 2025.08.18 - This version of AlphaPEM includes:
- the addition of heat transfer to the program, in cooperation with Pedro Affonso Nobrega (PERSEE, MINES PSL).
- an improvement of the initial variable values: the algorithm waits for a given time to reach equilibrium, and then the experiment starts (step/pola/EIS).
- the limiting liquid water saturation coefficient ($s_{lim}$) is temporarily removed for future refinement.
- V1.0 - 2024.09.05 - This version of AlphaPEM corresponds to the one developed during Raphaël Gass's PhD from 2021 to 2024.
- It is based on a physics-based, one-dimensional (1D), dynamic, two-phase, and isothermal model.
Work in progress
- Sensitivity analysis and calibration of the model using pre-selected data from ZSW-GenStack or EH-31 is currently underway.
- Auxiliaries are temporarily removed, as they require reconstruction.
Roadmap
- Spatial extension to 1D+1D for modeling the thermal evolution.
- Spatial extension to 1D+1D+1D: a 1D channel will be added to each manifold, enabling full-stack modeling.
- Integration of more accurate physical models for the auxiliaries.
- Inclusion of ECSA degradation in the simulation framework.
- Enhancement of the GUI to allow seamless addition of new fuel cell configurations without modifying the source code.
Related publications
The detailed model description and simulation results can be found in the following articles and thesis.
- Published journal papers:
-
AlphaPEM: An Open-Source Dynamic 1D Physics-Based Pem Fuel Cell Model for Embedded Applications (2025, 1st author)
-
An Advanced 1D Physics-Based Model for PEM Hydrogen Fuel Cells With Enhanced Overvoltage Prediction (2025, 1st author)
- In the International Journal of Hydrogen Energy, in arXiv, in HAL or in SSRN (postprint).
- The aim of this study was to introduce the dynamic 1D model developed during 2021-2024, emphasizing the adjustment of the equations for this specific model and their numerical resolution. Furthermore, a novel coef
-
Related Skills
node-connect
341.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.6kCommit, push, and open a PR
