Meshing your Geometry: When to Use the Various Element Types
Walter Frei | November 4, 2013
In a previous blog entry, we introduced meshing considerations for linear static problems. One of the key concepts there was the idea of mesh convergence — as you refine the mesh, the solution will become more accurate. In this post, we will delve deeper into how to choose an appropriate mesh to start your mesh convergence studies for linear static finite element problems.
What Are the Different Element Types
As we saw earlier, there are four different 3D element types — tets, bricks, prisms, and pyramids:
These four elements can be used, in various combinations, to mesh any 3D model. (For 2D models, you have triangular and quadrilateral elements available. We won’t discuss 2D very much here, since it is a logical subset of 3D that doesn’t require much extra explanation.) What we haven’t spoken in-depth about yet is why you would want to use these various elements.
Why and When to Use the Elements
Tetrahedral elements are the default element type for most physics within COMSOL. Tetrahedra are also known as a simplex, which simply means that any 3D volume, regardless of shape or topology, can be meshed with tets. They are also the only kind of elements that can be used with adaptive mesh refinement. For these reasons, tets can usually be your first choice.
The other three element types (bricks, prisms, and pyramids) should be used only when it is motivated to do so. It is first worth noting that these elements will not always be able to mesh a particular geometry. The meshing algorithm usually requires some more user input to create such a mesh, so before going through this effort, you need to ask yourself if it is motivated. Here we will talk about the motivations behind using brick and prism elements. The pyramids are only used when creating a transition in the mesh between bricks and tets.
The primary motivation in COMSOL for using brick and prism elements is that they can significantly reduce the number of elements in the mesh. These elements can have very high aspect ratios (the ratio of longest to shortest edge) whereas the algorithm used to create a tet mesh will try to keep the aspect ratio close to unity. It is reasonable to use high aspect ratio brick and prism elements when you know that the solution varies gradually in certain directions, or if you are not very interested in accurate results in those regions because you already know the interesting results are elsewhere in the model.
Meshing Example 1: Wheel Rim
Consider the example of a wheel rim, shown below.
The mesh on the left is composed only of tets, while the mesh on the right has tets (green), bricks (blue), and prisms (pink) as well as pyramids to transition between these. The mixed mesh uses smaller tets around the holes and corners, where we expect higher stresses. Bricks and prisms are used in the spokes and around the rim. Neither the rim nor the spokes will carry peak stresses (at least under a static load) and we can safely assume a relatively slow variation of the stresses in these regions. The tet mesh has about 145,000 elements and around 730,000 degrees of freedom. The mixed mesh has close to 78,000 elements and roughly 414,000 degrees of freedom, and takes about half as much time and memory to solve. The mixed mesh does take significant user interaction to set up, while the tet mesh requires essentially no user effort.
Meshing Example 2: Loaded Spring
Another example is shown below, this time it’s a structural analysis of a loaded spring. Since the deformation is quite uniform along the length of the helix of the spring, it makes sense to have a mesh that describes the overall shape and cross section, but relatively stretched elements along the length of the wire. The prism mesh has 504 elements with 9,526 degrees of freedom, and the tet mesh has 3,652 elements with 23,434 degrees of freedom. So although the number of elements is quite different, the number of degrees of freedom is less so.
Meshing Example 3: Material on a Wafer
The other significant motivation for using brick and prism elements is when the geometry contains very thin structures in one direction, such as an epitaxial layer of material on a wafer, a stamped sheet metal part, or a sandwiched composite.
For example, let’s look at the figure below, of a thin trace of material patterned onto a substrate. The tet mesh has very small elements in the trace, whereas the prism mesh is composed of thin elements in this region. Whenever your geometry has layers that are about 10-3 or so times thinner than the largest dimension of the part, the usage of bricks and prisms becomes very highly motivated.
It is also worth pointing out that COMSOL offers many boundary conditions that can be used in lieu of explicitly modeling thin layers of materials. For example, in electromagnetics, the following four examples consider thin layers of material with relatively high and low conductivity, and relatively high and low permeability:
- Electric Shielding Comparison
- Contact Impedance Comparison
- Dielectric Shielding Comparison
- Thin Low Permittivity Gap Comparison
Similar types of boundary conditions exist in most of the physics interfaces. Usage of these types of boundary conditions will avoid the need to mesh such thin layers entirely.
Lastly, the above comments apply only to linear static finite element problems. Different meshing techniques are needed for nonlinear static problems, or if we are modeling time-domain or frequency-domain phenomena.
To summarize, here is what you should keep in mind when starting your meshing of linear static problems:
- Use tets if you can; they require the least user interaction and support adaptive mesh refinement
- If you know the solution varies slowly in one or more directions, use bricks or prisms with high aspect ratios in those regions
- If the geometry contains thin layers of material, use bricks or prisms or consider using a boundary condition instead
- Always perform a mesh refinement study and monitor the memory requirements and convergence of the solution as you refine the mesh
Philosophy of the Ribbon
- Certified Consultants 29
- Chemical 46
- COMSOL Now 131
- Conference 98
- Core Functionality 57
- Electrical 114
- Fluid 85
- Interfacing 35
- Mechanical 140
- Multipurpose 14
- Tips & Tricks 32
- Trending Topics 40
- User Perspectives 81
- Video 63