Dynamic Electric Simulation Model of a Proton Exchange Membrane Electrolyzer System for Hydrogen Production

: An energy storage system based on a Proton Exchange Membrane (PEM) electrolyzer system, which could be managed by a nanoGrid for Home Applications (nGfHA), is able to convert the surplus of electric energy produced by renewable sources into hydrogen, which can be stored in pressurized tanks. The PEM electrolyzer system must be able to operate at variable feeding power for converting all the surplus of renewable electric energy into hydrogen in reasonable time. In this article, the dynamic electric simulation model of a PEM electrolyzer system with its pressurized hydrogen tanks is developed in a proper calculation environment. Through the calculation code, the stack voltage and current peaks to a supply power variation from the minimum value (about 56 W) to the maximum value (about 440 W) are controlled and zeroed to preserve the stack, the best range of the operating stack current is evaluated, and hydrogen production is monitored.


Introduction
The main European Community goals towards 2030 are at least a 40% reduction in greenhouse gas emissions compared to 1990 levels, at least 32% share of renewable energy, and at least 32.5% improvement in energy efficiency [1].
The electrical power produced from Renewable Energy Sources (RES), such as the sun and wind, is not controllable and intermittent.Moreover, the availabilities of RES (sun and wind) electric energy and fossil fuels do not correspond temporally and spatially to the end-user energy demand.Due to these problems, electrical systems may not be able to guarantee the required standard of electrical system reliability, which is very high and determined by the obtainable levels of adequacy [2], safety [3] and resilience [4].Under this point of view, the development of the technologies for the advanced and active management of the users' plants, placed downstream the electric energy meter ("Behind the Meter") is very relevant; in particular, advanced solutions of hybrid systems, such as nanoGrid for Home Applications (nGfHA), are capable of managing simultaneously different technologies of generation sources and/or storage systems.
The electrical system with RES plants has to be equipped with a variety of accumulation technologies, which contribute to deliver different types of service (power and voltage regulation) and contribute to satisfying the electric needs with different time horizons.Specifically, the time horizon varies in the range of a few milliseconds (ultra-capacitors), days and/or months (Power to Fuel technologies, P2F [5][6][7]), by hours (batteries).One of the possible P2F technologies involves using part of the electric energy surplus within the electrical system, which integrates RES plants, to produce hydrogen through electrolysis.The hydrogen produced can be adequately stored and converted into electric energy through fuel cells [8][9][10][11][12][13] at times when the energy demand is high or can fuel "carbon free" and sustainable mobility systems [14][15][16][17][18].
In this context, Proton Exchange Membrane (PEM) electrolyzers are able to convert water into high purity hydrogen flow and oxygen-rich flow using the electric energy produced from RES with no environmental impact and with a higher conversion efficiency than the one of the conventional alkaline electrolyzers [19].Recently, for the PEM electrolyzers, a new membrane and catalyst [20] and a new bipolar plate material [21] have been tested, new models of porous materials have been developed [22,23], and a new operating strategy has been proposed to prevent their performance degradation in intermittent operation [24].
The authors did not find many articles in the literature about the overall dynamic simulation model of a PEM electrolytic stack and of the entire PEM electrolyzer system [25][26][27][28][29][30].
Awasthi et al. [25] developed a dynamic simulation model of a PEM water electrolytic cell element based on Matlab/Simulink software under different operating conditions (pressure and temperature) and considered the contributions of the different over-voltages.
Guilbert et al. [26] developed a dynamic emulator of a PEM electrolytic cell element through an equivalent electrical model, considered the capacitive effect of the PEM electrolyzer, when subjecting to dynamic current profiles, and modeled a PEM electrolyzer, which is composed of three cells under dynamic operating conditions.
Yigit and Selamet [27] developed a PEM electrolysis-based hydrogen generator system model using Matlab/Simulink software.The model considers PEM electrolytic stack, water pump, cooling fan, storage tank, water tank, power supply, control unit, and sensors.
Gorgun [28] developed a dynamic model of a PEM electrolytic cell element.It considers anode, cathode, membrane, and voltage ancillary and it includes water phenomena, electro-osmotic drag and diffusion through the membrane Hernandez-Gomez et al.
[29] developed an equivalent electrical circuit to replicate accurately the dynamic behavior of the PEM electrolytic stack subject to fast current change.
Brezak et al. [30] developed a Matlab/Simulink ® simulation model of a low-pressure PEM electrolytic stack.
[29] analyzed the PEM electrolytic stack, considering its capacitive effect; • Brezak et al. [30] analyzed the PEM electrolytic stack, not considering its capacitive effect and the power supply variations; • Yigit and Selamet [27] analyzed the PEM electrolyzer, but did not consider the capacitive effect of the PEM electrolytic stack and the real DC/DC converter, which feeds the PEM electrolyzer.
It is necessary to develop a fast, flexible, and precise calculation tool capable to simulate the dynamic behavior of the entire PEM electrolyzer system, when it is only a component of a highly complex energy storage system, to diagnose and prevent the PEM electrolytic stack malfunctions.
In this article, the authors set up a dynamic simulation model of the entire PEM electrolyzer system, which is composed of the real and improved buck DC/DC converter, the PEM electrolytic stack, the auxiliaries and the pressurized hydrogen storage system.
With respect to the articles examined [25][26][27][28][29][30], the dynamic simulation model of the entire PEM electrolyzer system developed by the authors considers all the main components of system (real and improved DC/DC buck converter, PEM electrolytic stack, the auxiliaries, and the pressurized hydrogen storage system) and the capacitive effect of the PEM electrolytic stack.This simulation model is flexible, i.e., it can consider different type of PEM electrolytic stacks, and accurate, i.e., it fits well with the PEM electrolyzer experimental data, and it can be used to control and prevent the voltage and current peaks during the power supply variation, which can reduce the PEM electrolytic stack's useful life.
Furthermore, the calculation tool developed by the authors is able to simulate accurately the PEM electrolyzer system in different and more complex energy storage systems, to identify the field of efficient operation for the same PEM electrolyzer system and to diagnose and prevent the PEM electrolytic stack malfunctions.
The electric power absorbed by the entire PEM electrolyzer system is changed acting appropriately on the duty ratio of the real and improved DC/DC buck converter.
The simulation model is implemented in the Simulink ® environment to obtain the calculation tool, which evaluates the time trends of the main system parameters (PEM electrolytic stack voltage and current and the State Of Charge of the H 2 -pressurized tanks) to a supply power variation from the minimum value (about 56 W) to the maximum value (about 440 W).Furthermore, the calculation tool is used to trace the trend of the H 2 production efficiency for the system at variable stack operating current.

Numerical Simulation Model
The layout of the PEM electrolyzer system in the Simulink environment is shown in Figure 1.In this figure, the power supply, which is represented as an ideal continuous voltage generator, feeds the PEM electrolyzer auxiliaries (measurement and control devices) and the others components of the same PEM electrolyzer, such as the DC/DC Buck Converter and the stack.The PEM electrolyzer produces pure hydrogen, which is stored in the H 2 storage system.

DC/DC Buck Converter
The Buck Converter produces a lower average output DC voltage than the DC input voltage to feed properly the PEM electrolytic stack.Since the electric power at the converter input is low (<1 kW), a non-isolated converter (without the galvanic isolation between input and output) is considered.
Figure 2 shows the layout of the DC/DC Buck Converter in the Simulink ® environment.With respect to the standard DC/DC Buck Converter [31], the rectifier diode is substituted with a synchronous rectifier switch (e.g., IGBT 3).This change reduces the electric power losses and increases the efficiency of the DC/DC Buck converter [32].The duty ratio D, i.e., the product of the switch on time, t on , and the fixed switch frequency, f sw , is modulated to obtain the desired output voltage, V out .The resistances R in1 and R out1 are introduced to consider the ohmic losses of the input and output circuits for the converter.The usual filter inductor, represented by the inductance L 1 , and its peak current are determined based on the specified maximum inductor current ripple, ∆I L1 , through Equation ( 1) [32]: The function of the usual output capacitor, represented by the capacitance C out1 , is that of filtering the inductor current ripple and delivering a stable output voltage.It also has to ensure that load steps at the output can be supported before the regulator is able to react.
There are two distinct criteria, which define the value of capacitance C out1 and the concrete design of the output capacitor solution.
According the first criterion, the minimum value of the capacitance C out1 , called C out1,min1 , is calculated through Equation ( 2) [32]: where n is the number of the phases for the condenser.
According the second criterion, the minimum value of the capacitance C out1 , called C out1,min2 , is calculated through Equation (3) [32]: D max is the maximum value of the duty ratio and t step is the duration of load step.The value of the capacitance C out1 is chosen in such a way that C out1 ≥ max (C out1,min1 , C out1,min2 ).
The function of the usual input capacitor, represented by the capacitance C in1 , is that of filtering the input current into the regulator.The minimum value of the capacitance C in1 , called C in1,min , is calculated through Equation ( 4) [32]: In Equation ( 4), η, ∆V in , and I out are, respectively, the converter efficiency, the permissible input voltage ripple at the input capacitor, and the converter output average current.
The value of the capacitance C in1 is chosen in such a way that C in1 ≥ C in1,min .A special capacitive filter, C stab2 , is introduced to control the stack voltage peak, which could damage the stack irreversibly.

PEM Electrolytic Stack
The PEM electrolytic stack produces pure hydrogen at the cathode, through electrochemical reaction (5) [25]: and oxygen at the anode, through electrochemical reaction ( 6): Figure 3 shows the layout of the PEM electrolytic stack in the Simulink ® environment.The main equations of the PEM electrolytic stack are Equations ( 7)-(12): I s (t) = I an,s,1 (t) + I an,s,2 (t) = I cat,s,1 (t) + I cat,s,2 (t) (8) Equation ( 7) is the equation for the calculation of the real voltage of the PEM electrolytic stack, Equation ( 8) are the currents balance equations at the circuit main nodes, Equations ( 9) and (10) are the current equations for the capacitive anode and cathode branches, Equations ( 11) and ( 12) are the voltage equations for resistive anode and cathode branches.
In Equations ( 7)- (12), OCV s , V an,s (t), V cat,s (t), R el,s (t), I s (t), I an,s,1 (t), I an,s,2 (t), I cat,s,1 (t), I cat,s,2 (t), C an,s (t), C cat,s (t), R cat,s (t), and R an,s (t) are, respectively, the open circuit voltage, the voltage losses on the anodes and cathodes, the electrolytes ohmic resistance, the stack current, the currents on the resistive and capacitive anode branches, the currents on the resistive and capacitive cathode branches, the anode and cathode capacitances, the anode and cathode ohmic resistances.
The real voltage requested by the PEM electrolytic stack is also calculated through Equation (13): In Equation ( 13), ∆V act,s (I s (t)), ∆V conc,s (I s (t)), and R s (I s (t))•I s (t) are, respectively, the stack open circuit voltage, activation, concentration and ohmic/contact polarization over-voltages, functions of the stack current, I s (t).
The stack open circuit voltage is expressed through Equation ( 14): In Equation ( 14), R id (I s (t)) is an ideal resistance function of the stack current, I s (t).
In the second member of Equation ( 13), the sum of the other terms is expressed by Equation (15): ∆V act,an (I s (t)), ∆V conc,an (I s (t)), and R an (t)•I s (t) are, respectively, the activation and concentration polarization over-voltages of the anodes, both functions of the stack current, I s (t), and the ohmic over-voltage of the anodes in the stack.
The product R mem (I s (t))•I s (t) is the ohmic-contact over-voltage of the electrolytes, bipolar plates and end plates in the stack, which is a function of the stack current, I s (t).
∆V act,cat (I s (t)), ∆V conc,cat (I s (t)), and R cat (t)•I s (t) are, respectively, the activation and concentration polarization over-voltages of the cathodes, both functions of the stack current, I s (t), and the ohmic over-voltage of the cathodes in the stack.
In the stack current operating range, I s,min ≤ I s (t) ≤ I s,max , Equations ( 16)-( 19) are written: R id (I s (t)) = R id (I s,min ) + DR id (I s (t)) ∆V act,an (I s (t)) R mem (I s (t)) = R mem (I s,min ) + DR mem (I s (t)) ∆V act,cat (I s (t)) In Equations ( 16)-( 19), the resistances R id (I s (t)), R an (I s (t)), R mem (I s (t)), and R cat (I s (t)) are the sum of the minimum resistances R id (I s,min ), R an (I s,min ), R mem (I s,min ), and R cat (I s,min ) and the resistance variations with respect to their respective minimum values calculated at the stack operating current, I s (t), DR id (I s (t)), DR an (I s (t)), DR mem (I s (t)), and DR cat (I s (t)).
DR id (I s,min ), DR an (I s,min ), DR mem (I s,min ), and DR cat (I s,min ) values are zero.At the stack maximum current, I s,max , the resistances R id (I s,max ), R an (I s,max ), R mem (I s,max ), and R cat (I s,max ) are calculated through Equations ( 20)-( 23): R id (I s,max ) = R id (I s,min ) + DR id (I s,max ) R an (I s,max ) = R an (I s,min ) + DR an (I s,max ).
R mem (I s,max ) = R mem (I s,min ) + DR mem (I s,max ) R cat (I s,max ) = R cat (I s,min ) + DR cat (I s,max ) In Figure 3, the six ideal switches are used to increase the resistances R id (I s ), R an (I s ), R mem (I s ), and R cat (I s ) from their minimum values R id (I s,min ), R an (I s,min ), R mem (I s,min ), R cat (I s,min ) to their maximum values R id (I s,max ), R an (I s,max ), R mem (I s,max ), and R cat (I s,max ).
In addition, in the anode and in the cathode, the double layer of charge separation is represented by the two capacitors, C an and C cat .In this way, when a current variation is imposed, the dynamic behavior required by charge layers to vary is reproduced.
The instantaneous molar flow of hydrogen produced by the PEM electrolytic stack, F H 2 ,p (t), depends on the instantaneous stack operating current, I s (t), and on the number of electrolytic cells in the stack, N c , and it is calculated through Equation ( 24): Figure 4 shows the comparison between the PEM electrolytic stack static experimental data found in the literature [26] and the static polarization and electric power curves produced by the simulation model.The PEM electrolyzed considered is the NMH2 1000 from HELIOCENTRIS (HELIO-CENTRIS, Berlin, Germany) and the main characteristics of the PEM electrolytic stack experimentally tested by Guilbert and Vitale in [26] are shown in Table 1. Figure 4 shows that there is a good agreement between the simulation model results and the experimental data because the mean absolute percentage errors do not reach 3%.

Hydrogen Storage System
The storage system is composed of cylinders with gaseous hydrogen at low pressure (<20 bar).
Figure 5 shows the layout of the hydrogen storage system in the Simulink ® environment.The instantaneous State Of Charge for the storage system, SOC(t), is calculated through Equation ( 25): where p(t), p max , SOC(t i ), N cyl , N mol.maxare, respectively, the instantaneous and maximum pressures, the state of charge at the initial instant, t i , the number of cylinders, and the maximum mole number of hydrogen in a single cylinder.

PEM Electrolyzer System
The PEM electrolytic absorbs an electric power, P el,in,sys (I s ), for feeding its auxiliaries and to produce and store hydrogen in low pressure cylinders.
The hydrogen production efficiency of the PEM electrolyzer system, η H 2 prod (I s ), is calculated through Equation ( 26):

Numerical Simulations and Results Analysis
The numerical simulation model is implemented in the Simulink ® environment and the calculation tool is used to simulate the electric dynamic behavior of the PEM electrolyzer system.
Table 2 shows the values of the main DC/DC buck converter's input parameters.The values of the parameters L 1 , C in1 , and C out1 are calculated through Equations ( 1)-( 4), in such a way that the buck converter operates correctly at both maximum and minimum power output.Table 3 shows the values of the main PEM electrolytic stack's input parameters.The operating stack current, I s (t), is assumed variable between a minimum value, I s,min , and a maximum value, I s,max .After having defined the cell number of the PEM electrolytic stack, N c , the parameters OCV s , ∆V act,an (I s ), ∆V act,cat (I s ) and ∆V conc,an (I s ), ∆V conc,cat (I s ) are calculated though the equations found in the literature [33,34].
The resistance of the electrodes (anodes and cathodes), R an (I s ) and R cat (I s ), are very low as compared to the resistance of the electrolyte (membrane), R mem (I s ) for a stack with N c < 10 [35], so they can be neglected.R mem (I s ) is assumed linearly variable between a minimum value and a maximum value, respectively considered at the minimum and maximum operating current.
The values of R id (I s,min ), R an (I s,min ), R mem (I s,min ), R cat (I s,min ), DR id (I s,max ), DR an (I s,max ), DR mem (I s,max ), and DR cat (I s,max ) are calculated through Equations ( 16)- (23).
C cat and C an are assumed to be equal to each other and constant as the stack operating current varies.
Table 4 shows the values of the main hydrogen storage system's input parameters.The storage system considered is composed of three hydrogen cylinders with a volume of 50 L and a maximum gas pressure of 16 bar.The state of charge at the initial instant, SOC(t i = 0 s), is set to 0.30.For the PEM electrolyzer system, the auxiliary resistance, R aux , is set up constant and equal to 23.04 Ω and the specific capacitance of the filter, C stab2 , is set up equal to 0.02 Fa to control the stack voltage increase, which could damage the stack irreversibly.At 0 s, it is turned on and fed at minimum power, and at 3 s, the same system is instantaneously fed at maximum power.
Figure 6 shows the time trends of PEM electrolytic stack voltage and current to a supply power variation from its minimum value to its maximum value at 3 s.The values of the parameters L 1 , C out1 , and C stab2 are ad hoc set up to reduce the voltage and current increases and to safeguard the stack.The voltage percentage increases are, respectively, of about 3% at the system start-up (0 s) and 0% at supply variation time (3 s) referred to minimum and maximum stack voltage of 6.69 V and 16.59 V.
The current percentage increases are, respectively, of about 3% at the system start-up (0 s) and 0% at supply power variation time (3 s) referred to minimum and maximum stack current of 4.5 A and 24.5 A.
In this case, the calculation tool is able to control the electric power absorbed by the PEM electrolyzer system, to diagnose and prevent the PEM electrolytic stack over-voltages and over-currents, which can occur in this variable operating condition.
Figure 7 shows the SOC percentage trend in H 2 storage system for a supply power variation from its minimum value to its maximum value at 3 s.As expected, the SOC increases slower when the PEM electrolyzer system is fed at minimum power and faster when the same PEM electrolyzer system is fed at maximum power.
Therefore, the calculation tool is able to monitor also the SOC percentage in the H 2 storage system.
Figure 8 shows the trend of the hydrogen production efficiency for the PEM electrolyzer system at variable stack operating current.The PEM electrolyzer system reaches the maximum production efficiency of about 0.754 at a stack current of about 7.5 A because, at high stack current, the electric power absorbed by the system increases more rapidly than the molar flow of hydrogen produced by the stack.This rapid increase of the electric power is caused by the rapid increase of the over-voltages for the stack.Therefore, the calculation tool is able to identify the best operating stack current range which results between 4.5 A and 14.5 A because, in this range, the stack over-voltages increase, but they remain low.

Conclusions
In the present article, a calculation tool based on the dynamic simulation model of a PEM electrolyzer system, which is composed of the DC/DC buck converter, the PEM electrolytic stack, the auxiliaries, and the pressurized hydrogen storage system, is ad hoc set up in the Simulink ® environment.
The comparison between the PEM electrolytic stack static experimental data found in the literature and the static polarization and electric power curves produced by the simulation model has shown a good agreement between the simulation model results and the experimental data.
Using the calculation tool, the usual inductance and the capacitance at the output of the DC/DC buck converter and the capacitance of the special capacitive filter are ad hoc set up to reduce the stack voltage and current peaks, which could damage the stack irreversibly.
The feeding power of the PEM electrolyzer system is changed from a minimum value (about 56 W) to a maximum value (about 440 W) acting appropriately on the duty ratio of the DC/DC buck converter.
The calculation tool is used to evaluate the time trends of PEM electrolytic stack current and voltage to the above-mentioned supply power variation.Both the voltage and current percentage increases are found to be about 3% at the system start-up (0 s) and around 0% at supply power variation time (3 s) referred to minimum and maximum voltages and currents of the stack.
Through the calculation tool, the SOC percentage trend in H 2 pressure storage system for the above-mentioned supply power variation is traced and, as expected, its variation depends on the molar flow of hydrogen produced and on the operating stack current.
Furthermore, the calculation tool is used to trace the trend of the hydrogen production efficiency for the PEM electrolyzer system at variable stack operating current and to identify its optimal operating field.
The PEM electrolyzer system reaches the maximum production efficiency, referred to hydrogen HHV, of about 0.754 at a stack current of about 7.5 A. The best operating current range of the stack is found to be from 4.5 A to 14.5 A.
In the future, the calculation tool will be further developed and calibrated dynamically on the basis of experimental data directly acquired by the authors on the newly installed test bench, and it will be used to make a parametric study of the PEM electrolyzer system by changing its macroscopic and microscopic operating parameters.
The results will be useful to design a suitable converter for interfacing PEM electrolyzer systems into an nGfHA.

Figure 1 .
Figure 1.Layout of the PEM electrolyzer system in the Simulink ® environment.

Figure 2 .
Figure 2. Layout of the DC/DC Buck Converter in the Simulink ® environment.

Figure 3 .
Figure 3. Layout of the PEM electrolytic stack in the Simulink ® environment.

Figure 4 .
Figure 4. Comparison between the PEM electrolytic stack's theoretical polarization and electric power curves (V s,teo and P el,s,teo ) and PEM electrolytic stack's corresponding experimental data (V s,exp and P el,s,exp ).

Figure 5 .
Figure 5. Layout of the hydrogen storage system in the Simulink ® environment.

Figure 6 .
Figure 6.Time trends of PEM electrolytic stack voltage and current to a supply power variation from its minimum value to its maximum value at 3 s.

Figure 7 .
Figure 7. Time trend of the SOC percentage in the H 2 storage system for a supply power variation from its minimum value to its maximum value at 3 s.

Figure 8 .
Figure 8. Trend of the hydrogen production efficiency for the PEM electrolyzer system at variable stack operating current.

Table 2 .
Main input parameters of DC/DC buck converter.

Table 3 .
Main input parameters of PEM electrolytic stack.

Table 4 .
Main input parameters of the H 2 storage system.