Main Content

PEM Fuel Cell System with the Gas Mixture Domain

This example shows how to model a proton exchange membrane (PEM) fuel cell stack with a custom library and custom Simscape™ domain. You can download the library and model from MATLAB® Central File Exchange.

Example Overview

The gas mixture domain is a Simscape domain designed to handle mixtures of semi-perfect gases. It follows the same assumptions and principles as the moist air domain, however, there is no limit on the number of gas species and you can specify a mixture of any number of gas and trace species. The domain uses Simscape vector variables, so you can specify the species available in the mixture by changing the domain parameters.

The two types of species that the domain allows are active and passive. Active species contribute to the overall thermodynamic properties of the mixture. Active species can condense within specified temperature ranges. Passive, or trace species do not contribute to the thermodynamics of the mixture. Instead, they can track small concentrations of substances through the network.

This repository contains a domain with blocks equivalent to the Simscape Foundation Library for Moist Air. The source code is open, and you can extend and develop your own components to achieve greater functionality.

The repository also contains examples that illustrate key use cases for this domain.

Download Files

Download files from Gas Mixture Domain (MATLAB Central File Exchange).

The MATLAB Central File Exchange entry contains the latest domain, library, and models. The files are compatible with R2023a and later releases of MATLAB. You can download the files as a Zip file or a toolbox file. After downloading the toolbox, you can install it as an Add-On to MATLAB

Model

Open the Fuel Cell model, GasMixtureFuelCell.slx.

In this example, the gas mixture domain models a 4-species gas mixture that contains nitrogen (N2), oxygen (O2), hydrogen (H2), and water vapor (H2O).

The PEM fuel cell generates electrical power by consuming hydrogen and oxygen and producing water vapor. The anode contains nitrogen (N2), water vapor (H2O), and hydrogen (H2), which represent the fuel. The fuel tank stores the hydrogen at 70 MPa. A pressure-reducing valve releases hydrogen to the fuel cell stack at around 0.16 MPa. Unconsumed hydrogen recirculates back to the stack.

The cathode contains nitrogen (N2), water vapor (H2O), and oxygen (O2), which represent air from the environment. A compressor brings air to the fuel cell stack at a controlled rate to ensure that the fuel cell is not starved of oxygen. A back pressure relief valve maintains a pressure of around 0.16 MPa in the stack and vents the exhaust to the environment.

The temperature and relative humidity in the fuel cell stack must stay at an optimal level to ensure efficient operation under various loading conditions. Higher temperatures increase thermal efficiency but reduce relative humidity, which causes higher membrane resistance. Therefore, in this model, the fuel cell stack maintains a temperature of 80 degC. The cooling system circulates coolant between the cells to absorb heat and rejects it to the environment via the radiator. The humidifiers saturate the gas with water vapor to keep the membrane hydrated and minimize electrical resistance.

The Simscape code MEA.ssc implements the Membrane Electrode Assembly block.

The output ports xi of the anode and cathode gas channel blocks provide the gas mole fractions to model the fuel cell reaction. The block models the removal of H2 and O2 from the anode and cathode, respectively, and production of H2O due to the chemical reaction. Water vapor travels across the MEA. The heat generated by the reaction is sent through the thermal port H to the connected Thermal Mass block. Refer to the comments in the code for additional details on the implementation.

See also the PEM Fuel Cell System example that uses the moist air domain.

Simulation Results from Scopes

Set the Electrical Load to Drive cycle, run the model, and open the scopes to view the simulation results.

Simulation Results from Simscape Logging

This plot shows the current-voltage (i-v) curve of a fuel cell in the stack. As the current ramps up, an initial drop in voltage occurs due to electrode activation losses, followed by a gradual decrease in voltage due to Ohmic resistances. Near maximum current, a sharp drop in voltage occurs due to gas-transport-related losses.

This plot also shows the power produced by the cell. When the ramp scenario is selected, the power increases until a maximum power output, then decreases due to the high losses near maximum current.

This plot shows the electrical power produced by the fuel cell stack as well as the power consumed by the cathode air compressor and the coolant pump to maintain stable and efficient system operation. As a result, the net power produced by the system is a few percent less than the power produced by the stack. Note that this model assumes an isentropic compressor. If you account for compressor efficiency, the net power gain decreases by another couple of percent.

This plot also shows the excess heat generated by the fuel cell stack, which the cooling system must remove. The maximum power that the fuel cell stack produces is 95 kW.

This plot shows the thermal efficiency of the fuel cell and its reactant utilization fraction. The thermal efficiency indicates the fraction of the hydrogen fuel's energy that the fuel cell converted to useful electrical work. The theoretical maximum efficiency for a PEM fuel cell is 83%. However, the actual efficiency is around 60% due to internal losses. Near the maximum current, the efficiency drops to around 45%.

The reactant utilization is the fraction of the reactants, H2 and O2, flowing into the fuel cell stack that the fuel cell has consumed. While higher utilization makes better use of the gases flowing through the fuel cell, it decreases the concentration of the reactants and thus reduces the voltage produced. Unconsumed O2 vents to the environment, but unconsumed H2 recirculates back to the anode to avoid waste. A valve periodically purges H2 to remove contaminants.

This plot shows the temperatures at various locations in the system. The cooling system maintains the fuel cell stack temperature at a maximum of 80 degC. The recirculated flow warms the fuel flowing to the anode and the compressor warms the air flowing to the cathode.

Maintaining an optimal temperature is critical to the fuel cell operation because higher temperatures lower the relative humidity, which increases the membrane resistance. In this model, a simple control of the coolant pump flow rate operates the cooling system. The plot shows the temperature of the coolant after it has absorbed heat from the fuel cell stack and after it has rejected heat in the radiator.

This plot shows the mass of hydrogen used during operation and the corresponding decrease in the hydrogen tank pressure. The energy of the consumed hydrogen fuel converts to electrical energy.

This plot shows the molar concentrations of nitrogen and hydrogen in the fuel cell anode. Higher concentrations of nitrogen correspond to lower concentrations of hydrogen and lower fuel cell performance. This system has a purge valve to maintain high hydrogen concentration in the anode. The valve opens when the nitrogen molar concentration in the anode exceeds 50% and closes when it returns to 10%. When the purge valve opens to expel nitrogen, it also expels hydrogen. Therefore, fuel cell purge valves typically require carefully designed control strategies.

References

Dutta, Sandip, Sirivatch Shimpalee, and J. W. Van Zee. "Numerical prediction of mass-exchange between cathode and anode channels in a PEM fuel cell." International Journal of Heat and Mass Transfer 44.11 (2001): 2029-2042.

EG&G Technical Services, Inc. Fuel Cell Handbook (Seventh Edition). US Department of Energy, Office of Fossil Energy, National Energy Technology Laboratory, 2004.

Pukrushpan, Jay T., Anna G. Stefanopoulou, and Huei Peng. Control of fuel cell power systems: principles, modeling, analysis and feedback design. Springer-Verlag London, 2004.

Spiegel, Colleen. PEM fuel cell modeling and simulation using MATLAB. Elsevier, 2008.

To find the latest examples from the MathWorks Simscape Team, see MathWorks Simscape Team on MATLAB Central.

See Also

Topics