3.7 Generating the Mesh
The process for generating a mesh of nodes and elements consists of three general steps:
- Setting the element attributes
- Setting mesh controls
- Meshing the model.
It is not always necessary to set mesh controls because the default mesh controls are appropriate for many models. If no controls are specified, the program will use the default settings to produce a free mesh. Alternatively, the SmartSize feature can be used to produce a better quality free mesh.
3.7.1 Free or Mapped Mesh
Before meshing the model, and even before building the model, it is important to think about whether a free mesh or a mapped mesh (Fig. 3.31) is appropriate for the analysis. A free mesh has no restrictions in terms of element shapes, and has no specified pattern applied to it. A mapped mesh is restricted in terms of the element shape it contains and the pattern of the mesh. A mapped area mesh contains either only quadrilateral or only triangular elements, while a mapped volume mesh contains only hexahedron elements. In addition, a mapped mesh typically has a regular pattern, with obvious rows of elements. To generate this type of mesh, build the geometry as a series of fairly regular volumes and/or areas that can accept a mapped mesh.
A mapped mesh generates a very regular grid of elements. This can only be used on rectangular shaped areas or volumes. A free mesh will mesh any entity - regardless of shape.
Fig. 3.31 Free and Mapped Meshes
3.7.2 Setting Element Attributes
Before generating a mesh of nodes and elements, the analyst must first define the appropriate element attributes. That is, s/he must specify the following:
- The element type
- Real constant set
- Material properties set
- Element coordinate system
- Section ID.
3.7.2.1 Creating Tables of Element Attributes
In order to assign attributes to the elements, the analyst must first build tables of element attributes. Typical models include element types (menu path Main Menu> Preprocessor> Element Type> Add/Edit/Delete), real constants (menu path Main Menu> Preprocessor> Real Constants), and material properties (menu path Main Menu> Preprocessor> Material Props> material option).
A table of coordinate systems can also be assembled using Utility Menu> WorkPlane> Local Coordinate Systems> Create Local CS> option). This table can be used to assign element coordinate systems to elements.
3.7.2.2 Assigning Element Attributes Before Meshing
Once the attribute tables are assembled, the analyst can assign element attributes to different parts of the model by ‘pointing’ to the appropriate entries in the tables. The pointers are simply a set of reference numbers that include a material number (MAT), a real constant set number (REAL), an element type number (TYPE), a coordinate system number (ESYS) and, for beam meshing with BEAM188, or BEAM189, a section ID number (SECNUM). The analyst can either assign the attributes directly to selected solid model entities, or define a default set of attributes that will be used for elements created in subsequent meshing operations.
3.7.3 Mesh Controls
The default mesh controls that the program uses may produce a mesh that is adequate for the model being analyzed. In this case, it is not necessary to specify any mesh controls. However, if mesh controls are used, set them before meshing the solid model.
Mesh controls allow establishing such factors as the element shape, mid-side node placement, and element size to be used in meshing the solid model. This step is one of the most important of the entire analysis, for the decisions made at this stage in the model development will profoundly affect the accuracy and economy of the analysis.
3.7.3.1 The MeshTool
The MeshTool (Main Menu> Preprocessor> Meshing> MeshTool) provides a convenient path to many of the most common mesh controls, as well as to the most frequently performed meshing operations. The MeshTool (Fig. 3.32) is an interactive ‘tool box,’ not only because of the numerous functions that it contains, but also because once opened, it remains open until the analyst either closes it or exits PREP7.
Although all of the functions available via the MeshTool are also available via the traditional commands and menus, using the MeshTool is a valuable shortcut.
Fig. 3.32 Mesh Tool
How fine of a mesh should be? Part of this is common sense. Put a finer mesh in areas of higher stress gradient, like near a stress concentration. Do simple experiments along with hand calculations; for example about 30 nodes are needed around a hole to get a good value of the peak stress. The stress convergence should follow a pattern as shown in Fig. 3.33. When the result is not changing much for a finer mesh, the mesh is converged.
Fig. 3.33 Stress convergence with mesh fineness
If global attributes are set, that material, element type, real constant, beam section, etc. will be used for all elements in the model. It’s better to use the drop down to assign different attributes to different geometric entities in the model. Then mesh the whole model at one time.
Smart Size is used to automatically pick the element edge length depending on the sizes of features in the geometry. It makes a finer mesh around smaller features in order to capture them adequately.
3.7.3.2 Element Shape
The analyst should set the allowable element shapes if s/he plans on meshing with an element type that can take on more than one shape. For instance, many area elements can both be triangular and quadrilateral shaped within the same meshed area. Volume elements can often be either hexahedral or tetrahedral shaped, but a mixture of the two shapes in the same model is not recommended.
3.7.3.3 Choosing Free or Mapped Meshing
In addition to specifying element shape, the analyst may also want to specify the type of meshing that should be used to mesh the model. This is done by setting the meshing key: Main Menu> Preprocessor> Meshing> MeshTool or Main Menu> Preprocessor> Meshing> Mesher Opts.
Use the MeshTool (Main Menu> Preprocessor> Meshing> MeshTool) to specify meshing type. The MeshTool is the recommended method. Together, the settings for element shape and meshing type affect the resulting mesh.
3.7.3.4 Controlling Placement of Midside Nodes
When meshing with quadratic elements, the placement of midside nodes can be controlled. The choices for mid-side node placement are:
- Mid-side nodes of elements on a region boundary follow the curvature of the boundary line or area. This is the default.
- Place mid-side nodes of all elements so that element edges are straight. This option allows a coarse mesh along curves. However, the curvature of the model is not matched.
- Do not create mid-side nodes.
To control mid-side node placement, use: Main Menu> Preprocessor> Meshing> Mesher Opts
3.7.3.5 Smart Element Sizing for Free Meshing
Smart element sizing (SmartSizing) is a meshing feature that creates initial element sizes for free meshing operations. SmartSizing gives the mesher a better chance of creating reasonably shaped elements during automatic mesh generation. This feature provides a range of settings for meshing.
By default, the default element size method of element sizing will be used during free meshing. However, it is recommended that SmartSizing be used instead for free meshing. To turn SmartSizing on, simply specify an element size level on the SmartSizing command.
The Advantages of SmartSizing
The SmartSizing algorithm first computes estimated element edge lengths for all lines in the areas or volumes being meshed. The edge lengths on these lines are then refined for curvature and proximity of features in the geometry. Since all lines and areas are sized before meshing begins, the quality of the generated mesh is not dependent on the order in which the areas or volumes are meshed.
If quadrilateral elements are being used for area meshing, SmartSizing tries to set an even number of line divisions around each area so that an all-quadrilateral mesh is possible. Triangles will be included in the mesh only if forcing all quadrilaterals would create poorly shaped elements, or if odd divisions exist on boundaries.
3.7.3.6 Default Element Odds for Mapped Meshing
The default element size command allows the analyst to modify such defaults as: the minimum and maximum number of elements that will be attached to an unmeshed line, maximum spanned angle per element, and minimum and maximum edge length. This command (Main Menu> Preprocessor> Meshing> Size Cntrls> Global> Other) is always used to control element sizing for mapped meshing. The settings are also used by default for free meshing. However, it is recommended to use SmartSizing instead for free meshing operations.
As an example, the mapped mesh on the left in Fig. 3.34 was produced with the element size defaults that exist when entering the program. The mesh on the right was produced by modifying the minimum number of elements (MINL) and the maximum spanned angle per element (ANGL).
Fig. 3.34 Changing Default Element Sizes
3.7.3.7 Local Mesh Controls
In many cases, the mesh produced by default element sizes is not appropriate due to the physics of the structure. Examples include models with stress concentrations or singularities. In these cases, the analyst will have to get more involved with the meshing process. More control can be taken by using the following element size specifications:
- Use Main Menu> Preprocessor> Meshing> Size Cntrls> Global> Size to control the global element size in terms of the element edge length used on surface boundaries or the number of element divisions per line.
- Use Main Menu> Preprocessor> Meshing> Size Cntrls> Keypoints> All KPs or Main Menu> Preprocessor> Meshing> Size Cntrls> Keypoints> Picked KPs or Main Menu> Preprocessor> Meshing> Size Cntrls> Keypoints> Clr Size to control the element sizes near specified keypoints.
- Use Main Menu> Preprocessor> Meshing> Size Cntrls> Lines> All Lines or Main Menu> Preprocessor> Meshing> Size Cntrls> Lines> Picked Lines or Main Menu> Preprocessor> Meshing> Size Cntrls> Lines> Clr Size to control the number of elements on specified lines.
3.7.3.8 Interior Mesh Controls
The mesh can also be controlled on the interior of an area where there are no lines to guide the size of the mesh. To do so, use: Main Menu> Preprocessor> Meshing> Size Cntrls> Global> Area Cntrls.
3.7.4 Controls Used for Free and Mapped Meshing
3.7.4.1 Free Meshing
In free meshing operations, no special requirements restrict the solid model. Any model geometry, even if it is irregular, can be meshed. The element shapes used will depend on whether areas or volumes are being meshed. For area meshing, a free mesh can consist of only quadrilateral elements, only triangular elements, or a mixture of the two. For volume meshing, a free mesh is usually restricted to tetrahedral elements.
If the chosen element type is strictly triangular or tetrahedral, the program will use only that shape during meshing. However, if the chosen element type allows more than one shape (for example, PLANE183 or SOLID186), the analyst can specify which shape to use by: Main Menu> Preprocessor> Meshing> Mesher Opts.
Also specify that free meshing should be used to mesh the model, using: Main Menu> Preprocessor> Meshing> Mesher Opts.
For area elements that support more than one shape, a mixed shape mesh will be produced by default. An all triangle mesh can be requested, but is not recommended if lower-order elements are being used.
In order to achieve a free volume mesh, choose an element type that allows only a tetrahedral shape, or use an element that supports multiple shapes and set the shape option to tetrahedral only.
3.7.4.2 Mapped Meshing
The analyst can specify that the program use all quadrilateral area elements, all triangle area elements, or all hexahedral volume elements to generate a mapped mesh. Mapped meshing requires that an area or volume be ‘regular’, that is, it must meet certain criteria.
3.7.5 Meshing the Solid Model
Once solid model is built, element attributes are established, and meshing controls are set, ANSYS is ready to generate the finite element mesh. First, however, it is usually good practice to save the model before initiating mesh generation: Utility Menu> File> Save as Jobname.db.
It may also be necessary to turn on the ‘mesh accept/reject’ prompt by picking Main Menu> Preprocessor> Meshing> Mesher Opts. This feature allows to easily discard an undesirable mesh.
If multiple volumes or areas are being meshed at one time, consider using the meshing option By Size so the mesh is created in the smallest volume or area first. This helps ensure that the mesh is adequately dense in smaller volumes or areas and that the mesh is of a higher quality.
3.7.6 Changing the Mesh
If it is decided that the generated mesh is not appropriate, the mesh can easily be changed by one of the following methods:
- Remesh with new element size specifications
- Use the accept/reject prompt to discard the mesh, then remesh
- Clear the mesh, redefine mesh controls, and remesh
- Refine the mesh locally
- Improve the mesh.