Uploaded by mayil nitt

Proton exchange membrane fuel cell model

advertisement
ARIZONA STATE UNIVERSITY
Proton exchange
membrane fuel cell
modeling and simulation
using Ansys Fluent 12.1
And some other software
Adam
4/1/2011
Revised march 2012
Contents
Introduction ................................................................................................ 4
MEA MODELING AND SIMULATION ....................................................... 5
3.1 Geometry Creation .................................................................... 5
Meshing with ICEM CFD ......................................................................... 39
Setting up the solver ................................................................................ 65
APPENDIX D ........................................................................................... 89
table of mass flow rates up to 400 amperes .................................. 89
Introduction
Ansys Fluent was chosen as the fuel cell modeling software because it is currently the
most complete three-dimensional modeling software commercially available. Their
implementation of a fuel cell model is fairly complete and includes a straight forward graphical
user interface which simplifies the modeling and simulation effort. The software is also capable
of being run in parallel so that larger and more computationally demanding simulations can be
completed in reasonable time frames.
The workflow involves three major steps. The first step is modeling the geometry of the
fuel cell using computer-aided design software. The geometrical model forms the basis for
creating a computational mesh. The second step involves creating the mesh from the
geometry. In order to solve the myriad of equations associated with a fuel cell simulation, the
entire cell is divided into a finite number of discreet volume elements or computational cells.
The relevant equations are then solved in each individual cell and integrated over the
computational domain to give a solution for the entire domain.
Creating a good mesh is one of the more difficult steps. It requires the careful balance
of creating enough computational cells to capture the geometry without creating so many that it
exceeds the available memory of the meshing computer. Many other factors must also be
taken into account in order to generate a computational mesh provides representative results
when simulated.
The third and final step involves inputting the various physical and operating parameters
of the simulation. Some of these include thermal and electrical properties of the various
materials, operating temperatures and pressures, inlet gas flow rates, open circuit voltage,
porosity, and humidification among many others.
MEA MODELING AND SIMULATION
Using Ansys Fluent 12.1 to do modeling and simulation of a PEM fuel cell also involves
three basic steps. The first step is to create the geometry of the fuel cell using computer-aided
design (CAD) software. I’ve found the best software for this purpose is a combination of
SolidWorks 2010 and Ansys Design Modeler, which is part of the Ansys Fluent software
package.
The second step involves decomposing the geometry into a computational mesh. I’ve
explored two options for performing this task. The first involves using Ansys Meshing, which is
part of the workbench. The other method uses Ansys ICEM CFD 12.1. I have found that using
the workbench meshing is more straight forward and easier to use, but suffers from limited
applicability to more complex geometries. ICEM CFD 12.1 is a powerful program with several
idiosyncrasies which must be worked around in order to generate a good mesh.
The third and final step in the process is to generate a simulation based on the
computational mesh. This step requires the careful monitoring of input variables. There are at
least 100 different variables to input, some directly related to model and material properties, and
others that are related to the solver methodology. The simulation process includes creating
automated scripts to generate data and setting up the simulation for parallel processing.
Examples are given for basic commands for running jobs on the Linux based computer cluster
at Arizona State University, but these commands are applicable to many cluster computers
employing a Moab- Terascale Open-Source Resource and QUEue manager / Portable Batch
System (TORQUE/PBS) to manage the scheduling of batch jobs.
3.1 GEOMETRY CREATION
Building the geometry can be one of the easiest steps in the overall process. Fuel cell
components are made of relatively square components so creating accurate curved surfaces is
not necessary. However the accuracy of the geometry can greatly affect the results of the
simulation, particularly in the flow field.
The first step in creating a geometry requires becomming familiar with SolidWorks.
Many CAD software packages works similarly to SolidWorks. The general process involves
sketching faces and then extruding solids from those faces. There are many tutorials available
in the help files and via the internet for modeling with SolidWorks. A user with no background or
experience in CAD modeling should first try some tutorials on 3D modeling in order to become
familiar with the interface. A brief tutorial on how to generate the following original fuel cell
design using SolidWorks is provided.
Figure 1. A single turn serpentine PEM fuel cell design
The first step in designing a fuel cell is to gather or plan the appropriate measurements. Refer
to figure 3 for identification of the fuel cell parts. The measurements are as follows.
Table 1.
Fuel cell geometrical dimensions
Part
Length (mm)
Width (mm)
Height (mm)
GDL
120
32
0.3
Catalyst Layer
120
32
0.06
Membrane
120
32
0.15
Channels
110
8
6
Collector
120
32
12
Figure 2. Dimensions shown in millimeters with expansion of MEA
Once all of the dimensions are determined, it is time to plan the modeling strategy. The
parts in the MEA are simple rectangular solids which can be formed in a single step. The
current collectors require more than one step and the order of the steps can simplify the
process. I think of current collectors as being made of solid blocks of graphite with their
channels carved out with some kind of cutting tool. I usually follow this process when creating
the CAD model. First I will generate a complete current collector solid block. I then cut the
channels out of this solid block.
The current collector can be created by first starting a new part. The bolded words can
be found highlighted in the image that follows each instructive paragraph. Click on the sketch
tab then select the top plane. Generating all of your parts from the same initial plane helps
simplify the assembly process later. Once you have the top plane selected, you can select the
rectangle tool and the corner rectangle to sketch the base of your current collector.
Figure 3. Selecting the sketch plane.
According to the previous dimensions, a rectangle that’s 32 x 120 mm should be
sketched. This will serve as the base for the current collector. Start the sketch at the origin and
drag the other corner while watching the coordinate indicator near the mouse cursor. The
sketch does not have to be an exact measurement intially because the dimensions can be
adjusted later. Draw the initial sketch and then look at the rectangle properties window. Scroll
to the bottom to see the parameters section. The exact coordinates of the vertices of the
sketch can be entered into the parameters section which will give the sketch and exact size.
Click the green checkmark to finalize the sketch.
Figure 4. Drawing a rectangle with exact dimensions
Now that the base has been sketched, it can be extruded to create a three-dimensional
rectangular solid. First, select the rectangular sketch from the parts tree, then click on the
features tab, then click the extruded base/boss button.
Figure 5. Setting up an extrusion.
This will bring up the boss-extrude dialog. The direction and thicknes of the extrusion
can be specified in this panel. Referring to the dimensions for the current collector in Table 1,
the thickness should be 12 mm. Enter the proper thickness and click the green checkmark.
Figure 6. Extruding a sketch to make a three-dimensional solid.
With the base is complete, the flow channel should be cut from the base. The objective
now is to use sketches and cuts (which are the opposite of extrusions, but work exactly the
same way) to create the flow channels. There are at least two different ways to draw the
channel sketches. One way would be to cut out the entire outline of the channel and then
redraw and extrude the land channel. The other method is to explicitly sketch just the land
channels. Both methods will work equally well and involve about the same amount of work to
create simple flow channels like these.
The cut and rebuild method can be performed as follows. Begin by clicking on the top
face of the block in order to define that as the new sketching plane. The face will be highlighted
to indicate that it has focus. Next, click the sketch tab and use the corner rectangle tool
again. Refer to the geometry measurements to determine the dimensions of the channel.
Recall that the overall width of the channel zone was 24mm and the length was 110mm. It can
also be deduced that the distance from the edge of the channel to the edge of the collector is
4mm. This information is used to specify the edges of the rectangular sketch under the
parameters of the rectangle properties. Then click the green checkbox to finalize the sketch.
Figure 7. Cutting out an outline of the channel
The next task is to make an extruded cut into the solid. This will require using the same
process steps as those used in making an extruded base with the exception that the extruded
cut button is selected instead of extruded base. First, select the newly created sketch. Then
click the extruded cut button. Check the graphics window to ensure the cut is going in the
correct direction and set the depth to 6mm. Click the green checkmark to complete the cut.
Next, repeat the process steps to create the channel land area. Select the base of the channel
to define a new sketch plane. Use your corner rectangle tool to draw a new rectangle on the
sketch plane.
The new sketch should begin at 12 mm, end at 20 mm and be 102 mm long. Then use
this sketch to extrude a new feature for the land area. This will complete your current collector
geometry. It should look very similar to the design in figure 2, but without the channel areas
filled.
Figure 8. Sketching a channel rib.
This is the basic process used to create virtually any geometry in SolidWorks. One
useful feature that should be explored is the linear sketch pattern tool. This tool allows the
user to duplicate a sketch in a particular direction at a specified interval. It is very useful for
creating designs that have a repeating pattern. Using this tool, only one instance of the pattern
needs to sketched. The tool can be used to repeat and recreate the pattern as many times as is
necessary.
The next step involves creating new parts for the GDL, catalyst layer, and membrane.
For this geometry, the current collector, GDL and catalyst layers are symmetrical for the anode
and cathode, so each part only needs to be created once and can be used multiple times when
putting the parts into an assembly. It is good practice to always use the top plane as the base
for starting initial sketches so that that all the parts in the assembly have the same
orientation.Each part should be saved as a separate file after it is completed. Once all the
individual parts are created, a new assembly can be started by selecting “new assembly” from
the file menu.
The begin assembly dialog should automatically open and parts can be inserted from
this interface. If the parts share the same orientation they can be combined into an assembly
without the need for rotation. Browse to the current collector and it will show up in the graphical
window. Click the insert components button then click browse to find and add the GDL.
Figure 9. Inserting components into an assembly.
The next step is to mate the two pieces so they are connected to each other with no
gaps. Begin by dragging the GDL part around the graphical window until it is floating above the
current collector. Line the objects up so that the front corners of the two parts are as close as
possible without any overlap. Use the mouse wheel to zoom-in on the front most corners of the
GDL and current collector. Click on the bottom front corner vertex of the GDL so it is
highlighted with a blue dot. Make sure you click on the vertex of the corner and not one of the
edges. Zoom in as much as necessary to be able to select the the lowest vertex on the front
corner.
Next, click the mate button, which has an image of a paperclip on it. Under mate
selections, the vertex of the GDL that was previously selected should appear. Click the vertex
of the current collector that you wish to be coincident with the vertex of the GDL and the parts
will immediately snap together. Click green checkmark to finalize the mate. Repeat this
process for the remaining MEA parts. Zoom in as much as necessary to ensure that the correct
vertices are being selected. The catalyst layers can be extremely thin and it can be difficult to
get a good view of them.
Figure 10. Selecting vertices to mate. After selection they automatically move.
Once all of the MEA parts have been mated, the final step is to add the top current
collector. It will initially be added in the wrong orientation and will need to be rotated. Add the
current collector using the same steps as any other part. Select the part to be rotated from
either the parts tree or by clicking on it from the graphics window. Press the move component
button, then open the rotate section. Use the Delta XYZ for the rotation method. A coordinate
axis will appear on the part that will be rotated. Using this axis as your reference, rotate the
peice about the proper axis. For this geometrical setup, a rotation of 180 degrees about the Zaxis will yield the correct final orientation. Click apply to perform the rotation, then if the
rotation is correct, press the green checkmark to confirm and finalize the rotation. This part can
then be mated to the MEA using the same mating procedure as before.
Figure 11. Rotating components.
The assembly is now complete. The parts tree should have a total of 7 parts. Export the
assembly into a more universal and portable format by choosing STEP from the save options as
dialog. Using the STEP format allows the geometry to be imported Ansys Design Modeler so
that additional geometry work can be performed.. Once the model has been exported into a file
format that can be read by Design Modeler, SolidWorks will no longer be needed.
Open Ansys Workbench. From the toolbox, double click geometry under the
component systems group. A geometry module will open in the project schematic. Double
click on the geometry component to open up an instance of the Design Modeler. After the
Design Modeler window opens, choose mm for the working units.
Figure 12. Ansys Workbench interface and the geometry component.
Import the SolidWorks geometry into the Design Modeler by going to the file menu and
selecting import external geometry file. Browse to the STEP file and click open. The Design
Modeler should show an import under the tree outline with a lightning bolt next to it. Press
the generate button and the geometry should show up in the graphics window.
Figure 13. Importing SolidWorks geometry into the Design Modeler.
The purpose of bringing the geometry into Design Modeler is to perform some necessary
additoinal geometry steps which can’t be done as easily in SolidWorks. The channels need be
defined by filling the voids with a fluid. In addition, all of the parts will be given standard naming
conventions. Material properties will be specified. Inlets, outlets and terminals surfaces will be
defined and named.
Begin by filling the channels so that all of the fuel cell parts will be present. The overall
goal of this section is to generate a face on the channel openings so that the channels have
boundaries on all sides. First, zoom-in on one of the channel openings. From the concept
menu, select “lines from points.” Under details view, change the operation to add frozen by
clicking on the field and using the pull down menu that appears.
Figure 14. Creating lines from points.
Next, click on the point segments box under the details view to activate geometry
select mode. Then select the vertices where the edge of the channel meets the GDL. Do
this for a single inlet at a time. Hold down the CTRL key while you click to select two points
which are going to be connected by a line. Click apply under the point segments to accept the
points. Then click generate to create the line. Be sure that the operation is performed by add
frozen or else all of the bodies will be merged into a single part.
Figure 15. Line created from points.
Once the line has been generated, a surface can be defined by the created line and the
three other edges of the channel wall. To do this, select select “Surfaces from edges” from the
concept menu. The line on the GDL overlaps an existing line so the overlapping geometry
shortcut that appears at the bottom must be used to select the correct line. Hold CTRL and
carefully select the four-edges that define this channel opening and then press apply. After you
press apply the number “4” should appear under the edges, and the edges should appear
green. Once the correct edges have been selected, press generate to create the surface. The
color of the opening should change slightly to indicate that a surface has been created. Repeat
this process for all other channel openings until they have all been covered by surfaces.
Figure 16. Creating a surface from edges.
After the surfaces are created the channels can be filled in using the fill tool. From the
tools menu, select “Fill.” Change the extraction type to “by Caps” and make sure target bodies
says all bodies, do not preserve capping bodies and preserve solids. Click generate to create
the fill. The geometry should now have 13 parts in it.
Rename the 9 fuel cell parts using the following naming convention depicted in figure 25.
The part names should include Current_a, channel_a, gdl_a, catalyst_a, membrane, catalyst_c,
gdl_c, channel_c, current_c. Using a naming convention will simplify the simulation setup. Set
the material properties so that the current collectors are solid and all other parts are fluid.
Correct material properties helps the mesh generation create the proper boundary conditions.
The second to last step is to click-on line bodies under the parts tree and suppress them
by left clicking and choosing suppress body from the context menu. These parts should be
suppressed because they are redundant and were created to help define surfaces for the filling
procedure. The final step is to create a part that includes all of the bodies. Do this by selecting
all of the parts under the parts tree by holding down the ctrl button while selecting bodies. Then
left click and select ‘form new part’ from the context menu. Placing all of the bodies under a
single part ensures that the mesher will understand that all of the parts should be attached to
each other and a conformal mesh should be generated between bodies.
The final step is to save the geometry so that it can be opened in the mesher. If the
workbench mesher is to be used, the geometry can be saved in its default format. It is a good
idea to also save a backup of the geometry. If the geometry is to be used in ICEM CFD then it
should be exported as a parasolid binary rather than a STEP so that it may be opened in ICEM
CFD with part names preserved.
Figure 17. Final listing of parts and suggested naming convention.
Geometry tasks
SolidWorks
• Create parts
• Combine into assembly
•
•
•
•
Design Modeler
Define flow channels
Set material properties
Name parts
Combine
into single assembly
Meshing
Figure 18. Geometry workflow
3.2 Meshing (Please note I struck this entire section because there is no reason to use the
workbench meshing program. It does a poor job of meshing in this application. Skip to the next
section and mesh using ICEMCFD. –Adam (Oct 2012)
Once the geometry is created it must be broken up in to computational cells for the
solver in a process known as meshing. First, the boundaries of the simulation should be
defined. The boundaries define where inputs and outputs, such as reactant and exhaust
gasses, will enter and exit the simulation. These boundaries include the inlets, outlets and
terminals. For these fuel cell simulations, all of the boundaries are defined by surfaces. There
are many different programs available to mesh a geometry.
Two different programs are discussed here and it is recommended that the workbench
mesher only be used for very geometries which contain bodies that have constant cross
sections through the entire body. Despite this limitation, the workbench mesher is extremely
easy to use and can generate a high quality mesh. Complicated geometries require using
Ansys ICEM CFD to perform the meshing operation. This program requires many more
parameters to be specified using a complicated interface but it has many more powerful options
which ensure that a high quality mesh can be created on virtually any geometry regardless of its
complexity.
3.2.1 Meshing with Ansys Workbench
Ansys Workbench meshing is a fairly intuitive program but it suffers from a lack of
versatility and it is only able to generate meshes for very simple geometries. Start by opening
the Workbench and starting from a blank project. Add a meshing module to the project
schematic. Bring the geometry into the schematic by right clicking on the geometry component
and importing the geometry file. After the geometry is selected, update the project to send the
geometry to the meshing module. If the mesher does not automatically open, double click on
the meshing component.
Figure 19. Workbench meshing tasks.
After Ansys Meshing starts up, it may ask for some initial set up information. For the
physics preference choose CFD. For the mesh method, leave it as automatic. These start
options can be adjusted later in the process if necessary. Additonal information about the
startup options can be found in the help files.
Once your geometry is open in the mesher, the first step is to define the boundaries by
giving them specific names. Begin by using the face select tool, then click on the face which
represents the anode inlet then right click and choose “create named selection.” The following
naming convention should be used for the inlets and outlets:
Table 2
Naming conventions for boundary surfaces
Surface Function
Named surface
Anode flow channel inlet (hydrogen)
massflow_inlet_a
Cathode flow channel inlet (air/oxygen)
massflow_inlet_c
Anode flow channel outlet
pressure_outlet_a
Cathode flow channel outlet
pressure_outlet_c
Anode side electrical contact
terminal_a
cathode side electrical contact
terminal_c
The terminals are generally defined as the top and bottom surfaces of the current collectors.
Figure 20. Creating named selections.
A named selections section will show up under the project tree showing the names of
the named selections. Ansys provides a tutorial on creating named selections, as well as many
other topics, in the help files. Creating the named selections now will greatly ease the
simulation setup later. The imported mesh will automatically designate these surfaces as
boundaries and assign them the correct boundary conditions when the mesh is imported into
the solver. In figure 29 the fuel cell has been arranged in a counter-flow pattern. The
arrangement of the inlets causes the gasses in the anode and cathode to flow in opposite
directions.
Figure 21. All named selections have been generated.
There are many different meshing strategies, all of which aim to decompose the
geometry into computational cells. A fuel cell is a three-dimensional object created from a
series of two-dimensional surfaces. The general meshing strategy involves first creating a
surface mesh out of quadrilaterals or triangles. These surface mesh elements are then
extended into the volume of the body through various algorithms. These volume elements can
be either hexahedral (cubes) or tetrahedral (pyramids).
Trying to use triangles and tetrahedrons to mesh a fuel cell is not the most efficient
method. One major issue is that it takes a much larger number of tetrahedrons to fill a volume.
The other issue is that it is difficult to control the uniformity of the volume and surface elements
when using tetrahedrons. The use of tetrahedrons is generally better for surfaces or for very
thin volumes, like sheets. By default, the program will create a tetrahedral mesh of the current
collector and a hex mesh of everything else. This can be verified by hiding the current
collector(s) from the geometry window and inspecting the MEA and flow channel bodies.
Figure 22. Workbench meshing using a fully automatic method.
Further inspection can be performed by making a section plane through the meshed
geometry to view the internal of the mesh. Use the select plane tool and drag it across the
geometry window to generate a select plane. The tool will slice the geometry in the direction
drawn so reorient the window to give the desired cross section. It can be more illustrative to use
the “show whole elements” feature. With or without whole elements, this is not a very uniform
volume mesh. Close inspection of the GDL will show that this layer has non-uniform
tetrahedrons that will make accurate predictions of the flow of gasses through that geometry
very difficult. The other important thing to note about these images is that the cell sizes are very
large, especially in the flow channel.
Figure 23. Using the select plane tool to inspect the volume elements of a mesh.
In order to avoid creating tetrahedrons the hex dominamt method should be specified.
This method will force the mesher to attempt to use hexahedral cells instead of tetrahedrons.
This can be done by clicking on the mesh control button and adding a method. Click on the
method and look at the details window and change the method to hex dominant from the pull
down. Use the body select tool and select the two current collectors. Press the lightning bolt
icon to regenerate the mesh. This should produce a hex dominant mesh on the current
collectors. Inspect this mesh using cut planes. It should be slightly more uniform but it’s clear
that many of the hex elements are irregularly shaped. One would expect that a highly
rectangular geometry such as the current collectors could easily be represented by uniform
cubes.
Figure 24. Results of using the hex dominant method.
The main problem is the complexity of the current collectors’ geometry and the way that
volume meshes are generated. There are many more options which can be explored for
workbench meshing. including minimum and maximum size functions in order to increase the
resolution of the mesh. Other mesh methods, such as sweep and multi-zone, can be powerful
methods for certain applications.Unfortunately, this is not one of them. This multi-body part has
two major limitations which make decent mesh with this program impossible. The first is the
geometrical complexity of the current collector, and the second is the multi-body interface
experienced by the current collector.
I spent a lot of time working with just the current collector to try to mesh it into uniform
hexahedral cells. It is not a simple task. Using a lot of forced edge-sizing parameters and
careful size definitions, a high-resolution mesh can be generated, but the elements are low
quality, which could lead to solution convergence issues. The hex mesher is also very slow
compared to other meshing methods. Attempting to combine my successful hex meshing
techniques used just for the current collector with a meshing scheme for the entire fuel cell
resulted in hours of calculations, which ultimately resulted in an error and no successful mesh.
The other issue seems to be that the current collector has an interface with both the
GDL and the flow channel. This mesher does not seem to be able to handle multiple interfaces
using anything other than tetrahedral meshing. If the current collectors are removed from the
geometry then the remaining parts can be meshed very effectively using any of the hexahedral
volume meshing techniques (such as sweep or multi-zone).
In order to use Workbench Meshing you must settle for a final mesh in which the current
collectors are meshed using tetrahedrons and the other parts are created from non-uniform
hexahedral elements. This can be acceptable for very small simulations, but once the geometry
becomes more complex, the workbench mesher is impossible to use. Some examples of failed
meshing follow.
Figure 25. Increasing the mesh resolution only increases the problems with tetrahedral
meshing in the current collector.
Figure 26. Attempting to control the sizing in the GDL. GDL layers not uniformly respecting
edge sizing controls leading to cell squishing near the corners.
Figure 27. Pinching in the corners and overall non-uniformity
Figure 28. Non uniform surface elements. Strict edge sizing parameters were in place but
tetrahedral elements are created in the GDL.
Figure 29. Hexahedral meshing of a 7cm x 7cm parallel flow filed geometry. Highly nonuniform hex volume elements being created in the GDL leading to mesh singularites and nonconvergent simulations.
Figure 30. Another mesh with very poor element uniformity.
Figure 31. Non-conformal mesh between bodies. The vertices of the mesh elements do not
line up indicating that there is no interaction between bodies.
I spent many weeks attempting to overcome the shortcomings of the meshing program
and I contacted some people who were familiar with the software at the CFD-online.com
forums. The results of the discussions led me to conclude that the workbench mesher is simply
unable to create uniform hexahedral meshes on a geometry as complex as a fuel cell. Another
program was recommended by the author of a paper using Ansys Fluent to model a fuel cell.
Meshing with ICEM CFD
Ansys ICEM CFD 12.1 is a much more powerful, but far less user-friendly meshing
program. It seems that many of the features of ICEM CFD were supposed to be included in the
workbench meshing program, but that they didn’t incorporate any of the hexahedral meshing
algorithms. It looks like the workbench mesher is Ansys’ attempt at making an intuitive, easy to
use meshing system that’s integrated into the workbench project schematic. To Ansys’ credit,
the workbench mesher is easy to use. However, it suffers from a lack of versatility and an
inability to handle geometries of any degree of complexity. A recent release of Ansys software,
version 13.0 supposedly has many additional features. At the time of this writing I do not have
access to that software.
In order to begin with ICEM CFD first you must prepare the geometry. The same
geometry that was created using the workbench design modeler can be used in ICEM CFD with
a little bit of extra work. Go through the steps in part 3.1 to fill in the channels, then export it as
a Parasolid binary. From the file menu of the design modeler, select “Export…” then choose
Parasolid binary as the save as file type. This type of file will preserve the part names, unlike
IGS or STEP files.
Figure 32. Export the geometry from Design Modeler as a parasolid binary so it can be
imported into ICEM CFD.
The first step is to run Ansys ICEM CFD. The version I was using would immediately
throw an error about not having access to My Documents if it was not run with administrator
rights. This was not a major issue and the program can be run without administrator rights, but
it does illustrate the typical experience when using ICEM CFD; plenty of seemingly random
errors that aren’t important enough to stop you from meshing. For example, it opens two
program windows, but one is an empty shell. However, closing the empty window closes the
working window. ICEM CFD is an unpolished piece of software, especially when compared to
the workbench mesher. However, if far outperforms the workbench mesher in terms of
efficiency and accuracy.
After you get ICEM CFD running, you can go to the file menu and go to import geometry.
Then select Parasolid and browse to where you exported your geometry from the design
modeler. The details window will show up and ask for units and file names. Accept the defaults
as these settings do not matter and will be changed at a later time.
Figure 33. ICEM CFD import a Parasolid geometry.
Once the geometry has been imported, there should be several new subtrees under the
model tree. The geometry tree is used for viewing the geometry, while the parts tree is used to
show, hide, or create new parts. 9 new parts should show up under the parts tree with the
names given in the Design Modeler, and a wireframe geometry should show up in the viewport.
If you didn’t fill in the channels as specified in section 3.1 then you may only see 7 parts and the
channels would be missing.
Figure 34. Imported geometry with all the parts named.
The next task in the workflow is to set up the mesh boundaries. This is similar to the
named selection exercise in the workbench mesher. First you must enable surfaces by
expanding the geometry tree and checking the surfaces checkbox. It can help to right click on
the surfaces field and select “Solid” from the context menu. This will make the surfaces solid
and opaque so you cannot see through them. Next, right click on the parts tree and select
“create part” from the context menu. The selection interface takes some getting used to. The
first part to name is the anode channel inlet. Type “massflow_inlet_a” into the part name field
then click the entity select button which brings up the geometry select interface and toolbar.
Right click on the surface(s) you want to be associated with the part name.
At this point, be careful to only click once because you can ‘click through’ entities and
select entities which are behind/under your target geometry. Right click the mouse to cancel
any mistaken selections and continue right clicking if you want to exit the entity select interface.
Once you have your inlet selected, middle click to confirm the selection. The new named part
should show up under the parts tree and un-checking it should make the part disappear.
Figure 35. Un-selecting a part will hide it. Use this to verify that the part was associated
correctly.
Repeat the naming process to create all of the boundary surfaces using the naming
convention specified in table 1. It is helpful to have the camera normal to the surface you are
attempting to select. If the camera is not normal, then you are much more likely to click through
the surface and select something behind it. Exercise extreme caution to ensure that only one
surface is associated with the part name, or else you will create serious problems that will
ultimately render your model useless. Removing named parts is a tedious process which
should be avoided. The best way to fix an unwanted part association is to start the naming
process from the beginning and not make the same mistake twice.
Now that the named surfaces have been created, material points must be defined to
associate the volume of a body with its surfaces. The fastest way to accomplish this is to first
create a one-dimensional point element within the volume of each body, for a total of nine.
Begin this process by turning off surfaces by un-checking the surfaces option under the
geometry tree. Next, select the geometry tab and use the create point tool (the first tool).
Under the create point toolbox, use the screen select method (the first tool again). Set your
viewport so that you are looking directly normal to an inlet or outlet. Create four points, one in
each current collector and one point in each flow field. Set the point away from any nearby
edges or points so that the created points do not automatically snap to nearby existing
geometry. Middle click to accept the new points. Rotate the geometry to ensure the points
were created within the volume of the geometry, not just on the surface. Zoom-in to create
points in the MEA components. Zoom-in enough to prevent the points from being created on
existing geometry. It doesn’t matter where within the volume the points are created, as long as
they are within the volume of the appropriate part. You should end up with nine points total, and
one new part on your parts tree called GEOM.
Figure 36. Create points within the volume of each body. Rotate the camera to verify the points
were not created on the surface.
The geometry points make it much easier to generate material points. They will be
placed directly on top of the created geometry points using a process very similar to the named
parts strategy. The reason for creating geometry points first, rather than immediately creating
material points, is that material points have a tendency to stick to the surface of the geometry
where geometry points will be placed within the volume. If you do not generate material points,
then the mesher will only generate a mesh on the surface.
Click the create body tool under the geometry tab (fourth tool on the list) and select
material point. I usually start from the top, but the order doesn’t matter. Name the material
points by adding _VOL to the corresponding part name to indicate that the material is marking
the internal volume of the body.
Table 3. ICEM CFD material point naming convention.
ICEM CFD Material point names
current_a_vol
channel_a_vol
gdl_a_vol
catalyst_a_vol
membrane_vol
catalyst_c_vol
gdl_c_vol
channel_c_vol
current_c_vol
Choose at specified point for the location, type in the part name, activate select point mode by
pressing the select point button, then select the corresponding point and click the middle
mouse button to confirm. A cross shaped material point will appear on top of the geometry point
along with the name of the new material point. Repeat this process until allnine of the material
points have been specified. Move the camera and zoom-in to verify that the material points
have been placed in the right places and that they are within the volume of the appropriate part.
When you are confident that the material points are placed appropriately, the GEOM part, which
contains the original points can be deleted.
Figure 37. Creation of material points on top of existing geometry points.
The final geometry should contain all of your named surfaces, material points, and
original parts. Figure 43 displays a complete listing of the geometry that should appear in the
parts tree. If the geometry has all of these parts, the geometry should be saved for future
reference. Having a backup copy of the prepared geometry will create a good restarting point if
something goes wrong later in the process. It is good practice never to use spaces when
naming projects with this program. Having spaces in the project name can lead to errors later in
the project. To backup the geometry, simply save the project as
“descriptive_title_geometry_backup,” or similar name. Then immediately save it again with a
descriptive title that contains no spaces and continue working.
Figure 38. Complete listing of all parts that should be included in every fuel cell geometry prior
to starting to mesh.
There are tutorials available on the Ansys customer portal and on Youtube.com that give
some information on how to do blocking. These tutorials are not specific to fuel cell meshing.
The purpose of blocking is to designate different areas of the mesh that should be meshed
differently. Blocking is a way to control which areas of the mesh are finer and which areas are
left coarser. An initial block is created and then split into several individual blocks, with each
new split block corresponding to a different region of the fuel cell. Many fuel cell designs have
very simple geometries which are relatively simple to block.
Begin blocking by selecting the blocking tab and using the create block tool. Press
apply to generate an initial block which occupies the entire inner volume. This initial block
serves as the base from which all of the next blocks will be spawned. The process is very
similar to slicing a loaf of bread where in you start with a solid mass of bread and split it until you
have several individual pieces. This process allows for the ability to perform various operations
on one piece of the whole without affecting the entire original entity.
Figure 39. Creating an initial block.
Once the initial block is generated, it can then be split by using the split block tool.
Splitting works by choosing an edge, and then designating where along that edge the split
should be placed. Change your camera angle so that you are looking normal to the front face of
the geometry as shown in Figure 48. Change the split method to prescribed point and press
the select edge button to activate select mode. Then, select the left vertical wall edge of the
fuel cell geometry. Be sure that points are visible in the geometry or else you will get an error.
Turn on points by selecting the points subgroup under the geometry tree. The wall will turn red
once selected. Now choose the top right corner point of the flow channel and the block will
split along the left edge at that point. Select the left-most edge again and choose another split
point. It helps to zoom-in on the geometry in the MEA to select the proper point.
Figure 40. Split block created using the prescribed point method
An error of “split value must be between 0.0 and 1.0” can occur if the you attempt to split
the wrong edge. Be sure that you are choosing a part of the edge that has not already been
split. It can be very difficult to see the lines indicating the edges of the created blocks because
they overlap with lines indicating geometry. Once all of the splitting has been completed the
blocks can be inspected visually by turning off all geometry parts and turning on the VORFN
part which corresponds to the blocking geometry. There should be a total of nine blocks, one
for each part of the MEA, one block which overlaps the flow field and current collector ribs, and
one block for just the current collector top. Sometimes the VORFN part will display a lot of other
seemingly useless parts, which makes it very difficult to visually inspect the proper existence of
the blocks. Another method to verify blocks comes in the next step, edging.
Once the blocks have been created it is possible to change the number of nodes at each
edge of the block. Changing the edging parameters is one of the fastest and easiest ways I’ve
found to control the sensitivity of the mesh. Begin by first turning on edging by expanding the
blocking section of the model tree and right clicking on edges and selecting counts from the
context menu. This will cause a bunch of numbers to show up in the viewport which correspond
to the number of nodes for a particular edge of a block. The number 2 which appears by default
corresponds to there being two nodes for each edge, one node at each end of the line.
Figure 41. Turning on edging by selecting Counts from the context menu
After blocking is completed, it is good practice to create another backup save of the
project. Again, be certain that there are no spaces in the project name. Blocking is created
based on the geometry, but it is also fully independent of the geometry so that a blocking
scheme can be opened up in a separate geometry. With fuel cell models, this means that if the
physical dimensions of the geometry match an already created blocking scheme, the blocking
scheme can simply be imported thereby saving some time. The blocking strategy discussed so
far is very simple and it is generally a trivial matter to generate a new blocking scheme for a
different fuel cell geometry rather than to import an existing one.
With the blocking completed, it is time to consider the size parameters of the mesh and
to decide how sensitive you want the mesh to be. The numbers for the mesh sizing of this
demonstration geometry in this instruction set are arbitrary and shouldn’t be considered a best
practice. It is necessary to have a mesh sensitivity analysis performed for each fuel cell
geometry to determine how fine the mesh elements must be in order to produce consistent
results.
Select the pre mesh params tool from the blocking tab. Leave the meshing parameters
value as update all and choose the edge params tool. This tool will allow you to pick an edge
and specify the number of nodes on that edge. The total length of the edge is displayed and
corresponding lengths of the individual mesh elements after resizing will be calculated
automatically and displayed. The number of nodes and corresponding element sizes can be
estimated based off some published work, but each geometry is different and has to be verified
separately.
Figure 42. Using edge sizing parameters to set the size of individual meshelements. A 32mm
long edge with 33 nodes corresponds to individual element sizes of 1mm.
The required element sizes depends on the type of simulation and the accuracy of the
results. There is a required minimum mesh element size in order to accurately capture the
geometry. This size varies on the particular geometry of the simulation. For example, if a flow
channel has a width of 1mm and a land area of 1mm, then the mesh size must be at most 1mm,
or else a single mesh element may capture both the flow channel and land area, which will lead
to a very poor simulation. This phenomena can be seen in appendix F, ICEM CFD Meshing
failures. A coarser mesh is faster to simulate and less hardware intensive, but could still
produce results adequate for the purposes of the study. The idea is to generate a mesh that
has as many elements as is necessary but that also has as few elements as possible in order to
minimize possible errors in the simulation. A mesh sensitivity analysis should always be
performed or referenced to determine the minimum number of elements required for consistent
results between different meshes.
In this demonstration, mesh elements will be set at 1.0mm in the X and Z directions and
“6” nodes will be used in the Y direction (height) for every blocking zone. ICEM CFD text log
may display some errors regarding failing to mesh certain edges. I have never found these
errors to be fatal and they can be ignored.
Figure 43. Edge sizing parameter set with expansion of MEA layers showing 6 nodes in the Y
direction for each blocking zone and a phantom 2 that doesn’t define anything in the model..
Figure 44. Showing the 121 nodes in the Z direction corresponding to 1.0mm element sizes.
After the edge sizing has been completed, a backup of the project should be saved
again. In order to mesh these geometries, the Cartesian grid method will be employed. The
Ansys customer portal offers a tutorial on the Cartesian grid method, which may be helpful to
view but isn’t necessary to understand how to use it. The idea of the Cartesian grid method is
to use the blocking and edge sizing parameters to create a grid which defines the boundaries of
every mesh cell. The geometry is then decomposed into individual volume elements as
specified by the grid. Interfaces are generated where the bodies meet and as long as the grid is
sufficiently fine, the geometry should be preserved. This method works very well because these
geometries have no curved surfaces and all of the interfaces are faces that areparallel to a
coordinate plane.
Begin the process by writing a Cartesian grid by using the file menu, selecting blocking
and then selecting write Cartesian grid. If ICEM throws an error with no message, then there
is probably a space in your file name. This is a very strange bug and it was incredibly difficult to
figure out what made it appear. However, should you encounter this type of error indication,
remove any spaces from your project name and try writing the grid again.
Figure 45. Writing the Cartesian grid.
Next, select the mesh tab, choose the global mesh setup tool and select volume
meshing parameters. Change the mesh type to Cartesian, change the mesh method to
body-fitted and change the projection factor to 1. The projection factor determines how
closely the edges of the mesh match up with the grid. Since this geometry is highly normal and
the faces match up exactly with the coordinate planes, the edges should match up perfectly
without the need for any projection. More information about these parameters can be found in
the ICEM help files.
Figure 46. Setting the mesh type.
Next, select the compute mesh tool. The volume mesh should be selected by default.
Change the mesh type to Cartesian, change the enforce split to final, which will cause the
Cartesian file box to appear, and select your Cartesian grid file. This file should have the same
name as your project with a .crt file extension. Then click compute and mesh generation will
begin.
It is possible to get an estimation of the number of elements by simply multiplying the
overall dimensions of your edges. This demostration cell had dimensions of 120x32x45, which
would create a total of 172,800 hexahedral volume elements. This number does not correspond
exactly to the number of elements reported because the mesher respects the geometrical
boundaries between parts. A mesh element cannot occupy two geometrical bodies
simultaneously, so at body interfaces an overlapping mesh element may be split into two or
more smaller elements.
Once your mesh has been successfully generated, inspect the various faces to ensure
that the mesh has been generated according to your edge sizing. This is especially important in
the MEA layers. Use the camera to rotate the mesh and ensure that volume elements have
been created in the appropriate zones. Turning-off volume elements of the mesh by unchecking volumes under the mesh tree can help speed up inspection of the number of divisions.
Figure 47. Generated mesh with highly uniform surface elements showing divisions in MEA
correspond to specified number of nodes.
One good way to visually inspect the mesh is to turn-off all parts then turn them back on,
one at a time. The mesh elements should look uniform, with all of the volume parts being
present, with no spill-over into other zones, and there should be no pinched or extremely
crooked elements. A certain number of bad elements may be acceptable, but the higher quality
your mesh is, the better the results of your simulation will be. After a visual inspection, the
mesh elements can be checked for quality using a built-in tool.
Figure 48. Views of the anode flow channel from the right, top, front and isometric. Mesh
elements are highly uniform with no obvious deformations.
When you are satisfied that the mesh generation has behaved as expected and that all
parts are present, then you can use a built-in tool to check for errors in the mesh. Begin by
selecting the edit mesh tab, then choose the check mesh tool. The tool has a checkmark over a
green meshed cube. The check mesh has a number of features. The most important are the
volume element error checks. The details and explanations of what each error check does and
its criteria can be found in the help file. Leave all of the default settings and click apply run the
check. The only problems that should be reported are multiple edges. This means that one
face is shared by two elements in different bodies. This is acceptable because there should be
interfaces between the different bodies of your fuel cell. The errors which can happen that will
make it impossible for the simulation to converge or even load properly are “volume
orientations” and “missing internal faces.”
Errors with volume orientations mean that your volume elements somehow got wrapped
inside out. This type of error is rare but will cause the mesh to fail to be imported when brought
into the solver. This type of error can occur occasionally if the mesh elements are too large to
capture the geometry. If the number of broken volume elements is very small, it is possible to
edit the nodes of individual elements to attempt to fix it using the tools on the edit mesh tab.
However, I’ve found that since the individual elements are invariably attached to other elements,
fixing one element means breaking one or more other elements.
Figure 49. Examples of a hexahedral cell with regular and inverted volume.
Missing internal faces is a rare error that has to do with a bad geometry. If the geometry
is missing a face between bodies, then if the mesh even succeeds in finishing, then the
interface between the bodies will be broken. I received this type of error when I attempted to fix
a misnaming of a part during the surface body naming operation. Deleting the named part
deletes the underlying faces from existence. If the mesh is already generated then the
disappearing surface will take some internal faces with it.
Once you have created a mesh that passes all of the volume checks, it is a good idea to
check the quality of your elements. From the edit mesh tab, choose the quality tool. Keep the
default parameters and click apply to perform the check. The tool will generate a histogram and
a color key showing the occurrence of the various quality categories. The goal is to have as
many of your mesh elements as close to 1.0 as possible. Clicking on a bar will show in the
graphic window where those elements appear in the model. Clicking the bar again will deselect
that category.
Figure 50. Histogram of element quality.
The meshing check turned up a few hundred elmenets with quality values less than
0.90. Upon closer inspection, they seem to be related to that phantom 2 that appeared in figure
49. This will probably lead to problems later because all of the elements with quality less than
0.9 are in this same grouping of bad elements that are all located around the edge of the
cathode current collector. Since this geometry is perfectly symmetrical, I would expect to see
this same pattern on the anode current collector. It doesn’t appear there, which seems to
indicate that there is something wrong with the mesh parameters. My theory is that the
phantom 2 in the blocking is responsible for these mesh anomalies, which makes remaking the
block the only viable solution to correct for the phantom 2 and the resulting mesh anomalies.
At this point the project needs to be reverted to the backup geometry and all of the blocking
procedures and meshing will need to be redone. After the blocking was redone, the quality
report shows that all elements now have a quality better than 0.9. This is the ideal situation.
Once a high quality mesh with no errors is generated, it needs to be prepared for export
into the solver. Begin this process by selecting the output tab, use the select solver tool and
choose fluent_V6 as the output solver. Use ANSYS as the common structural solver and click
Apply.
Figure 51. Choosing the output solver.
Next, open up the boundary conditions tool. A new window will appear. This is the
interface where you specify the types of materials and boundary conditions sometimes referred
to as bocos. Begin by expanding the volume and mixed/unknown groups. Select
CURRENT_A_VOL under the volume group. Click on create new then choose solid as the BC
type and click okay. Repeat this same procedure for CURRENT_C_VOL and set its type to
solid. The rest of the volumes need to be fluid, but the solver sets them as fluid by default so
they do not have to be explicitly defined as fluid.
Figure 52. Setting up boundary conditions.
Expand the Mixed/unknown category and choose MASSFLOW_INLET_A and set its
boundary condition type as “mass-flow-inlet.” Repeat this process for MASSFLOW_INLET_C.
Next, set PRESSURE_OUTLET_A and PRESSURE_OUTLET_C to boundary type “pressureoutlet, exhaust-fan, outlet-vent.” Leave the Zone i.d. as its default value as this will be
automatically assigned when imported into the solver. Any volume that isn’t explicitly defined
will be set as a fluid by default. Any other surface that is not explicitly defined will automatically
be set as a wall. Finally, click on accept to finalize the changes.
Figure 53. Summary of boundary conditions.
After all of the boundary conditions have been set, it is possible to export the mesh so
that it can be read into the solver. Choose the Write Input tool and press okay to save the
project. The program will prompt you to select the unstructured mesh associated with the
project. It should default to the name of the project with the .uns file extension. This is the file
that contains information about the structure of the mesh and it will be used in conjunction with a
list of boundary conditions to generate a mesh that can be read by the solver. After selecting
the correct .uns file, the program will prompt you to select some options. It should automatically
choose the boco file associated with the project which contains all of the relevant boundary
conditions. Give the output file a descriptive name so you have some idea of what the mesh is.
I usually include some information related to the number of elements in the mesh. It is very
likely you will be generating several meshes in order to perform a mesh sensitivity analysis, so it
is good practice to always use descriptive names.
Figure 54. Dialog to export the mesh.
Setting up the solver
Meshing of the geometry using ICEM CFD is now complete and the mesh is ready to be
read into the Fluent solver. Begin this process by starting up Fluent. The startup splash screen
will pop up. Choose 3D and select double precision and serial processing. Parallel processing
requires a few extra setup steps which can be done at a later time in preparation for a parallel
job. Before any simulation can be started, the mesh needs a few additional preprocessing
checks and fixes before the simulation will run properly.
Once the Fluent window opens, from the file menu select read > mesh and use the
graphical interface to navigate to your saved mesh. Text commands are available for all steps
described in this section. These commands can be typed into the Text User Interface (TUI) in
the fluent window, or if Fluent is run without the graphical interface. The most important of
these commands will be discussed in the job scripting section.
Once your mesh is read in successfully, it will display a wireframe model in the graphics
window of Fluent. Inlets and outlets will be colored red and blue.
Figure 55. Mesh successfully read into Fluent without error.
The first check to perform is to ensure the mesh has the proper dimensions. Click on the
general section then press the scale button. Be sure that the dimensions displayed match the
dimensions of the geometry. It’s very possible that the mesh will be imported in meters, and the
scale factors can be off by an order of 1000 or more. Use the scaling tool to rescale the mesh
to the proper dimensions, if necessary.
Figure 56. Check the scale of the mesh to ensure the dimensions are correct or scale
accordingly.
The next check is to ensure that all of the mesh zones are present and that their material
properties are set correctly. Open the Cell Zones Conditions group and examine the list to
ensure that all 9 zones are present. If there are more or less than 9 then a major error in the
meshing has occurred. The current collector volumes should be solid and all other volumes
should be fluid. This was supposed to be set in the boundary conditions of the meshing, but if
there was an error, it can be fixed here by selecting the correct material from the Type pull
down menu.
Figure 57. Setting cell zone conditions.
With the mesh scale verified, all of the cell zones, and their material properties set
accordingly, the mesh interfaces need to be adjusted. One complication with ICEM CFD is that
the mesh interfaces have to set manually. The process for doing this in ICEM CFD is long and
complicated and involves setting part names to every interface in the fuel cell and then setting
the properties of those materials to internal walls. The parts naming process in ICEM CFD is
very time-intensive and prone to error so I perform the interface setup in Fluent.
Start by selecting the boundary conditions group. A list of every entity in the mesh will
be displayed. You should see several wall-shadow entities. When the mesh was generated in
ICEM CFD, all of the internal walls were shared walls, much like rooms in a house. When the
mesh is imported, Fluent automatically splits all zones into separate zones separated by nonshared walls. This process involves splitting a shared wall into separate walls and a
wall/shadow-wall pair is created. As I stated before, this behavior is unwanted and it can be
prevented with a lot of extra work in ICEM CFD, so it is easier to fix it in Fluent. There should
only be a wall/shadow-wall pair at interfaces between solids and liquids. These interfaces only
exist between the flow field and the current collector and between the current collector and the
GDL.
The base wall of every shadow-wall pair should be changed to an interior. Do this by
selecting either the shadow wall or its base, and change the type to interior from the pull down.
The other half of the wall will automatically be deleted. This will force Fluent to merge the wall
pair into a single wall which is the desired boundary. Setting the boundary to an interior allows
materials, such as gasses, to pass through the interface. If the shadow wall is part of a
solid/liquid interface, then Fluent will not allow the wall to be changed to an interior and it will
give an error. Go down the list in the boundary conditions and change all of the walls with a
shadow wall pair into an interior. Be carefully to only change walls that have a matching
shadow wall to interiors. Changing non-interior walls to interiors will be disastrous for the
simulation as you will have just created gigantic holes out of which any gasses will leak.
all the interior walls have been set, the fuel cell module can be loaded and the simulation
parameters set.
Once
Figure 58. Boundary conditions showing many wall/shadow-wall pairs which need to be
merged.
Figure 59. Attempting to merge walls between solids and liquids results in an error. This is
appropriate as you do not want to change those walls.
Figure 60. Final listing of walls. With a proper mesh there should be 4 wall/shadow-wall pairs.
One set for the interfaces between flow channel and current collector and current collector and
GDL for each side of the fuel cell.
Figure 61. Display of the anode shadow walls. They should only exist at solid/liquid interfaces.
At this point it is a good idea to save your project. Do this by clicking the file menu and
write the case name. These files names can contain spaces. Include some information in the
case name about the type of mesh and indicate that it’s a pre-module setup. I used the name
“serp200kdemo noFC”. This will save all of your interfaces thus far. This case is useful
because it serves as a useful backup point. It contains all of the work done in ICEM CFD, with
all of the additional meshing steps input so that this file is ready for simulation parameters.
Begin the simulation setup by loading the fuel cell module. This is accomplished by
typing the following command into the Text User Interface (TUI) and pressing the Enter key./
define/models/addon-module 3
Figure 62. Type the command to load the fuel cell module into the TUI
Once the module is loaded, it’s a good idea to first test the mesh with the default
settings. Before anything can be done, the basic parameters have to be set. Start by selecting
the models group then double click on the Fuelcells & Electrolysis – PEMFC group to open the
model properties. Leave everything at default for now and go to the anode tab. Select the
current collector under the anode zone type, then select the corresponding zone from the list
that appears. If you used the suggested naming convention, then it will appear as
current_a_vol. Continue assigning the mesh zones accordingly for the anode tab, then
continue to the membrane and then the cathode tabs. It is possible to select multiple volumes
for a single zone, but since we generated a good mesh this should not be necessary. Be
careful to only have one volume selected for each zone or else your simulation with fail.
Figure 63. Opening the fuel cell module and setting the fuel cell zones.
Leave everything under the advanced tab at default values for now. Select the reports
tab and chose your external contacts. The anode external contact should be set as terminal_a
and the cathode should be terminal_c. It is fastest to calculate the electrolyte projected area
manually based on the geometry of your membrane. There is a way to have Fluent calculate
this value which is discussed in the tutorial. This tool could be useful for a more complex
geometry. The demo cell was 32mm x 120mm which corresponds to .00384 m2 area, which is
what is entered into the area field. Click okay to accept changes.
Figure 64. Set your external contacts and the membrane area.
Other model parameters can be adjusted at a later time. Right now the purpose is to get
a simulation running to make sure it works. The boundary conditions of the cell must now be
set. There are 6 boundaries conditions that must be adjusted. These are the inlets for the
anode and cathode flow channels, outlets for the anode and cathode flow channels, and the
anode and cathode terminals. Begin with mass_flow_inlet_a since they usually appear closer to
the top of list of boundary conditions. Start at the momentum tab and set the inlet mass flow
rate according to the expected current draw. For testing I usually just put 1e-6, as that’s
sufficient. For future simulations this number should be carefully calculated to include the
effects of humidity, stoich and utilization. Set the direction specification to Normal to
boundary.
Figure 65. Configuration of Mass-Flow Inlet.
Under the thermal tab, set the temperature to 333K. This is a typical operating
temperature for a fuel cell. Under the species tab, set hydrogen to 0.5 and H 2O to 0.5. This
value corresponds to a 100% humidified inlet gas. You could also check the box to input the
species as mole fractions. This would automatically change the ratios to 0.9 hydrogen and 0.1
for water. The two values are equivalent. The sum total of all the mass factions must add up to
1.0.
Figure 66. Species settings for massflow_inlet_a.
Next, open the UDS tab and set the water saturation value to specified value and leave
number as zero. The tutorial and the Fluent Fuel Cell manual both instruct to set this value to
zero. Repeat this process for the cathode mass flow inlet. Set the cathode inlet mass flow rate
to 5e-5 with the direction specification set to normal to boundary. Set the temperature to 333k
and then set the oxygen mass fraction to 0.18 and the water mass fraction to 0.15. These
values correspond approximately to 100% humidified air. Finally, set the water saturation under
the UDS tab to a specified value of 0.
Figure 67. UDS settings for the anode mass flow inlet.
Table 4. Selected mass flow rates required for specified total current
Current (A) H2
1
1.04E-08
2
2.08E-08
3
3.13E-08
4
4.17E-08
5
5.21E-08
10
1.04E-07
15
1.56E-07
20
2.08E-07
25
2.60E-07
30
3.13E-07
35
3.65E-07
40
4.17E-07
kg/s (Stoich 1)
O2
air
8.33E-08
3.57E-07
1.67E-07
7.14E-07
2.50E-07
1.07E-06
3.33E-07
1.43E-06
4.17E-07
1.79E-06
8.33E-07
3.57E-06
1.25E-06
5.36E-06
1.67E-06
7.14E-06
2.08E-06
8.93E-06
2.50E-06
1.07E-05
2.92E-06
1.25E-05
3.33E-06
1.43E-05
Next, set the boundary conditions for the pressure outlets. Edit pressure_outlet_a and
set the backflow temperature to 333K under the thermal tab, then set the water saturation to a
specified value of 0 under the UDS tab. Repeat this process for the cathode pressure outlet.
Now set the boundary conditions for the terminals. Edit terminal_a and under the thermal tab,
select temperature and set to 333k. Under the UDS tab set the electric potential to specified
value and leave the value at 0. Edit terminal_c and set the temperature to 333k but under the
electric potential, set a value of 0.9. This value needs to be less than the open circuit value.
This is the value that will be adjusted in order to generate the various data points for your
simulation.
A total of 6 boundary conditions should have been set and all can be set to the same
temperature to simulate a constant temperature during operation. If heat transfer is part of the
simulation,heat flux rates can be set at the external walls if desired.
Figure 68. UDS parameters of terminal_c.
Next in the process is to set up solution controls. These controls help ensure solution
convergence by employing different computational techniques. The solution guidelines from the
Ansys Fuel Cell module suggest using these controls to help convergence. The exact function
of these different solution methods is described in the Fluent manual. The fuel cell tutorial also
recommends setting the under-relaxation factor for the water saturation to 0.95, which can be
found under the solution controls group, near the bottom. Next, click the advanced button to
bring up Advanced Solution Controls. Change the multigrid cycle type to F-Cycle for all
equations. Change the termination restriction to .001 for h2, o2 and h2o and water saturation
and change the stabilization method to BCGSTAB. Set the termination restriction to .0001 for
electronic and protonic potential and set the stabilization method to BCGSTAB. Finally, set the
max number of cycles to 50 under the Algebraic Multigrid Controls. Click OK to accept the
changes.
Figure 69.
Advanced solution controls
Next, open the solution initialization group. Scroll down to temperature and put 333 and
press enter to accept the change. Then click on the initialize button. The simulation is now
ready to run. Open the run calculation group and type 10 into the iterations box and press enter
to accept. Then press the calculate button. The solver should begin working. The I_anode
value and I_cathode values should come to within .05 A of eachother within the first few
iterations.
If the solution does not diverge within the next 50 iterations then it is likely that the mesh
is acceptable. Some indicators of a divergent solution are the values of I_anode or I_cathode
reaching values greater than 10 A/cm 2. Error messages such as “Absolute
pressure/temperature limited to X in zone Y” are indicators of a singularity in the mesh. The
solver will begin plotting residuals as the solution progresses. The graph should be trending
downward overall which is an indication that the solution is converging. If the residuals begin to
grow then it is likely the solution will not converge. See appendix G to see what is printed in the
console when the solution diverges.
If the reported current density values quickly drop to 0 and stay there, then a different
problem is occurring. This indicates that there is no reaction taking place within the fuel cell and
there can be a number of reasons for this. Make sure you set your voltage values to something
that would produce current. Check your inlet gasses to be sure they are set properly, especially
under the species tab. Finally double check the mesh to make sure there are no double walls
between internal parts.
I have found that nearly all of convergence errors caused by divergence can be fixed by
either fixing the scaling of the mesh, or creating a higher quality mesh. You may also try
lowering the value of the various under-relaxation factors if the solution does not reach a steady
state. If you see your residual graph oscillating as the solution progresses then you will need to
under-relax those variables. Under-elaxation factors (URFs) can help the solution converge, but
they can also cause the solution take longer to converge. Therefore, it is advisable to leave the
URF’s at their default values unless changing them is necessary.
You have now successfully set up a very basic fuel cell simulation. From this point any
number of additional parameters can be set to more accurately represent the operation of real
fuel cells. The criteria for deciding when a solution has converged varies depending on the
accuracy of the results desired. Conversations with researchers familiar with the software have
suggested a three-part convergence check, which requires calculating the current flux through
the terminals, measuring the reactant species consumption and checking the reported current
density. Additionally, it is necessary to check to see that the values of the solution are not
changing with further iterations.
Calculating the current flux through the terminals is a straightforward process which
requires typing the following command into the TUI console.
/report/surface-integrals/integral terminal_c , y-current-flux-density n
Which will generate the following output.
Integral
Y Current Flux Density
(a/m2)(m2)
-------------------------------- -------------------terminal_c
-8.3995056
This value can be divided by the membrane area to determine the current density which can
then be compared to the value reported by the residuals. Next, the mass species report can be
generated by using the TUI command
/report/species-mass-flow
This command will generate a list of the mass flux of each of the three species in the simulation
through the various boundaries.
zone
zone
zone
zone
zone
zone
zone
zone
zone
zone
zone
zone
zone
47 (catalyst_c): (0 0 0)
54 (channel_a): (0 0 0)
55 (channel_c): (0 0 0)
23 (current_c-shadow): (0 0 0)
52 (gdl_a): (0 0 0)
5 (gdl_a:005): (0 0 0)
53 (gdl_c): (0 0 0)
15 (gdl_c:007-shadow): (0 0 0)
61 (massflow_inlet_a): (2.5e-06 0 2.5e-06)
58 (massflow_inlet_c): (0 1.5708e-05 1.32e-05)
51 (membrane): (0 0 0)
59 (outlet_a): (-2.39904e-06 -2.1026266e-09 -1.1919924e-06)
60 (outlet_c): (-6.2110525e-09 -1.4959543e-05 -4.0301031e-06)
net species-mass-flow: (9.4748948e-08 7.4635437e-07 1.0477904e-05)
The three numbers following each zone represent the flux of hydrogen, oxygen and water in
kilograms/second. The net species mass flow is the total amount of each species that enters
and exits the simulation. This parameter can be used to calculate the total current generated
using the following equation and constants
𝐼=
Table 5
𝑚𝑛𝐹
𝑀𝑀
(4)
Symbols
I
m
n
F
MM
Current (amperes)
Mass flux (kg/sec)
Number of electrons transferred
Faradays constant 96485000 C/kmol
Molar mass (kg/kmol)
Using the mass flux of oxygen and the number electrons transferred per oxygen molecule which
is 4 and a molar mass of 32, the current cal be calculated
𝐼=
7.464 × 10−7 × 4 × 96485000
= 9.00 𝐴
32
This value should be compared to the absolute value of the earlier reported current density of
8.40. There is a variation of 0.6 A which suggests the solution in this case has not converged.
The amount of error between the two values that is acceptable depends on the accuracy
required. It is possible to achieve values which vary by less than 1%. The calculation can be
repeated for the hydrogen species consumption using the electrons transferred per mole value
of 2 and the molar mass of 2 kg/kmol.
𝐼=
9.475 × 10−8 × 2 × 96485000
= 9.14 𝐴
2
This value also varies from the measured current flux through the cathode by over 0.7 A.
Convergence criteria should be defined which includes verifying that species mass flux and
current flux agrees within a specified limit.
3.4 parallel processing
Setting up the mesh for parallel processing only requires partitioningthe grid. The solver
will automatically partition the grid if the parallel mode is set in the startup options, however the
default partitioning scheme is not always ideal. Usually the PEM fuel cell geometry is going to
be highly regular with faces that match up perfectly with the Cartesian planes. This means that
the most straightforward way of partitioning the mesh is by using the method called Cartesian
axes. Select parallel from the menu bar then click on partition and load balancing. Change the
method to Cartesian axes from the pull down menu and set the number of partitions to a power
of 2 then click the partition button. You can view the partitions by going to the general group
and displaying the mesh and checking the partitions option.
Figure 70. Setting up a mesh to be partitioned.
Figure 71. Mesh divided into 4 partitions using the Cartesian axes method.
I never got around to testing to determine which method of partitioning was better. In future
simulations I let it auto-partition and it seemed to work fine
Convergence.
After I wrote this section of the manual I spent another several months perfecting my technique,
which is basically everything I wrote in this guide. I also did some preliminary work on
establishing convergence critiera and published a paper about it in IJHE at the end of 2011.
You can read all about it by searching for “Convergence criteria establishment for 3D simulation
of proton exchange membrane fuel cell”. Its on science direct somewhere.
APPENDIX D
TABLE OF MASS FLOW RATES UP TO 400 AMPERES
SCCM
Current (A)
H2
O2
kg/s
air
H2
O2
air
1
7
3.5
16.67
1.0E-08
8.3E-08
3.6E-07
2
14
7
33.34
2.1E-08
1.7E-07
7.1E-07
3
21
10.5
50.01
3.1E-08
2.5E-07
1.1E-06
4
28
14
66.68
4.2E-08
3.3E-07
1.4E-06
5
35
17.5
83.35
5.2E-08
4.2E-07
1.8E-06
10
70
35
166.7
1.0E-07
8.3E-07
3.6E-06
15
105
52.5
250.05
1.6E-07
1.3E-06
5.4E-06
20
140
70
333.4
2.1E-07
1.7E-06
7.1E-06
25
175
87.5
416.75
2.6E-07
2.1E-06
8.9E-06
30
210
105
500.1
3.1E-07
2.5E-06
1.1E-05
35
245
122.5
583.45
3.6E-07
2.9E-06
1.3E-05
40
280
140
666.8
4.2E-07
3.3E-06
1.4E-05
45
315
157.5
750.15
4.7E-07
3.8E-06
1.6E-05
50
350
175
833.5
5.2E-07
4.2E-06
1.8E-05
60
420
210
1000.2
6.3E-07
5.0E-06
2.1E-05
70
490
245
1166.9
7.3E-07
5.8E-06
2.5E-05
80
560
280
1333.6
8.3E-07
6.7E-06
2.9E-05
90
630
315
1500.3
9.4E-07
7.5E-06
3.2E-05
100
700
350
1667
1.0E-06
8.3E-06
3.6E-05
120
840
420
2000.4
1.3E-06
1.0E-05
4.3E-05
140
980
490
2333.8
1.5E-06
1.2E-05
5.0E-05
160
1120
560
2667.2
1.7E-06
1.3E-05
5.7E-05
180
1260
630
3000.6
1.9E-06
1.5E-05
6.4E-05
200
1400
700
3334
2.1E-06
1.7E-05
7.1E-05
220
1540
770
3667.4
2.3E-06
1.8E-05
7.9E-05
240
1680
840
4000.8
2.5E-06
2.0E-05
8.6E-05
260
1820
910
4334.2
2.7E-06
2.2E-05
9.3E-05
280
1960
980
4667.6
2.9E-06
2.3E-05
1.0E-04
300
2100
1050
5001
3.1E-06
2.5E-05
1.1E-04
320
2240
1120
5334.4
3.3E-06
2.7E-05
1.1E-04
340
2380
1190
5667.8
3.5E-06
2.8E-05
1.2E-04
360
2520
1260
6001.2
3.8E-06
3.0E-05
1.3E-04
380
2660
1330
6334.6
4.0E-06
3.2E-05
1.4E-04
400
2800
1400
6668
4.2E-06
3.3E-05
1.4E-04
Download