In this blog entry, we introduce meshing considerations for linear static finite element
problems. This is the first in a series of postings on meshing techniques that is meant to
provide guidance on how to approach the meshing of your finite element model with
confidence.
Geometric Discretization
Consider two very simple geometries, a block and a cylindrical shell:
There are four different types of elements that can be used to mesh these geometries
tetrahedra (tets), hexahedra (bricks), triangular prismatics (prisms), and pyramid elements:
The grey circles represent the corners, or nodes, of the elements. Any combination of the
above four elements can be used. (For 2D modeling, triangular and quadrilateral elements
are available.) You can see by examination that both of these geometries could be meshed
with as few as one brick element, two prisms, three pyramids, or five tets. As we learned in
the previous blog post about solving linear static finite element problems, you will always
arrive at a solution in one Newton-Raphson iteration. This is true for linear finite element
problems regardless of the mesh. So lets take a look at the simplest mesh we could put on
these structures. Heres a plot of a single brick element discretizing these geometries:
The mesh of the block is obviously a perfect representation of the true geometry, while the
mesh of the cylindrical shell appears quite poor. In fact, it only appears that way when
plotted. Elements are always plotted on the screen as having straight edges (this is done for
graphics performance purposes) but COMSOL usually uses a second-order Lagrangian
element to discretize the geometry (and the solution). So although the element edges always
appear straight, they are internally represented as:
The white circles represent the midpoint nodes of these second-order element edges. That
is, the lines defining the edges of the elements are represented by three points, and the
edges approximated via a polynomial fit. There are also additional nodes at the center of
each of these quadrilateral faces and in the center of the volume for these second-order
Lagrangian hexahedral elements (omitted for clarity). Clearly, these elements do a better job
of representing the curved boundaries of the elements. By default, COMSOL uses second-
order elements for most physics, the two exceptions are problems involving chemical
species transport and when solving for a fluid flow field. (Since those types of problems are
convection dominated, the governing equations are better solved with first-order elements.)
Higher order elements are also available, but the default second-order elements usually
represent a good compromise between accuracy and computational requirements.
The figure below shows the geometric discretization error when meshing a 90 arc in terms
of the number of first- and second-order elements:
The conclusion that can be made from this is that at least two second-order elements, or at
least eight first-order elements, are needed to reduce the geometric discretization error
below 1%. In fact, two second-order elements introduce a geometric discretization error of
less that 0.1%. Finer meshes will more accurately represent the geometry, but will take
more computational resources. This gives us a couple of good practical guidelines:
1.
2.
When using first-order elements, adjust the mesh such that there are at least
eight elements per 90 arc
When using second-order elements, use two elements per 90 arc
With these rules of thumb, we can now estimate the error weve introduced by meshing the
geometry, and we can do so with some confidence before even having to solve the model.
Now lets turn our attention to how the mesh discretizes the solution.
Solution Discretization
The finite element mesh is also used to represent the solution field. The solution is
computed at the node points, and a polynomial basis is used to interpolate this solution
throughout the element to recover the total solution field. When solving linear finite
elements problems, we are always able to compute a solution, no matter how coarse the
mesh, but it may not be very accurate. To understand how mesh density affects solution
accuracy, lets look at a simple heat transfer problem on our previous geometries:
A temperature difference is applied to opposing faces of the block and the cylindrical shell.
The thermal conductivity is constant, and all other surfaces are thermally insulated.
The solution for the case of the square block is that the temperature field varies linearly
throughout the block. So for this model, a single, first-order, hexahedral element would
actually be sufficient to compute the true solution. Of course, you will rarely be that lucky!
Therefore, lets look at the slightly more challenging case. Weve already seen that the
cylindrical shell model will have geometric discretization error due to the curved edges, so
we would start this model with at least two second-order (or eight first-order) elements
along the curved edges. If you look closely at the above plot, you can see that the element
edges on the boundaries are curved, while the interior elements have straight edges.
Along the axis of the cylinder, we can use a single element, since the temperature field will
not vary in this direction. However, in the radial direction, from the inside to outside
surface, we also need to have enough elements to discretize the solution. The analytic
solution for this case goes as
and can be compared against our finite element
solution. Since the polynomial basis functions cannot perfectly describe the function, lets
plot the error in the finite element solution for both the linear and quadratic elements:
What you can see from this plot is that, as you increase the number of elements in the
model, the error goes down. This is a fundamental property of the finite element method:
the more elements, the more accurate your solution. Of course, there is also a cost
associated with this. More computational resources, both time and hardware, are required
to solve larger models. Now, youll notice that there are no units to the x-axis of this graph,
and that is on purpose. The rate at which error decreases with respect to mesh refinement
will be different for every model, and depends on many factors. The only important point is
that it will always go down, monotonically, for well-posed problems.
Youll also notice that, after a point, the error starts to go back up. This will happen once the
individual mesh elements start to get very small, and we run into the limits of numerical
precision. That is, the numbers in our model are smaller than can be accurately represented
on a computer. This is an inherent problem with all computational methods, not just the
finite element method; computers cannot represent all real numbers accurately. The point at
which the error starts to go back up will be around
and to be on
the safe and practical side, we often say that the minimal achievable error is 10-6. Thus, if we
integrate the scaled difference between the true and computed solution over the entire
model:
We say that the error, , can typically be made as small as 10-6 in the limits of mesh
refinement. In practice, the inputs to our models will anyways usually have much greater
uncertainty than this. Also keep in mind that in general we dont know the true solution, we
will instead have to compare the computed solutions between different sized meshes and
observe what values the solution converges toward.
The computed displacement fields, and the resultant stresses, are quite uniform some
distance away from the hole, but vary strongly nearby. The figure below shows an initial
mesh, as well as the results of several adaptive mesh refinement iterations, along with the
computed stress field.
Note how COMSOL preferentially inserts smaller elements around the hole. This should not
be a surprise, since we already know there will be higher stresses around the hole. In
practice, it is recommended to use a combination of adaptive mesh refinement, engineering
judgment, and experience to find an acceptable mesh.
You will always want to perform a mesh refinement study and compare results
on different sized meshes
You can use adaptive mesh refinement, or your own engineering judgment, to
refine the mesh
Post Categories
Core Functionality
Meshing
Solvers
Post Tags
Application Notes | Solver series | Technical Content
Previous Post
COMSOL Conference 2013 Bangalore
Keynote Sessions
Next Post
Learn How to Model MEMS Devices,
Upcoming Webinar
Comments
Login
E-mail *
Password
Search Blog
Applications 25
Certified Consultants 32
Chemical 64
Batteries & Fuel Cells 16
Chemical Reaction Engineering 26
Corrosion 12
Electrochemistry 9
Electrodeposition 5
Electrical 169
AC/DC 52
MEMS 22
Plasma 7
Ray Optics 10
RF 47
Semiconductor 5
Wave Optics 14
Fluid 108
CFD 50
Microfluidics 15
Mixer 4
Molecular Flow 11
Pipe Flow 9
Subsurface Flow 10
Interfacing 43
Mechanical 193
Acoustics 32
Fatigue 12
Geomechanics 4
Heat Transfer 94
Multibody Dynamics 10
Nonlinear Structural Materials 7
Structural Mechanics 68
Multipurpose 18
Optimization 6
Particle Tracing 13
Parallel Computing
Technical