An Open-Source Toolbox for PEM Fuel Cell Simulation

: In this paper, an open-source toolbox that can be used to accurately predict the distribution of the major physical quantities that are transported within a proton exchange membrane (PEM) fuel cell is presented. The toolbox has been developed using the Open Source Field Operation and Manipulation (OpenFOAM) platform, which is an open-source computational ﬂuid dynamics (CFD) code. The base case results for the distribution of velocity, pressure, chemical species, Nernst potential, current density, and temperature are as expected. The plotted polarization curve was compared to the results from a numerical model and experimental data taken from the literature. The conducted simulations have generated a signiﬁcant amount of data and information about the transport processes that are involved in the operation of a PEM fuel cell. The key role played by the concentration constant in shaping the cell polarization curve has been explored. The development of the present toolbox is in line with the objectives outlined in the International Energy Agency (IEA, Paris, France) Advanced Fuel Cell Annex 37 that is devoted to developing open-source computational tools to facilitate fuel cell technologies. The work therefore serves as a basis for devising additional features that are not always feasible with a commercial code. Software, J.-P.K.; Validation, J.-P.K., X.Z. and Y.Y.; Formal Analysis, J.-P.K. and S.A.; Investigation, J.-P.K.; Resources, X.Z.; Data Curation, J.-P.K.; Writing-Original Draft Preparation, J.-P.K.; Writing-Review & Editing, X.Z. and S.A.; Visualization, J.-P.K.; Supervision, X.Z. and Y.Y.; Project Administration, J.-P.K. and S.A.; Funding Acquisition, X.Z.


Introduction
A proton exchange membrane (PEM) fuel cell is an electrochemical device used to convert the chemical energy of hydrogen into electrical energy, releasing heat in the process while producing water as the only by-product of the electrochemical reactions. It is thus a clean energy technology that has become an attractive option for replacing some of the carbon-based fuel energy systems since fossil fuel resources are increasingly scarce and they produce a significant amount of pollutants [1].
PEM fuel cells have many other advantages apart from being environmentally friendly energy conversion devices. They can directly convert the chemical energy of hydrogen into useful work without undergoing any thermodynamic cycle, resulting in higher efficiencies in direct electrical energy conversion. In addition, they have higher power densities and operate at lower temperatures,  As illustrated in Figure 2, the computational domain consists of both solid and fluid regions. The solid region is comprised of the membrane and the BPs, whereas the fluid region contains the GFCs, the GDLs, and the CLs. The reactant gases and the product water are transported within the fluid region. The porous electrodes carry the heat released by the electrochemical reactions to the cooling system through the BPs. Therefore, the field variables that need to be solved in these regions are different. The solid is governed by the conservation of energy, whereas the fluid is governed by the conservations of mass, momentum, chemical species, and energy. In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Mass conservation:
Computation 2018, 6, x FOR PEER REVIEW 4 of 17 In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: where the mass fraction of the inert species is calculated using the sum of the other species (1 − ∑ ). Energy conservation: where the energy source term SE, is essentially due to the heat released by the electrochemical reaction determined by: The cell voltage: Additional constitutive relations for linking the various physical quantities are given in Table 2. In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: where the mass fraction of the inert species is calculated using the sum of the other species (1 − ∑ ). Energy conservation: where the energy source term SE, is essentially due to the heat released by the electrochemical reaction determined by: The cell voltage: Additional constitutive relations for linking the various physical quantities are given in Table 2. In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: where the mass fraction of the inert species is calculated using the sum of the other species (1 − ∑ ). Energy conservation: where the energy source term SE, is essentially due to the heat released by the electrochemical reaction determined by: The cell voltage: Additional constitutive relations for linking the various physical quantities are given in Table 2. In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: where the mass fraction of the inert species is calculated using the sum of the other species (1 − ∑ ). Energy conservation: where the energy source term SE, is essentially due to the heat released by the electrochemical reaction determined by: The cell voltage: Additional constitutive relations for linking the various physical quantities are given in Table 2. In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: where the mass fraction of the inert species is calculated using the sum of the other species (1 − ∑ ). Energy conservation: where the energy source term SE, is essentially due to the heat released by the electrochemical reaction determined by: The cell voltage: Additional constitutive relations for linking the various physical quantities are given in Table 2.

Symbol Expression Source
Gas density ρ where the momentum source term S M , is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: where the mass fraction of the inert species is calculated using the sum of the other species (1 − ∑ ). Energy conservation: where the energy source term SE, is essentially due to the heat released by the electrochemical reaction determined by: The cell voltage: Additional constitutive relations for linking the various physical quantities are given in Table 2.
In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: where the mass fraction of the inert species is calculated using the sum of the other species (1 − ∑ ). Energy conservation: where the energy source term SE, is essentially due to the heat released by the electrochemical reaction determined by: The cell voltage: Additional constitutive relations for linking the various physical quantities are given in Table 2. In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: where the mass fraction of the inert species is calculated using the sum of the other species (1 − ∑ ). Energy conservation: where the energy source term SE, is essentially due to the heat released by the electrochemical reaction determined by: The cell voltage: Additional constitutive relations for linking the various physical quantities are given in Table 2.
where the mass fraction of the inert species is calculated using the sum of the other species (1 − ∑ n−1 i=1 y i ). Energy conservation: In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: where the mass fraction of the inert species is calculated using the sum of the other species (1 − ∑ ). Energy conservation: where the energy source term SE, is essentially due to the heat released by the electrochemical reaction determined by: In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: where the mass fraction of the inert species is calculated using the sum of the other species (1 − ∑ ). Energy conservation: where the energy source term SE, is essentially due to the heat released by the electrochemical reaction determined by: In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: where the mass fraction of the inert species is calculated using the sum of the other species (1 − ∑ ). Energy conservation: where the energy source term SE, is essentially due to the heat released by the electrochemical reaction determined by: where the energy source term S E , is essentially due to the heat released by the electrochemical reaction determined by: The cell voltage: Additional constitutive relations for linking the various physical quantities are given in Table 2. Knudsen diffusion coefficient Nernst potential

Boundary Conditions
The boundary and initial values are given in Table 3. The inlet values for velocity, temperature, and mass fractions are given at the fluid inlets. Air and fuel inlet velocities are calculated according to [36] The outlet pressure value is prescribed at the outlet of both the anode and the cathode gas flow channels. For all other variables, Neumann boundary conditions are applied at the fluid outlets. Impermeability conditions are specified for mass and species flow at the membrane-fluid interfaces. Impermeability, no-slip, and no-flux boundary conditions are applied at all the internal surfaces within the modelling domain. A temperature of zero-gradient is applied at all the external surfaces. In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation: where the mass fraction of the inert species is calculated using the sum of the other species (1 − y H2 = 0 In the numerical model presented in this work, the conservation equations are coupled with the solution of the Nernst equation. In other words, the transport of mass, momentum, and chemical species are coupled with electrochemical reactions to create a more tractable numerical model. The energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by: Chemical species conservation:

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar an incompressible due to low velocities. The individual gases and the gas mixture are considered a ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membran is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemic reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipol plates is neglected due to high heat conductivity and the electrical potential distribution is taken a constant within the bipolar plates due to high electrical conductivity of the bipolar plate materi [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: In the numerical model presented in this work, the conservation equations are coupled with th solution of the Nernst equation. In other words, the transport of mass, momentum, and chemica species are coupled with electrochemical reactions to create a more tractable numerical model. Th energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered a ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membran is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemica reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode' activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipola plates is neglected due to high heat conductivity and the electrical potential distribution is taken a constant within the bipolar plates due to high electrical conductivity of the bipolar plate materia [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darc resistance in the porous media, given by: Chemical species conservation: In the numerical model presented in this work, the conservation equations are coupled with th solution of the Nernst equation. In other words, the transport of mass, momentum, and chemica species are coupled with electrochemical reactions to create a more tractable numerical model. Th energy equation solved in the solid region is coupled with the energy solutions in the fluid region.

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar an incompressible due to low velocities. The individual gases and the gas mixture are considered a ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membran is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemica reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipola plates is neglected due to high heat conductivity and the electrical potential distribution is taken a constant within the bipolar plates due to high electrical conductivity of the bipolar plate materia [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darc resistance in the porous media, given by: Chemical species conservation:

Assumptions
Steady-state operating condition is assumed, with the gas flow considere incompressible due to low velocities. The individual gases and the gas mixtur ideal gases. The fuel cell components are assumed to be isotropic and homogene is assumed to be fully humidified and impermeable to reactant gases [26]. reactions are assumed to occur at the cathode electrode-membrane interfac activation and mass transport overpotentials are taken as negligible [26]. Ohmic h plates is neglected due to high heat conductivity and the electrical potential dis constant within the bipolar plates due to high electrical conductivity of the bi [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channe resistance in the porous media, given by:

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar and incompressible due to low velocities. The individual gases and the gas mixture are considered as ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membrane is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemical reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anode's activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipolar plates is neglected due to high heat conductivity and the electrical potential distribution is taken as constant within the bipolar plates due to high electrical conductivity of the bipolar plate material [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Darcy resistance in the porous media, given by:

Assumptions
Steady-state operating condition is assumed, with the gas flow considered to be laminar a incompressible due to low velocities. The individual gases and the gas mixture are considered ideal gases. The fuel cell components are assumed to be isotropic and homogeneous. The membra is assumed to be fully humidified and impermeable to reactant gases [26]. The electrochemi reactions are assumed to occur at the cathode electrode-membrane interface [24]. The anod activation and mass transport overpotentials are taken as negligible [26]. Ohmic heating in the bipo plates is neglected due to high heat conductivity and the electrical potential distribution is taken constant within the bipolar plates due to high electrical conductivity of the bipolar plate mater [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channels and to the Dar resistance in the porous media, given by:

Assumptions
Steady-state operating condition is assumed, with the gas flow considered incompressible due to low velocities. The individual gases and the gas mixtur ideal gases. The fuel cell components are assumed to be isotropic and homogene is assumed to be fully humidified and impermeable to reactant gases [26]. reactions are assumed to occur at the cathode electrode-membrane interfac activation and mass transport overpotentials are taken as negligible [26]. Ohmic h plates is neglected due to high heat conductivity and the electrical potential dis constant within the bipolar plates due to high electrical conductivity of the bi [27,28]. The outer walls of the entire cell are taken as impassable to heat [24].

Governing Equations
Mass conservation: Momentum conservation: where the momentum source term SM, is equal to zero in the gas flow channe resistance in the porous media, given by:

Computational Procedure
The flow diagram of the solution procedure is shown in Figure 3. The initialization phase is followed by an iteration loop where several calculations are repeated until convergence. For the potentiostatic (i.e., current density calculation) run, the cell voltage is fixed whereas for the galvanostatic (i.e., voltage calculation) run, it is adjusted until the computed mean current density is equal or very close to its initial value. The physical constants and properties at cell operating temperature are given in Table 4. The electrochemical parameters and properties used are given in Table 5. The case study operating conditions for the simulation campaign are summarized in Table 6.

Toolbox Structure
The present toolbox follows the same structure and organization as OpenFOAM, as depicted in Figure 4. OpenFOAM is essentially a C++ library with its components falling into two main categories: solvers and utilities. Users can customize any existing components to suit their needs although this requires a good understanding of the software structure, as well as the programming techniques involved. One shortcoming of the OpenFOAM software package is that it has no PEM fuel cell module. Thus, the toolbox developed here provides remediation for this situation. It has two major components: pemfcSinglephaseNonIsothermalSolver and run.

PemfcSinglephaseNonIsothermalSolver
The pemfcSinglephaseNonIsothermalSolver folder contains the source code for the solver and libraries. A pemfcSinglephaseNonIsothermalSolver.c file that contains the main loop of the program is stored in the applications sub-folder. The lib sub-folder is where all necessary libraries are stored and compiled. These include, amongst other things, classes for multicomponent gas diffusivities, geometry, and mesh manipulation. The src sub-folder stores various program files containing specific instructions for the initialization phase and algorithms for solving field variables in the main loop. The individual solvers and other algorithmic controls and tolerances for these field variables are defined in the fvSolution files present in the system sub-folder of the run folder.

Run
The run folder contains the constructed simulation case. An OpenFOAM case folder usually contains three main sub-folders that store several files necessary to running OpenFOAM applications.
The 0 sub-folder is a time sub-folder that stores the initial field data. In OpenFOAM, the time sub-folders store all the field data at various times; the name of each sub-folder corresponds to the time at which the simulation data were written. The data for the geometry construction and mesh creation are stored in the config sub-folder. The constant sub-folder contains a sub-sub-folder called polyMesh in which the mesh information and boundary condition files are stored, along with the physical property file. The files for the solution control, scheme and solvers are stored in the system sub-folder.

Mesh Independence Study
To prove that the solution is independent from the mesh, a mesh independence study was conducted. This required refining the case study mesh twice by adding an extra 20% and 40% of the cells in every direction. Simulations at the case study conditions were then run with these refined meshes in order to compare the solutions for the temperature field. The numerical results, shown in Table 7, showed that the maximum change of temperature solution is 0.03% for the compared meshes. This is evidence of the independence of the solution from the grid.

Comparison with Literature Model Results and Experimental Data
The cell voltage drop per current density, also known as polarization curve, is plotted in Figure 5. Since the present single-phase flow model has been run with some of the parameters and properties taken from the multiphase flow model introduced by Yuan et al. [38] (as given in Table 8), the results are therefore compared to the numerical model results and experimental data from Yuan et al. [38]. This also required adjusting other parameters such as the charge transfer coefficient and the reference exchange current density to achieve a good agreement between the models (see Table 8). A direct comparison is problematic given some differences in the modelling approaches, as well as cell geometric dimensions and operating condition parameters and properties (see Table 8). But the polarization curves nonetheless follow similar trends as seen in Figure 5, which confirms the trend in cell voltage drop obtained with the developed OpenFOAM model. However, this work does not account for liquid water effects in the fuel cell, which would have resulted in further potential drop, as accounted for in the multiphase flow model in [38]. Furthermore, the difference between the three curves at high current densities is due to, in addition to other factors, the complex conjunction of the effects of the inlet flow rates, the cell design details and properties (e.g., number of gas flow channels in each electrode, electrode porosity, material properties, etc., see Table 8), and the concentration overpotential. In fact, the result indicates that the impact of the chosen concentration constant on the concentration overpotential is very significant. Hence, optimization of this value would play a key role in shaping the cell I-V curve since the curvature in the high current densities zone is determined by the changes in the concentration overpotential.

Case Study Results and Discussion
The results are post-processed and visualized using ParaView, which is an open source visualization software used for postprocessing in OpenFOAM through the paraFoam utility, supplied with OpenFOAM.
The velocity profiles along the gas flow channels for the fuel and air are displayed in Figure 6a,b, respectively. These are consistent with those seen in fully-developed laminar flow. The highest velocity appears at the center lines of the channels and the lowest velocity is seen at the walls. The pressure in the fuel and air side gas flow channels are illustrated in Figure 7a,b, respectively. A pressure drop occurs at the outlets of the channels as the velocity increases in these areas as shown in Figures 8 and 9.   The distribution of hydrogen and oxygen mass fractions are shown in Figure 10a,b, respectively. The consumption of the reactant gases by the electrochemical reaction leads to a decrease in their mass fractions going from inlet to outlet and from the GFCs to the CLs. There is a direct proportionality between the concentration of reactant gases in the electrodes and the pressure (see Figures 11 and 12).
The distribution of Nernst potential is illustrated in Figure 13a. The combined effects of hydrogen depletion in the anode and water vapor production in the cathode cause the Nernst potential to decline from inlet to outlet. Consequently, the observed local current density as shown in Figure 13b, also decreases in the flow direction. The current density sharply decreases towards the corner edges of the cell outlet where there is no active surface. The distribution of the local temperature is displayed in Figure 13c. The non-uniform nature of the temperature field is due to thermal inactivity at the ribs. This reduces the heat released by the electrochemical reaction in these areas, which in turn lowers the current densities due to reduced mass transfer.

Conclusions and Outlook
An open-source code toolbox capable of accurately predicting the distribution of the major physical quantities that are transported within a PEM fuel cell has been created using OpenFOAM. The toolbox can be used to rapidly gain important insights into the cell working processes that are essential for design optimization. It consists of a main program, relevant library classes, and a constructed simulation case for a co-flow galvanostatic run.
The base case results for the distribution of velocity, pressure, chemical species, Nernst potential, current density, and temperature are as expected. The results of a mesh independence investigation revealed that the solution is independent from the grid. The plotted cell polarization curve was compared to the available experimental data and numerical model results taken from the literature, though a direct comparison seems difficult because of the differences in the modelling approaches, as well as cell geometric dimensions and operating condition parameters and properties. The obtained simulation data can provide crucial information about the major transport processes that take place within a PEM fuel cell.
The model that has been created can, by no means, be considered complete. There are still some improvements that can be made in the context of the present study. Liquid water transport has not been considered, and so far, the transport phenomena inside the membrane (e.g., dissolved water transport) have been simplified. Also, for the sake of simplicity, and to facilitate the numerical implementation, the electrochemical reaction has been assumed to take place at a single interface between the cathode catalyst layer and the membrane.
The present tool can provide a foundation for further development that is not always feasible with commercial code. The source code is available at http://dx.doi.org/10.17632/3gz7pxznzn.1. Future work may include a multiphase flow extension, and or improved catalyst and membrane models, as well as performing a detailed sensitivity analysis for a deeper understanding of the modelling choices. Moreover, experimental test of the fuel cell used in the case study will be conducted in the future to validate the results obtained here from CFD simulation.

Conflicts of Interest:
The authors declare no conflict of interest. The founding bodies had no role in the design of the study, collection, analyses, interpretation of data; writing of the manuscript, and in the decision to publish the results.