AlphaPEM is an open-source software package for simulating proton exchange membrane fuel cell (PEMFC) systems for embedded applications written in Julia. It is based on a physics-based, finite-volume, pseudo-two-dimensional (1D+1D), dynamic, two-phase, and non-isothermal model, supporting both co-flow and counter-flow gas channel configurations. 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.
- Installation
- Start
- Major updates
- Work in progress
- Roadmap
- Related publications
- Contributions
- Contact
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 -
Install Julia (using Flexible Julia plugin for PyCharm or using VS Code is suggested):
- for Linux or macOS:
curl -fsSL https://install.julialang.org | sh- for Windows:
winget install --name Julia --id 9NJNWW8PVKMN -e -s msstore
-
Update the package manager, Pkg, to the latest available version:
julia -e 'using Pkg; Pkg.update()' -
Activate the project environment defined by the existing Project.toml file:
export JULIA_PROJECT=@. -
Install the required Julia dependencies:
julia --project=. -e 'using Pkg; Pkg.instantiate()' -
Install the required Python dependencies (temporary: only needed for the GUI and parameter calibration modules, which are not yet converted to Julia):
PYTHON_FOR_PYCALL=$(julia --project=. -e 'using PyCall; print(PyCall.python)') "$PYTHON_FOR_PYCALL" -m pip install numpy matplotlib pygad ttkthemes
AlphaPEM can be integrated into other projects, whether written in Julia or Python.
Install AlphaPEM directly from GitHub using Julia's package manager:
using Pkg
Pkg.add(url="https://github.com/gassraphael/AlphaPEM.git")Then, import the AlphaPEM module in your code:
using AlphaPEMInstall the juliacall bridge library and AlphaPEM:
pip install juliacallThen, call AlphaPEM from Python:
from juliacall import Main as jl
jl.Pkg.add(url="https://github.com/gassraphael/AlphaPEM.git")
jl.seval("using AlphaPEM")This allows you to integrate AlphaPEM into your own applications without cloning the entire repository.
You have two main ways to run AlphaPEM:
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:
julia --project=. src/alphapem/interfaces/GUI.jl
Note: The GUI entrypoint is in Julia, but it still depends on Python packages through
PyCalland is currently broken. Make sure the Python dependencies are installed (see installation step 7). -
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, flow, voltage zone, purge and display 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.
The examples/ directory contains ready-to-run Julia scripts that provide full control over simulations. This is
the recommended entry point for programmers, as it allows using any physically acceptable current density function
and configuration, beyond what the GUI offers.
| Script | Description |
|---|---|
run_step.jl |
Simulates a step current density |
run_polarization.jl |
Generates a polarization curve |
run_polarization_for_cali.jl |
Generates polarization curves for calibration purposes |
run_EIS.jl |
Generates an EIS curve (currently broken, work in progress) |
plot_currents.jl |
Plots the current density profiles |
benchmark_step.jl |
Benchmarks the step simulation |
profile_step.jl |
Profiles the step simulation |
The following steps are configuration choices to make inside the example script you select in
examples/.
-
Choose an example script in
examples/according to your objective (run_step.jl,run_polarization.jl,run_EIS.jl, etc.). -
Open this script and edit its configuration blocks (
current_params = ...andcfg = SimulationConfig(...)). -
Set the fuel cell and model options in this script via
SimulationConfig:Field Allowed values type_fuel_cellFuel cell model symbol implemented in src/alphapem/fuelcell/(e.g.,:ZSW_GenStack,:EH31,:default)type_currentStepParams(...),PolarizationParams(...),EISParams(...)voltage_zone:before_voltage_drop,:fulltype_auxiliary:no_auxiliary,:forced_convective_cathode_with_anodic_recirculation,:forced_convective_cathode_with_flow_through_anodetype_purge:no_purge,:constant_purge,:periodic_purgetype_display:synthetic,:multiple,:no_displaydisplay_timing:postrun,:live -
Run the edited script to generate results (internal states and voltage dynamics) in the
/resultsdirectory:julia --project=. examples/run_step.jl
To adapt AlphaPEM to a new, specific fuel cell, you must calibrate the undetermined physical parameters (e.g., GDL porosity) using experimental polarization curves. The calibration relies on a genetic algorithm (PyGAD) and is computationally intensive — running it on a computing cluster is strongly recommended.
⚠️ The calibration entrypoint is in Julia, but it still depends on Python packages throughPyCall. It is also currently broken.
-
Input experimental data: place at least three experimental polarization curves into your fuel cell description in
src/alphapem/fuelcell. -
Configure parameters: set the operating conditions and accessible physical parameters of your fuel cell system in
src/alphapem/parametrisation/calibration_modules.jl. -
Run the calibration:
julia --project=. src/alphapem/parametrisation/calibration.jl
- V2.0 - under construction - This version of AlphaPEM includes:
- the transition from the original programming language to Julia, leveraging its high execution speed while maintaining a high-level language framework.
- the abandonment of dictionary usage in favor of increased reliance on object-oriented programming.
- the redesign of the AlphaPEM architecture so that the code is closer to industry standards.
- a progressive migration process:
interfaces(GUI) andparametrisation(calibration) are not yet fully converted to Julia and still rely on Python. -
run_EIS.jlis currently broken (work in progress).
-
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 limiting liquid water saturation coefficient (
- 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.
- 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.
- 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.
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 coefficient is proposed to establish a physical relationship between the voltage drop at high currents, the quantity of liquid water in the cell, and operating conditions.

-
A Critical Review of Proton Exchange Membrane Fuel Cells Matter Transports and Voltage Polarisation for Modelling (2024, 1st author)
- In the Journal of the Electrochemical Society or in HAL (postprint).
- The aim of this work was to compile, within a single article, all the equations required for the physical modeling of a fuel cell. Each equation is complemented with explanations, critical analysis, and suggestions for potential enhancements.
-
-
Thesis manuscript:
- Advanced physical modeling of PEM fuel cells to enhance their performances (2024, 1st author)
- In HAL (final version).
- The objective of this thesis was to develop an advanced model for PEMFCs to optimize their control and improve performance. A 1D, dynamic, two-phase, isothermal model was proposed, leading to the development of the open-source software AlphaPEM, which enables accurate simulations and facilitates predictive control strategies for enhanced fuel cell operation.
- Advanced physical modeling of PEM fuel cells to enhance their performances (2024, 1st author)
-
AlphaPEM is firstly developed by Raphaël Gass during his PhD thesis in control engineering at the LIS Laboratory in Aix-Marseille University, and in co-supervision with FEMTO-ST Institute, within the FCLab, in Franche-Comté University, from 2021 to 2024. This work has been supervised by Prof. Zhongliang Li (FEMTO-ST), Prof. Rachid Outbib (LIS), Prof. Samir Jemei (FEMTO-ST) and Prof. Daniel Hissel (FEMTO-ST).
-
The development of AlphaPEM was subsequently continued by Raphaël Gass during his postdoctoral research from 2025 to 2027 at ENERGY-Lab, University of Reunion island, in partnership with the ZSW Institute in Ulm, Germany. This work was supervised by Prof. Michel Benne (ENERGY-Lab), Associate Prof. Cédric Damour (ENERGY-Lab), Associate Prof. Dominique Grondin (ENERGY-Lab), and Dr. Florian Wilhelm (ZSW).
This work has been supported:
- from 2021 to 2024 by French National Research Agency via project DEAL (Grant no. ANR-20-CE05-0016-01), the Region Provence-Alpes-Côte d’Azur, the EIPHI Graduate School (contract ANR-17-EURE-0002) and the Region Bourgogne Franche-Comté.
- from 2025 to 2027 by European FEDER funds via project OPUS-H2 and the Region Reunion.
AlphaPEM is licensed under the GNU GPL 3.0. See the LICENSE file for more details.
It also includes components licensed under the BSD-3-Clause license:
- calibration/parameter_calibration.py from PyGAD.
Contributions from the community are welcome! If you would like to contribute to AlphaPEM, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -am 'Add some feature'). - Push to the branch (
git push origin feature/YourFeature). - Create a new Pull Request.
For any questions or support, please contact me at gassraphael@proton.me.
Thank you for using AlphaPEM!
