Models - Cfd.pem Electrolyzer
Models - Cfd.pem Electrolyzer
Models - Cfd.pem Electrolyzer
This model is licensed under the COMSOL Software License Agreement 5.6.
All trademarks are the property of their respective owners. See www.comsol.com/trademarks.
Introduction
In a polymer electrolyte membrane electrolyzer cell (PEMEC), the two electrode
compartments are separated by a polymer membrane, coated by porous gas diffusion
electrodes. Liquid water is fed to the anode side, forming oxygen gas on the anode side
and hydrogen gas on the cathode side.
The respective designs of the flow field patterns are important in order to obtain a uniform
distribution of flow, in combination with low pressure drops, during operation.
In this example, the mixture model is used to model the two-phase fluid dynamics on the
anode side of a PEMEC.
The model geometry and operating condition were taken from Ref. 1, with added gravity
and zero tangential (no slip) conditions for all channel walls. The single-phase results for
a 60 ml/min flow rate were verified versus Ref. 2.
Model Definition
Figure 1 shows the model geometry. From the circular inlet (located at the top boundary
of the cylinder), liquid water is led into a manifold, which in turn distributes the flow over
23 channels. Oxygen gas is produced at the anode electrode, located below the
The model is set up using the Mixture Model, Laminar Flow interface, with liquid water
defining the continuous phase and the oxygen gas bubbles the dispersed phase.
Incompressible and isothermal conditions are assumed.
The inlet flow rate of liquid water is 260 ml/min. This is defined using an Inlet boundary
condition.
At the electrode surface/channel boundaries liquid water is consumed, and oxygen gas is
produced according to
+ -
2H 2 O(l) → O 2 (g) + 4H + 4e
The protons are transported through the polymer membrane, dividing the two electrode
compartments, over to the cathode side of the electrolyzer cell. In addition to the oxygen
gas produced, there is hence a net mass outflux due to the proton transport at the
electrode surface/channel boundaries.
The combined oxygen gas production/total mass outflux is defined using an Inlet
boundary condition node, assuming a total oxygen production of 5 mg/s.
Finally, the buoyancy effects due to gravity are included in the model using a Gravity node,
with the gravity vector pointing downward in the z direction.
The model is solved in two steps. First the single-phase (pure liquid water, no oxygen
production) stationary flow is computed using a stationary solver. This solution is then
used as initial conditions for a 10 s time-dependent simulation, where the oxygen
production is ramped up to full production from 0 during the first second.
The highest velocities are found in the inlet/outlet manifold channels. A good practice
when assuming laminar flow is to check the Reynolds number of the computed results.
ρuD
Re= ------------
μ
Given that the width of the channels, 2 mm, is larger than the height, 0.889 mm, we
choose the doubled height (an approximation valid for a wide duct) as the characteristic
length D. At the inlet, where we have pure water and the density-to-dynamic viscosity is
the highest, the maximum velocity is about 1.3 m/s.
The Reynolds number for the inlet manifold channels becomes (all parameter values using
the corresponding SI units)
3 –3
ρuD 10 × 1.3 × ( 2 × 0.889 × 10 )-
Re= ------------ ≈ ----------------------------------------------------------------------------- ≈ 2300
μ 10
–3
A similar calculation for the outlet renders lower values. Reynolds numbers in the range of
2300 and lower, indicates that turbulence should not have to be considered for the given
geometry and flow rates.
Figure 3 shows the gas volume fraction due to evolved oxygen in the cell at 10 s.
The gas volume fraction approaches 100% at the end of the electrode flow channels located
at the middle of the flow field.
Finally, Figure 6 shows the velocity magnitudes at half the length (y direction) and half in
the height (z direction) of the electrode channels at various times. This plot is important
since it indicates the uniformness of the flow distribution over the individual channels. As
can be seen, the flow distribution not particularly uniform for pure water (t=0 s), but gets
significantly even less uniform when the gas production starts (t=1 and 2 s). At t=10 s the
distribution has relaxed back to a somewhat more uniform profile, but still less uniform
than for pure water. It is also seen that the flow field distribution does not change
Reference
1. J. Nie and Y. Chen, “Numerical modeling of three-dimensional two-phase gas-liquid
flow in the field plate of a PEM electrolysis cell,” Int. J. Hydrogen Energy, vol. 35,
pp. 3183–3197, 2010.
NEW
In the New window, click Model Wizard.
MODEL WIZARD
1 In the Model Wizard window, click 3D.
2 In the Select Physics tree, select Fluid Flow>Multiphase Flow>Mixture Model>
Mixture Model, Laminar Flow (mm).
3 Click Add.
4 Click Study.
5 In the Select Study tree, select General Studies>Time Dependent.
6 Click Done.
GEOMETRY 1
The model geometry is available as a parameterized geometry sequence in a separate
MPH-file. If you want to build it from scratch, follow the instructions in the section
Appendix — Geometry Modeling Instructions. Otherwise load it from file with the
following steps.
GLOBAL DEFINITIONS
Use the parameterization to reduce the number of channels and the channel lengths when
setting up the model. It is often a good practice to start a modeling project on a reduced
geometry size (or dimension). This saves time and computational resources while
troubleshooting.
Parameters 1
1 In the Model Builder window, under Global Definitions click Parameters 1.
2 In the Settings window for Parameters, locate the Parameters section.
3 In the table, enter the following settings:
GEOMETRY 1
1 In the Geometry toolbar, click Build All.
GLOBAL DEFINITIONS
Load some more physics parameters and variables from text files. Note that parameters and
variables defining the oxygen and water flows are scaled with the geometric parameters.
Parameters 1
1 In the Model Builder window, under Global Definitions click Parameters 1.
2 In the Settings window for Parameters, locate the Parameters section.
3 Click Load from File.
4 Browse to the model’s Application Libraries folder and double-click the file
pem_electrolyzer_parameters.txt.
DEFINITIONS
Variables 1
1 In the Model Builder window, under Component 1 (comp1) right-click Definitions and
choose Variables.
2 In the Settings window for Variables, locate the Variables section.
3 Click Load from File.
Step 1 (step1)
1 In the Home toolbar, click Functions and choose Local>Step.
2 In the Settings window for Step, locate the Parameters section.
3 In the Location text field, type 0.95.
4 In the From text field, type 1.
5 In the To text field, type 0.
6 Click to expand the Smoothing section. In the Size of transition zone text field, type 0.1.
7 Click Plot.
The step function is used to set the oxygen flux to zero locally when the gas volume
fraction approaches 1. Smoothing is important in order to avoid discrete jumps in the
flux. We will decrease the smoothing later when solving for the full model.
Ramp 1 (rm1)
1 In the Home toolbar, click Functions and choose Local>Ramp.
2 In the Settings window for Ramp, locate the Parameters section.
The ramp function is used to ramp up the oxygen flux from zero when the time-
dependent solver starts. This shortens the computational time.
DEFINITIONS
In the Model Builder window, collapse the Component 1 (comp1)>Definitions node.
ADD MATERIAL
1 In the Home toolbar, click Add Material to open the Add Material window.
Add liquid water and oxygen gas from the Material Library. Note that the order is
important - Add water first.
2 Go to the Add Material window.
3 In the tree, select Built-in>Water, liquid.
4 Click Add to Component 1 (comp1).
5 In the tree, select Liquids and Gases>Gases>Oxygen.
6 Click Add to Component 1 (comp1).
Mixture Properties 1
1 In the Model Builder window, under Component 1 (comp1)>Mixture Model,
Laminar Flow (mm) click Mixture Properties 1.
2 In the Settings window for Mixture Properties, locate the Materials section.
3 From the Continuous phase list, choose Water, liquid (mat1).
4 From the Dispersed phase list, choose Oxygen (mat2).
5 Locate the Dispersed Phase Properties section. From the ρd list, choose User defined. In
the associated text field, type rhoO2.
6 In the dd text field, type D_bubbles.
7 Locate the Mixture Model section. From the Mixture viscosity model list, choose
Volume averaged.
3 Locate the Boundary Selection section. From the Selection list, choose Electrode Surface.
Outlet 1
1 In the Physics toolbar, click Boundaries and choose Outlet.
2 In the Settings window for Outlet, locate the Boundary Selection section.
3 From the Selection list, choose Outlet.
Gravity 1
1 In the Physics toolbar, click Domains and choose Gravity.
The cell is oriented so that the z direction points upward.
2 In the Settings window for Gravity, locate the Domain Selection section.
3 From the Selection list, choose All domains.
4 Locate the Gravity section. Specify the g vector as
0 x
0 y
-g_const z
MESH 1
Manual meshing is required for a geometry of this complexity. Use a swept mesh along the
electrode channels, and free tetraheadal meshing for the remaining domains.
Swept 1
Right-click Component 1 (comp1)>Mesh 1 and choose Swept.
Size
1 In the Settings window for Size, locate the Element Size section.
2 From the Predefined list, choose Finer.
Swept 1
1 In the Model Builder window, click Swept 1.
Distribution 1
1 Right-click Swept 1 and choose Distribution.
2 In the Settings window for Distribution, locate the Domain Selection section.
3 From the Selection list, choose Channels Above Electrode Surface.
4 Locate the Distribution section. In the Number of elements text field, type floor(L_ch/
(0.5*w_ch)).
Size 1
1 Right-click Swept 1 and choose Size.
2 In the Settings window for Size, locate the Element Size section.
3 Click the Custom button.
4 Locate the Geometric Entity Selection section. From the Geometric entity level list,
choose Boundary.
5 From the Selection list, choose Inlets to Electrode Channels .
6 Locate the Element Size Parameters section. Select the Maximum element size check box.
7 In the associated text field, type h_a/4.
Free Tetrahedral 1
1 In the Model Builder window, right-click Mesh 1 and choose Free Tetrahedral.
2 In the Settings window for Free Tetrahedral, locate the Domain Selection section.
3 From the Geometric entity level list, choose Domain.
4 From the Selection list, choose Manifolds.
5 Click to expand the Scale Geometry section. In the z-direction scale text field, type 2.
Size 1
1 Right-click Free Tetrahedral 1 and choose Size.
2 In the Settings window for Size, locate the Element Size section.
3 Click the Custom button.
4 Locate the Element Size Parameters section. Select the Maximum element size check box.
5 In the associated text field, type w_ch/4.
Free Tetrahedral 2
1 In the Model Builder window, right-click Mesh 1 and choose Free Tetrahedral.
2 In the Settings window for Free Tetrahedral, locate the Scale Geometry section.
3 In the z-direction scale text field, type 2.
Size 1
1 Right-click Free Tetrahedral 2 and choose Size.
2 In the Settings window for Size, locate the Element Size section.
3 Click the Custom button.
4 Locate the Element Size Parameters section. Select the Maximum element size check box.
5 In the associated text field, type h_a.
Boundary Layers 1
Add boundary layer meshing to resolve steep velocity gradients at the inlet and outlet
regions to the electrode channels and along the walls..
1 In the Model Builder window, right-click Mesh 1 and choose Boundary Layers.
2 In the Settings window for Boundary Layers, locate the Geometric Entity Selection section.
3 From the Geometric entity level list, choose Domain.
4 From the Selection list, choose Channels Above Electrode Surface.
Boundary Layers 2
1 In the Model Builder window, right-click Mesh 1 and choose Boundary Layers.
2 In the Settings window for Boundary Layers, locate the Geometric Entity Selection section.
3 From the Geometric entity level list, choose Domain.
4 From the Selection list, choose Electrode Channels and Manifolds.
STUDY 1
The problem is now ready for solving. Add a Stationary study step to first solve for the
velocity and pressure fields for pure liquid water. This solution will then be used as initial
values for the time-dependent simulation.
Stationary
1 In the Study toolbar, click Study Steps and choose Stationary>Stationary.
2 Right-click Study 1>Step 2: Stationary and choose Move Up.
Solution 1 (sol1)
1 In the Study toolbar, click Show Default Solver.
2 In the Model Builder window, expand the Solution 1 (sol1) node, then click
Dependent Variables 1.
3 In the Settings window for Dependent Variables, locate the General section.
RESULTS
Create plots for the pressure, velocity and gas volume fraction as follows:
Pressure
1 In the Home toolbar, click Add Plot Group and choose 3D Plot Group.
Surface 1
1 Right-click Pressure and choose Surface.
2 In the Settings window for Surface, click Replace Expression in the upper-right corner of
the Expression section. From the menu, choose Component 1 (comp1)>Mixture Model,
Laminar Flow>VelAndPressure>p - Pressure - Pa.
3 In the Pressure toolbar, click Plot.
Velocity
1 In the Home toolbar, click Add Plot Group and choose 3D Plot Group.
2 In the Settings window for 3D Plot Group, type Velocity in the Label text field.
Slice 1
1 Right-click Velocity and choose Slice.
2 In the Settings window for Slice, click Replace Expression in the upper-right corner of the
Expression section. From the menu, choose Component 1 (comp1)>Mixture Model,
Laminar Flow>VelAndPressure>mm.U - Mass-averaged velocity field - m/s.
3 Locate the Plane Data section. From the Plane list, choose xy-planes.
4 From the Entry method list, choose Coordinates.
5 In the z-coordinates text field, type h_a/2.
Surface 1
1 Right-click Gas Volume Fraction and choose Surface.
Cut Line 3D 1
1 In the Results toolbar, click Cut Line 3D.
2 In the Settings window for Cut Line 3D, locate the Line Data section.
3 In row Point 1, set x to -w_ch/2.
4 In row Point 1, set y to L_ch/2.
5 In row Point 1, set z to h_a/2.
6 In row Point 2, set x to N_ch*w_ch*2-3*w_ch/2.
7 In row Point 2, set y to L_ch/2.
8 In row Point 2, set z to h_a/2.
Line Graph 1
1 Right-click Velocity in Electrode Channels and choose Line Graph.
GLOBAL DEFINITIONS
Now model the full geometry. Go back and set the number of channels and the cell length
to their original values.
Parameters 1
1 In the Model Builder window, under Global Definitions click Parameters 1.
2 In the Settings window for Parameters, locate the Parameters section.
GEOMETRY 1
1 In the Home toolbar, click Build All.
2 Click the Zoom Extents button in the Graphics toolbar.
MESH 1
Inspect the mesh after the geometry change.
DEFINITIONS
Step 1 (step1)
Decrease the smoothing of the step funciton.
STUDY 1
Solution 1 (sol1)
Before solving, make a copy of the solution for the small geometry to keep it for future
reference.
Solver Configurations
Reset the solver sequence in order to obtain the default solver for the new problem size.
Solution 1 (sol1)
1 In the Model Builder window, right-click Solver Configurations and choose
Reset Solver to Default.
2 In the Settings window for Dependent Variables, locate the General section.
Pressure
1 In the Pressure toolbar, click Plot.
2 In the Settings window for 3D Plot Group, locate the Data section.
3 From the Time (s) list, choose 0.
Velocity
1 In the Model Builder window, click Velocity.
2 In the Velocity toolbar, click Plot.
NEW
In the New window, click Model Wizard.
MODEL WIZARD
1 In the Model Wizard window, click 3D.
2 Click Done.
GLOBAL DEFINITIONS
Parameters 1
1 In the Model Builder window, under Global Definitions click Parameters 1.
2 In the Settings window for Parameters, locate the Parameters section.
3 Click Load from File.
4 Browse to the model’s Application Libraries folder and double-click the file
pem_electrolyzer_geom_sequence_parameters.txt.
xw (m) yw (m)
L_inout*3/4 2*w_ch*1.25
L_inout*3/4 -2*w_ch*1.25
L_inout*3/4-5*w_ch*tan(ang_inout/2) -2*w_ch*1.25
xw (m) yw (m)
L_inout*3/4 2*w_ch*1.25
L_inout*3/4 -2*w_ch*1.25
L_inout*3/4+5*w_ch*tan(ang_inout/2) -2*w_ch*1.25
Fillet Selection 1
1 In the Work Plane toolbar, click Selections and choose Box Selection.
2 In the Settings window for Box Selection, type Fillet Selection 1 in the Label text
field.
3 Locate the Geometric Entity Level section. From the Level list, choose Point.
4 Locate the Box Limits section. In the xw maximum text field, type 0.
5 In the yw minimum text field, type L_ch+w_ch*4.5.
6 Click Build Selected.
Fillet Selection 2
1 In the Work Plane toolbar, click Selections and choose Box Selection.
2 In the Settings window for Box Selection, type Fillet Selection 2 in the Label text
field.
3 Locate the Geometric Entity Level section. From the Level list, choose Point.
4 Locate the Box Limits section. In the xw minimum text field, type 2*w_ch*(N_ch-1).
5 In the yw maximum text field, type -w_ch*4.5.
6 Click Build Selected.
Extrude 1 (ext1)
1 In the Model Builder window, right-click Geometry 1 and choose Extrude.
2 In the Settings window for Extrude, locate the Distances section.
3 In the table, enter the following settings:
Distances (m)
h_a
Cylinder 1 (cyl1)
1 In the Geometry toolbar, click Cylinder.
2 In the Settings window for Cylinder, locate the Size and Shape section.
3 In the Radius text field, type R_in.
4 In the Height text field, type 3*h_a.
5 Click Build Selected.
Rotate 1 (rot1)
1 In the Geometry toolbar, click Transforms and choose Rotate.
2 Select the object cyl1 only.
3 In the Settings window for Rotate, locate the Rotation section.
4 In the Angle text field, type ang_inout.
Move 1 (mov1)
1 In the Geometry toolbar, click Transforms and choose Move.
2 Select the object rot1 only.
3 In the Settings window for Move, locate the Displacement section.
4 In the x text field, type -L_inout-w_ch*0.5.
5 In the y text field, type -w_ch*2.5.
6 Click Build Selected.
Rotate 2 (rot2)
1 In the Geometry toolbar, click Transforms and choose Rotate.
2 Select the object mov1 only.
3 In the Settings window for Rotate, locate the Input section.
4 Select the Keep input objects check box.
5 Locate the Rotation section. In the Angle text field, type 180.
6 Locate the Point on Axis of Rotation section. In the x text field, type (N_ch-1)*w_ch.
7 In the y text field, type L_ch/2.
8 Click Build Selected.
Inlet Manifold
1 In the Geometry toolbar, click Selections and choose Box Selection.
2 In the Settings window for Box Selection, type Inlet Manifold in the Label text field.
3 Locate the Box Limits section. In the x minimum text field, type -L_inout.
4 In the y maximum text field, type w_ch/2.
5 Locate the Output Entities section. From the Include entity if list, choose
Entity inside box.
6 Click Build Selected.
Electrode Surface
1 In the Geometry toolbar, click Selections and choose Box Selection.
2 In the Settings window for Box Selection, type Electrode Surface in the Label text
field.
3 Locate the Geometric Entity Level section. From the Level list, choose Boundary.
4 Locate the Box Limits section. In the y minimum text field, type -w_ch/2.
5 In the y maximum text field, type L_ch+w_ch/2.
6 In the z maximum text field, type h_a/2.
7 Locate the Output Entities section. From the Include entity if list, choose
Entity inside box.
Inlet
1 In the Geometry toolbar, click Selections and choose Box Selection.
2 In the Settings window for Box Selection, type Inlet in the Label text field.
3 Locate the Geometric Entity Level section. From the Level list, choose Boundary.
4 Locate the Box Limits section. In the x maximum text field, type 0.
5 In the z minimum text field, type h_a*2.
Outlet
1 In the Geometry toolbar, click Selections and choose Box Selection.
2 In the Settings window for Box Selection, locate the Geometric Entity Level section.
3 From the Level list, choose Boundary.
4 In the Label text field, type Outlet.
5 Locate the Box Limits section. In the x minimum text field, type N_ch*w_ch*2.
6 In the z minimum text field, type h_a*2.
7 Locate the Output Entities section. From the Include entity if list, choose
Entity inside box.
Manifolds
1 In the Geometry toolbar, click Selections and choose Union Selection.
2 In the Settings window for Union Selection, type Manifolds in the Label text field.
3 Locate the Input Entities section. Click Add.
4 In the Add dialog box, in the Selections to add list, choose Inlet Manifold and
Outlet Manifold.
5 Click OK.
3 Locate the Geometric Entity Level section. From the Level list, choose Boundary.
4 Locate the Input Entities section. Click Add.
5 In the Add dialog box, in the Selections to intersect list, choose
Exterior Boundaries to Electrode Channels and Exteror Boundaries to Outlet Manifold.
6 Click OK.