Skip to content

gassraphael/AlphaPEM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

427 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AlphaPEM

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. It is likely that a more recent version exists but has not yet been publicly released, pending scientific publication. If you wish to collaborate with us, please contact us by email so that we may potentially share these latest advancements.

AlphaPEM web-based interface

Table of Contents

Repository structure

The repository is organized around a Julia package in src/, example scripts in examples/, and supporting documentation, tests, and generated results. The main folders are:

├── docs                    # User documentation
├── examples                # Ready-to-run Julia scripts for step, polarization, EIS
├── results                 # Output directory for generated simulation results and reference benchmark outputs
├── scripts                 # Helper shell scripts for local execution or cluster workflows
├── src                     # Julia source code for AlphaPEM
│   └── alphapem
│       ├── application     # High-level simulation entry points and orchestration
│       ├── config          # Simulation and fuel-cell configuration types and parameter definitions
│       ├── core            # Core physical models (balances, equations, transport, heat)
│       │   ├── models      # Physical submodels assembled during the solve
│       │   ├── modules     # Physics blocks separated from the models repository for improved comprehensibility
│       │   └── types       # Shared structs and type definitions across the codebase
│       ├── currents        # Current profile definitions (step, polarization, EIS)
│       ├── fuelcell        # Predefined fuel-cell models and cell-specific data
│       ├── interfaces      # GUI entry point and user-facing interfaces
│       ├── parametrisation # Parameter calibration and identification routines
│       └── utils           # Shared utility functions
├── tests                   # Benchmark and profiling scripts used for validation and performance checks
├── Manifest.toml           # Locked dependency versions for reproducible environments
├── Project.toml            # Julia package definition and dependencies
└── README.md               # Project overview, installation, and usage guide

The most relevant entry points are:

  • examples/run_step.jl for a step-current simulation.
  • examples/run_polarization.jl for a polarization curve.
  • examples/run_EIS.jl for impedance simulations.
  • src/alphapem/interfaces/GUI.jl for the graphical user interface (currently work in progress).
  • src/alphapem/parametrisation/calibration.jl for parameter calibration (currently work in progress).

Installation

Installation from source (to develop AlphaPEM locally)

To install AlphaPEM, follow these steps in a shell:

  1. Clone and navigate:

    git clone https://github.com/gassraphael/AlphaPEM.git && cd AlphaPEM
  2. Install Julia: (using Flexible Julia for PyCharm or VS Code is recommended)

    • Linux/macOS: curl -fsSL https://install.julialang.org | sh
    • Windows: winget install Julia -s msstore
  3. Instantiate the project:

    julia --project=. -e 'using Pkg; Pkg.instantiate()'

Installation as a package (to use AlphaPEM in other projects)

AlphaPEM can be integrated into other projects, whether written in Julia or Python.

From a Julia project

using Pkg; Pkg.add(url="https://github.com/gassraphael/AlphaPEM.git")
using AlphaPEM

From a Python project

pip install juliacall
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.

Start

You have two main ways to run AlphaPEM:

Using the web-based interface (V2.0+)

AlphaPEM now includes a modern, web-based graphical interface built entirely in Julia. The interface is accessible through your local browser and requires no dependencies other than Julia.

To launch the simulator:

julia --project=. run_web_app.jl

The simulator will:

  1. Start a local web server on http://localhost:8000
  2. Automatically open the interface in your default browser
  3. Allow you to configure and run simulations

Using the interface:

  1. Home Page: Overview of AlphaPEM capabilities
  2. Simulator Tab:
    • Select or configure a fuel cell model
    • Set operating conditions (temperature, pressure, stoichiometry, humidity)
    • Configure accessible physical parameters (dimensions, volumes)
    • Adjust undetermined parameters (porosity, thickness, etc.)
    • Set model configuration (auxiliaries, voltage zone, purge, display)
    • Choose computing parameters (solver tolerances, mesh nodes)
  3. Simulation Tab: Select simulation type and launch
  4. Results Tab: View outputs and download data

Security Note: The server runs on localhost:8000. No data is sent externally; results are stored locally in /results.

Using the command line (programmers)

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.

Available example scripts

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
plot_currents.jl Plots the current density profiles

Steps to run a simulation

  1. Configure: Select an example script in examples/ (run_step.jl, run_polarization.jl, etc.) and edit its SimulationConfig:

    Field Description / Allowed values
    type_fuel_cell Symbol (e.g., :ZSW_GenStack, :EH31, :default)
    type_current StepParams(...), PolarizationParams(...), EISParams(...)
    voltage_zone :before_voltage_drop, :full
    type_auxiliary :no_auxiliary, :forced_convective_cathode_...
    type_purge :no_purge, :constant_purge, :periodic_purge
    type_display :synthetic, :multiple, :no_display
    display_timing :postrun, :live
  2. Run:

    julia --project=. examples/run_step.jl

Automated parameter calibration (advanced)

Calibration adapts AlphaPEM to specific fuel cells using genetic algorithms.

  1. Prepare: Place experimental curves in src/alphapem/fuelcell and set parameters in src/alphapem/parametrisation/calibration_modules.jl.

  2. Run:

    julia --project=. src/alphapem/parametrisation/calibration.jl

Major updates

  • 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.
    • progressive migration of the interfaces (GUI) module to Julia using Genie.jl and Stipple.jl.
    • progressive migration of the parametrisation (calibration) module.
  • 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).
  • 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.
  • 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

  • Calibration is currently under maintenance.
  • 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.
  • Support for PEM electrolyzers.
  • Integration of more accurate physical models for the auxiliaries.
  • Inclusion of ECSA degradation in the simulation framework.

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)

      • In the SoftwareX journal, in arXiv, in HAL or in SSRN (postprint).
      • The objective of this work is to highlight the AlphaPEM software, which has been published as open-source on GitHub. The first version of this PEM fuel cell simulator is based on the dynamic 1D model developed during 2021-2024.
    • 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.
      • 1D modeling of matter transport phenomena in a PEM single cell divided into several nodes.
    • 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.

Contributions

Authors

  • 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).

Financial support

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.

Licenses

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.

New contributors

Contributions from the community are welcome! If you would like to contribute to AlphaPEM, please follow these steps:

  1. Fork and branch: git checkout -b feature/YourFeature after forking.
  2. Commit and push: git commit -am 'Add feature' && git push origin feature/YourFeature
  3. Pull Request: Open a new PR on GitHub.

Contact

For any questions or support, please contact me at gassraphael@proton.me.

Thank you for using AlphaPEM!

About

AlphaPEM is an open-source software package for simulating proton exchange membrane fuel cell (PEMFC) systems using physics-based models for embedded applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors