The CAD model in this exercise contains some gaps on the assembly level, which can prevent the creation of a good mesh. One of the parts also contains holes we would like to remove.
You can start by importing the CAD file.
1 Click the New ( ) button on the main toolbar.
2 In the Model Wizard make sure that the space dimension is 3D, then click the Finish button.
3 To add an import feature to the geometry sequence right-click Geometry 1 and select Import.
4 In the Settings window click the Browse button.
M O D E L I N G W I T H A S S E M B L I E S | 23 5 Locate the course CD on the hard disk and select the file assembly_gaps.x_b,
then click Open.
1 Click Import in the Settings window.
The assembly consists of two parts, plate 1 and plate 2. Plate 2 has four screw holes, and two feet that fit into corresponding holes on plate 1. Besides the imported parts, the surrounding air volume is also important for the analysis. Therefore, you can continue by creating a block around the objects.
2 Right-click the Geometry 1 node and select Block. 3 Use data from the following table to draw a block:
4 Click the Build All ( ) button.
5 Right-click the Mesh 1 node and select Free Tetrahedral.
The finalize operation is performed automatically as you click the Mesh 1 node.
During the finalize operation, COMSOL Multiphysics determines the geometric
POSITION: BASE: CORNER SIZE
x -0.01 Width 0.06
y -0.03 Depth 0.06
z -0.06 Height 0.12
plate 1
plate 2
difference of the objects and creates one object with three subdomains delimited by single surfaces.
6 Click the Build All ( ) button.
After the meshing is completed, note that there are about to 130,000 tetrahedral elements in this seemingly simple geometry.
7 Click the Transparency ( ) button to visualize the inner domains.
You can see that there is a very fine mesh in several boundary regions between the two parts of the assembly. Usually this occurs if small, dimensional discrepancies exist between parts. They might be present in the design to provide important clearance for assembling the final product. In this case the clearance between the feet
Dense mesh regions
M O D E L I N G W I T H A S S E M B L I E S | 25 of plate 1 and the corresponding slots on plate 2 causes a very thin air gap. However,
such fine details do not affect the overall physics phenomena.
You cannot change the dimension of imported objects with the CAD Import Module. Yet, you can, easily remove both the feet and the slots. To this you need to use the defeaturing tools.
8 Right-click the Geometry 1 node, then select CAD Defeaturing>Delete Faces. In the Tools window that appears you can select faces of the geometry to be removed. When a delete operation is completed a feature node will be added to the geometry sequence.
To make the selection of faces easier first hide the block and plate 1.
9 Click the Select Objects ( ) button.
10In the Graphics window click the block, then click the Hide Selected ( ) button.
11In the Graphics window click plate 1, then click the Hide Selected ( ) button.
12Click the Select Boundaries ( ) button to switch back to boundary selection.
narrow gaps
13Add the faces highlighted in the figure below, boundaries 1, 2, 5, 6, 7, 8 on object imp1(1), to the list of Faces to delete.
The selected faces delimit the features to be removed.
14Click the Delete Selected button to delete the feet.
The default heal method, Patch, heals the wound that results from removing the faces, by shrinking and growing neighboring faces to cover the hole.
When the operation completes a Delete Faces 1 feature node is added to the Model Builder, right after the current feature in the geometry sequence, which was the Block 1 feature.
With the feet removed you can continue with removing the corresponding slots on plate 1.
Hide some objects again to make face selection easier, this time the block and plate 2.
15Click the Select Objects ( ) button.
16In the Graphics window click the block, then click the Hide Selected ( ) button.
17In the Graphics window click plate 2, then click the Hide Selected ( ) button.
18Click the Select Boundaries ( ) button to switch back to boundary selection.
M O D E L I N G W I T H A S S E M B L I E S | 27 19Add the faces highlighted in the figure below, boundaries 5-8, 9-12 on object
imp1(2), to the list of Faces to delete.
20Select the Heal as through hole check box.
21Click the Delete Selected button to delete the holes.
Before continuing with meshing, you can also delete the four mounting holes, shown in the figure below, since they are assumed to not influence the analysis.
You can easily select the faces delimiting the holes by using the Select Box tool.
22Click the Select Box ( ) button, then in the Graphics window draw a rectangle around the faces delimiting one of the holes. Confirm the selection by
right-clicking.
23Repeat the previous step for the other three holes.
24The Faces to delete list should now contain faces 7-14 and 17-24 of object dfa1.
25Click the Delete Selected button to delete the holes.
The last step is to create a new mesh of the geometry.
M O D E L I N G W I T H A S S E M B L I E S | 29 26Right-click the Mesh 1 node in the Model Builder, then select Build All.
The mesh now consists of about 31,000 tetrahedral elements. As you can see in the figure, there are still two regions of high mesh density left. The reason for this is a slight difference in width between the two objects.
If this dimensional mismatch is unintentional and assumed to not be important for the analysis, it can easily fixed in a CAD software. With the CAD Import Module, you can export defeatured parts to a Parasolid file, which you can open and edit with a CAD program.
Dense mesh regions
Objects are not of the same width
27Right-click the Geometry 1 node and select Export to File.
28The Input list shows all three objects selected (dfa2, blk1, and dfa3). To accept and export the objects click Export.
29From the Save as type list select either Parasolid binary file or Parasolid text file. 30Select a directory, enter a file name, then click Save.
The resulting Parasolid file can be imported into most CAD software.
You can also use the CAD Import Module to fix the dimensional discrepancy, by for example using the repair functionality of the Finalize feature.
31Click the Form Union feature node.
32In the Relative repair tolerance edit field enter 1e-3.
33Right-click the Mesh 1 node in the Model Builder, then select Build All.
As you can see the resulting mesh contains only about 5000 elements.
32 | C H A P T E R 3 : M E S H I N G T E C H N I Q U E S
T h e M e s h i n g S e q u e n c e
COMSOL Multiphysics provides an interactive meshing environment where, with a few mouse clicks, you can easily mesh individual faces or domains. Each meshing operation is added to the meshing sequence. The final mesh is the result of building all the operations in the meshing sequence.
This example demonstrates how to use the meshing sequence. On a realistic geometry you create a mesh consisting of different element types. You learn how to mesh certain parts of a geometry, modify this mesh, change the parameters to your liking, and rebuild the mesh.