0% found this document useful (0 votes)
11 views

Introduction To CADImport Module

fefe

Uploaded by

--------
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Introduction To CADImport Module

fefe

Uploaded by

--------
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

INTRODUCTION TO

CAD Import Module


Introduction to the CAD Import Module
© 2005–2023 COMSOL
Protected by patents listed on www.comsol.com/patents, or see Help>About COMSOL Multiphysics on the File
menu in the COMSOL Desktop for less detailed lists of U.S. Patents that may apply. Patents pending.
This Documentation and the Programs described herein are furnished under the COMSOL Software License
Agreement (www.comsol.com/comsol-license-agreement) and may be used or copied only under the terms of the
license agreement. Portions of this software are owned by Siemens Product Lifecycle Management Software Inc. ©
1986–2022. All Rights Reserved. Portions of this software are owned by Spatial Corp. © 1989–2022. All Rights
Reserved.
COMSOL, the COMSOL logo, COMSOL Multiphysics, COMSOL Desktop, COMSOL Compiler, COMSOL Server,
and LiveLink are either registered trademarks or trademarks of COMSOL AB. ACIS and SAT are registered
trademarks of Spatial Corporation. CATIA is a registered trademark of Dassault Systèmes or its subsidiaries in the US
and/or other countries. Parasolid is a trademark or registered trademark of Siemens Product Lifecycle Management
Software Inc. or its subsidiaries in the United States and in other countries. All other trademarks are the property of
their respective owners, and COMSOL AB and its subsidiaries and products are not affiliated with, endorsed by,
sponsored by, or supported by those or the above non-COMSOL trademark owners. For a list of such trademark
owners, see www.comsol.com/trademarks.
Version: COMSOL 6.2

Contact Information
Visit the Contact COMSOL page at www.comsol.com/contact to submit general inquiries or
search for an address and phone number. You can also visit the Worldwide Sales Offices page at
www.comsol.com/contact/offices for address and contact information.

If you need to contact Support, an online request form is located on the COMSOL Access page
at www.comsol.com/support/case. Other useful links include:

• Support Center: www.comsol.com/support


• Product Download: www.comsol.com/product-download
• Product Updates: www.comsol.com/product-update
• COMSOL Blog: www.comsol.com/blogs
• Discussion Forum: www.comsol.com/forum
• Events: www.comsol.com/events
• COMSOL Video Gallery: www.comsol.com/videos
• Support Knowledge Base: www.comsol.com/support/knowledgebase

Part number: CM020302


Contents

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
About CAD File Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Removing Small Geometric Entities with Repair . . . . . . . . . . . . . 8
Removing Small Geometric Entities with the Defeaturing Tools17
Removing Small Geometric Entities with Remove Details . . . . 26
Creating a Fluid Domain Inside a Solid Structure . . . . . . . . . . . 34

|3
4|
Introduction

This guide introduces you to the CAD Import Module, which adds support for
importing several 3D CAD file formats into the COMSOL modeling
environment. It also provides a robust platform, including repair and defeaturing
tools, to prepare the geometry for multiphysics modeling. The detailed tutorials
that follow start you off with becoming efficient in using the provided
functionality.

|5
About CAD File Formats

To better understand the functionality of the CAD Import Module, first review
some general background information about CAD file formats.

C A D S o f t w ar e, G e o m e t r y K e r n e l s , a n d F i l e F o r m a t s

Each CAD program uses a geometry kernel to create a mathematical description


of the objects and to calculate the results of solid-modeling operations. Parasolid®
and ACIS® are the two most common kernels, and many CAD programs license
these kernels. In addition, some programs use their own kernel (as does
COMSOL). Each of these kernels has a native file format associated with it. For
example, the Parasolid file format is simply called Parasolid, and the one from
ACIS is called ACIS or SAT®.
The geometry kernel defines the type of internal representations used for 3D
modeling, which can vary considerably among different kernels. That explains why
the representations stored in the various file formats are also very different. The
CAD Import Module can read several of these different descriptions of objects and
translate them into a format that COMSOL can work with.
In addition to the file formats that are native to a geometry kernel, yet other
formats are based on neutral standards that were defined to ease the exchange of
geometric models among CAD software applications. STEP and IGES are the two
most popular such formats.
Yet another class of files use surface-mesh geometry formats. They do not
represent a model’s exact 3D geometry; instead, they store only triangular meshes
of the surfaces. The most common examples of these types of formats are STL and
3MF.

T r a n sl a t in g 3 D C A D F i l e s B e t w e e n F o r ma t s

Geometric models do not always pass flawlessly between different file formats due
to the fact that they are represented differently. This means that the quality of a
translation when importing a file to COMSOL depends on the file format. The
smoothest way is to use the native format of your CAD system. If this is not an
option, we in general recommend that you use Parasolid, STEP, or ACIS.
Importing 3D CAD files into COMSOL is straightforward. Since the settings of
the import operation have been tuned to suit the most common cases, the

6|
majority of files import simply with the click of a button. During import the
geometry is checked for errors and automatically repaired. The repair operation
also removes small features that fall within the import tolerance.

|7
Removing Small Geometric Entities with Repair

In this example, the Parasolid® file of a wheel rim contains a few small details,
which are not removed during import, since they fall outside the default import
tolerance. The step-by-step instructions below demonstrate one way to locate and
remove these features. The general workflow is:
• Import the file
• Create a mesh for quick examination of the geometry
• Measure the size of the features you would like to remove
• Repair the object
• Create a new mesh for comparison

Model Wizard

1 Start COMSOL Multiphysics.


2 Select Blank Model to skip the steps of selecting physics interfaces and study
type.
3 In the Home toolbar, click Add Component and select 3D.

I m p o r t i n g t h e G eo m e t r y

The wheel rim geometry for this tutorial has been saved in the Parasolid format.
Make sure that the CAD Import Module geometry kernel is used.
1 In the Model Builder window, under Component 1 (comp1) click Geometry 1.
2 In the Settings window for Geometry, from the Geometry representation list,
choose CAD kernel.
3 In the Home toolbar click Import .
4 In the Settings window for Import click the Browse button.
5 In your COMSOL installation directory navigate to the folder applications/
CAD_Import_Module/Tutorial_Examples and double click the file
wheel_rim.x_b.
6 Click Import.

8|
As soon as the import is done the geometry appears in the Graphics window.

C r e a ti n g a S u r f a ce M e sh

Creating a mesh for an imported solid is often the fastest way to assess the quality
of the geometry and to identify regions needing repair or defeaturing. For more
complex objects with many details you can save some time initially by creating a
surface mesh only.
1 In the Mesh toolbar click Boundary and choose Free Triangular .
2 Go to the Settings window for Free Triangular and from the Selection list box
choose All boundaries.
3 Click the Build All button to create the mesh.
As soon as the mesh is ready the Messages window displays the number of mesh
elements, which is about 33,000.
Two Information nodes appear under the Free Triangular 1 node in the mesh
sequence. These information messages indicate that the geometry contains
edges that are much shorter than the minimum element size, and that there are
faces that are smaller than the minimum element size. These nodes contain a list
of entities, in this case short edges and small faces, causing problems. These
entities are also highlighted in the geometry, and are usually surrounded by a

|9
denser mesh that indicates faces or edges significantly smaller than the
geometry.
4 Click the Information 1 node in the meshing sequence, then in the Graphics
window zoom in on the area around the bolt holes, shown below.

The areas of dense mesh close to each bolt hole are due to slivers and small faces.
5 Zoom in to the region indicated by the blue rectangle, and click the Mesh
Rendering button in the Graphics toolbar for a better view of these small
geometric entities.
The small triangular face and
adjacent sliver face can be found
in two places around each bolt
hole location. The highlighted
edges are listed in the Selection
list of the Information node.
To get a representative size for
these faces measure the length of
one of its edges, number 1384 in
the list, which is highlighted by
the arrow in the figure to the
right.

10 |
6 Scroll down in the Selection list inside the Settings window for Information 1,
then click edge 1384.
7 In the Mesh toolbar, click Measure .
The Messages window displays the length of the edge, which is 5.4193e-5 m —
that is, 5.4193·10-5 m or about 0.002 inches.
Now take a closer look at some of the other short edges listed in the
Information node.
8 Scroll further down in the Selection list inside the Settings window for
Information 1, then click edge 1813.
9 Click the Zoom to selection button next to the list.
The Graphics window centers and zooms in on the highlighted edge.
10Using the mouse zoom out and pan to find where the edge is located on the
wheel rim. It forms one side of a sliver face located in the region where two
adjacent spokes connect to the rim.

Each spoke contains a similar sliver indicated by the arrows in the figure.
11To get the width of the sliver face, click Measure in the Mesh toolbar, while
the edge is still highlighted in the list.
The length for edge 1813 is 3.126·10-4 m (about 0.012 inches).

Repairing the Geometry

Now that you know the size of the faces to be removed you can repair the
geometry.

| 11
1 In the Geometry toolbar click Defeaturing and Repair and choose
Repair .
2 In the Graphics window select the wheel rim to add it to the Input objects list.
3 In the Absolute repair tolerance text field enter
3.2e-4.
By keeping the repair tolerance close to the size of
the features to be removed you can avoid removing
anything else and breaking the geometry.
4 Click Build All Objects to perform the operation.
5 Examine the geometry. Pan and zoom to take a look at the areas that contained
the slivers and small faces, which are now no longer present in the geometry.

The small faces and slivers are no longer present in the geometry. According to the
Information section in the Settings window for Repair, 60 short edges and 20
sliver faces were removed.

Updating the Mesh and Contin uing with th e Repair

1 In the Home toolbar, click Build Mesh .


This time the mesh contains about 5000 surface elements less than before the
repair. The Information 1 node informs that some edges are still shorter than
the minimum element size.

12 |
2 Click the Information 1 node, then use the Selection list and the
Zoom to Selection button next to the list to find edges 40, 44, 122, and
427.
122

44

40

427

Three of these edges are located close to where the spokes connect to the rim,
and one is found close to the center of the wheel. Similar edges occur on each
spoke.
3 To find an appropriate repair tolerance measure the length of the edges using
the Measure toolbar button. The Messages window reports the following

EDGE LENGTH

40 8.33e-4
44 4.77e-4
122 8.57e-4
427 8.91e-4

4 In the Geometry toolbar, click Defeaturing and Repair and choose


Repair .
5 Select the wheel rim for the Input objects list.
6 Enter 9e-4 in the Absolute repair tolerance text field.
7 Click the Build All Objects button.
According to the Settings window for Repair 40 short edges were removed this
time.
When defeaturing imported objects using Repair, you may experience better
success if you add two Repair operations with the second one having a larger

| 13
tolerance, just as in this tutorial. Using a larger tolerance from the beginning
may not always succeed to remove all small details due to geometric conditions,
for example when several small details are adjacent to each other.
8 Next, click the Information 1 node below the Free Triangular 1 node, without
rebuilding the mesh, and find that no edges remain in the list.
The associativity algorithm in the
program ensures that deleted edges are
automatically removed from the list in
the Information node.
As a result of deleting the edges, the
adjacent faces have been modified by the
repair algorithm. Most likely this also
results in a change of surface curvature in
the vicinity of the deleted edges. The
longer the deleted edge, the larger the
difference from the original geometry
that we can expect. For this reason it is
recommended to use a small tolerance together with the repair operation. If
preserving the surface curvature is important for the analysis, virtual geometry
operations, which work by hiding geometry features from the mesher, are
available as an alternative. How you can do this is described further ahead, in
the tutorial Removing Small Geometric Entities Using Remove Details.

Gene ratin g a Te tr ahe d ral Me sh

Now that the defeaturing is completed, create a volume mesh for the wheel rim.
The fastest way to do this is to reset the meshing sequence.
1 In the Mesh toolbar, click Reset , and click Yes in the Confirm Operation
dialog box that appears.
The meshing sequence is reset to contain only a Size and a Free Tetrahedral
node.
2 Click Build Mesh .

14 |
3 To restore the view of the mesh,
in the Graphics toolbar, click the
Go to Default View button,
then click the
Mesh Rendering button.
The mesh contains approximately
70,000 tetrahedral elements, and as
you can see if you examine it more
closely the dense mesh regions you
could see with the first triangular
mesh are no longer present.
4 Expand the Free Tetrahedral 1
node.
The information that appears
corresponds to the second
Information node with the previous triangular mesh.
5 Click the Information node in the meshing sequence, then rotate the geometry
in the Graphics window to find boundary 225 that appears in the selection.

The highlighted face has several narrow regions (indicated by blue rectangles in
the figure above), which cannot be resolved well enough using the current mesh
size settings. These narrow regions are not associated with any small geometric
entities, but are rather a consequence of the dimensioning of the geometry.
Therefore it is not possible to remove these using the Repair operation. One
way you can remove the narrow region in this example is to delete the adjacent
fillets from the geometry. This is described further ahead, in the tutorial
Removing Small Geometric Entities with the Defeaturing Tools. You will find

| 15
yet another method, by which you can automatically search for and remove
narrow regions, in the tutorial Removing Small Geometric Entities with
Remove Details.
You may also choose to adjust the mesh size setting to better resolve small
details in the geometry. Here you can do this by allowing smaller mesh elements
on boundary 225.
6 Right-click the Free Tetrahedral 1 node and choose Size.
This adds a local Size node under Free Tetrahedral 1.
7 Choose Boundary from the Geometric entity level list in the Settings window
for Size.
8 Select Boundary 225.
9 Click to expand the Element Size Parameters section and click the Custom
button.
10Select the Minimum element size check box and enter 2[mm] in the associated
text field.
11Click Build All.
The mesh that now builds without any Information nodes contains an
additional 500 tetrahedral elements.

16 |
Removing Small Geometric Entities with the Defeaturing
Tools

As an alternative to the repair operation described in the previous tutorial you can
also apply defeaturing tools to remove small details from the geometry. Using
these tools you can first search the geometry for features that fall within a set
tolerance, then, after examining the search results, you can decide which ones to
delete. While the repair operation has the advantage that it quickly removes every
feature it can within a specified tolerance, the defeaturing tools gives you more
control with selective removal of features.
To search for and remove small features from a geometry using the defeaturing
tools, follow this general workflow:
• Import the file
• Search for and delete small features, such as
- small faces
- sliver faces
- short edges
- fillets

For the initial search for a feature it is good practice to use a tolerance slightly
higher than the default import tolerance, 10-5 m. Thus, in a first attempt, search
for small faces with a maximum size of 10-4 m. Continue by deleting all or some
of the returned small faces, then search again with an even higher tolerance, for
example 5·10-4 m.
Meshing the geometry can also serve as a diagnostic tool for locating small
features, and can be used in combination with the defeaturing tools. After
meshing, you can measure some of the small edges and faces reported by the
mesher to find a good starting point for a tolerance setting for the defeaturing
tools.
The step-by-step instructions below guide you through how to defeature the
geometry of the wheel rim that appeared in the previous example.

Model Wizard

1 Start COMSOL Multiphysics.


2 Select Blank Model to skip the steps of selecting physics interfaces and study
type.

| 17
3 In the Home toolbar, click Add Component and select 3D.

I m p o r t i n g t h e G eo m e t r y

Before importing the CAD file, make sure that the CAD kernel is used.
1 In the Model Builder window, under Component 1 (comp1) click Geometry 1.
2 In the Settings window for Geometry, from the Geometry representation list,
choose CAD kernel.
3 In the Home toolbar click Import .
4 In the Settings window for Import click the Browse button.
5 In your COMSOL installation directory navigate to the folder applications/
CAD_Import_Module/Tutorial_Examples and double-click the file
wheel_rim.x_b.
6 Click Import.

18 |
Finding and Deleting Small Faces

1 In the Geometry toolbar, click


Defeaturing and Repair and
choose Delete Small Faces .
In the Tools window for Delete
Small Faces, the wheel rim, imp1,
already appears in the Input
objects list.
2 In the Maximum face size text
field enter 1e-4.
Since the default import
tolerance is 10-5 m it is good
practice to start the search with
10-4 m, unless the imported
CAD design is of a much larger
scale.
3 Click the Find Small Faces
button.
Ten faces are listed in the Small
face selection list.
4 Use the Zoom to Selection
button next to the list to find the
faces on the rim, which are found
around the bolt holes, as
illustrated in the figure below.

| 19
5 To delete all faces in the list click the Delete All button.
The tool removes small faces by collapsing
them into a vertex (point). Therefore it is not
recommended to delete larger faces this way
as it might result in unexpected changes to
the geometry.
Note that as the operation is done, the Delete
Small Faces 1 (dsf1) node is added to the
geometry sequence in the Model Builder tree.
The node allows you to go back and edit the
delete operation.
The Tools window for Delete Small Faces
continues to be displayed so that you can
continue defeaturing using this or any of the other defeaturing tools, which you
can access by clicking one of the buttons at the top of the window. If you happen
to click a node in the geometry sequence of the Model Builder tree, the Settings
window for that node will be displayed instead of the Tools window. To bring
back the Tools window you can always select one of the defeaturing tools in the
Geometry toolbar.

20 |
Finding and Removing Sliver Faces

Slivers are faces with a high aspect


ratio, just like the ones next to those
small faces you have just deleted.
1 From the toolbar on the top of
the Tools window, click the
Delete Sliver Faces button.
2 Enter 4e-4 for the Maximum face
width, then click Find Sliver
Faces.
A total of 20 faces are found. In
addition to the ten slivers around
the bolt holes, there are ten more
on the spokes. Use the Zoom to
Selection button to find their
location on the rim.
3 Click the Delete All button.
The tool removes sliver faces by
collapsing them into an edge, and
in this process it uses the
tolerance specified for the search.
For best results the tolerance
needs to be close to the actual
width of the face that is deleted. If
it happens that a sliver cannot be
deleted you can edit the settings for the operation to set a tolerance that is just
slightly larger than the width of the face.

| 21
Finding and Removing Short Edges

1 From the toolbar on the top of


the Tools window, click Delete
Short Edges .
2 If not already selected, add the
wheel rim to the Input objects
list.
3 In the Maximum edge length text
field enter 4e-4.
4 Click the Find Short Edges
button.
It seems that the previous
operations have removed all edges
that were shorter than this value.
5 Increase the Maximum edge
length to 9e-4, then click the
Find Short Edges button again.

6 Take some time to find the edges


in the list on the geometry and
measure their length. They
reoccur in similar places on each
spoke. Some of the locations are
indicated in the figure to the
right.

22 |
7 Click the Delete All button.
In the resulting geometry all short
edges have been collapsed to
vertices. The wheel rim geometry is
now similar to the one after the last
repair operation in the tutorial
Removing Small Geometric
Entities with Repair. The
difference is that by using the
defeaturing tools you can have more
control over which entities to delete
and in which order.
Just as for the Repair operation, it is
recommended to use these tools
with small tolerances to avoid large
modifications to the geometry.

| 23
Finding and Deleting Fillets

In the previous tutorial, Removing


Small Geometric Entities with
Repair, we left the wheel rim
geometry with narrow face regions
remaining on a face. Here you will
delete fillets adjacent to the narrow
face regions to thereby make the
face wider.
1 From the toolbar on the top of
the Tools window, click the
Delete Fillets button.
2 If not already selected, add the
wheel rim to the Input objects list.
3 In the Maximum fillet radius text
field enter 2[mm].
4 Click the Find Fillets button.
Twenty fillets with a radius
smaller than 2 mm are found.
Remove only the fillets around
the cavities on the back of the
wheel rim. These are highlighted
in the figure further below.
5 First, click Clear Selection next to
the Fillet Selection list.
6 Select Fillet 16 to 20 from
the list, or, in the Graphics
window, select a face each
from the fillets
highlighted in the image
to the right.
7 Click the Delete Selected
button.

24 |
Gene ratin g a Te tr ahe d ral Me sh

As a final step generate the default tetrahedral mesh for the wheel rim.
In the Home toolbar, click Build Mesh.

The generated mesh consists of approximately 68,000 elements and there should
be no Information nodes appearing under the Mesh 1 node due to small
geometric entities.
The next tutorial describes how to automatically defeature the same geometry
using virtual geometry operations.

| 25
Removing Small Geometric Entities with Remove Details

This tutorial demonstrates the use of the Remove Details operation for automatic
defeaturing of the very same wheel rim geometry as in the previous two tutorials.
Remove Details leverages virtual geometry operations to automatically detect and
delete small features on the finalized geometry.
The repair and defeaturing tools that find and delete small geometry features can
operate only within the limits of what is allowed by the topology of the geometry.
To handle more complex cases, where defeaturing fails, you can use virtual
geometry operations. With these tools you can set geometric entities, such as
vertices, edges, or faces, to be ignored by the mesher. Since selected elements are
“hidden” from the mesher, meshing takes place on a virtual geometry, hence the
name virtual operations.
Virtual operations work on the finalized geometry, that is, the geometry after the
Form Union or Form Assembly nodes. This means that using these operations you
may remove small domains that result from intersecting solid objects. Another
benefit is that they keep the curvature of the geometry, which may be important
when removing larger faces, or for certain physics applications where altering the
curvature of the geometry can, for example, give rise to stress concentrations.

Model Wizard

1 Start COMSOL Multiphysics.


2 Select Blank Model to skip the steps of selecting physics interfaces and study
type.
3 In the Home toolbar, click Add Component and select 3D.

I m p o r t i n g t h e G eo m e t r y

Before importing the CAD file, make sure that the CAD kernel is used.
1 In the Model Builder window, under Component 1 (comp1) click Geometry 1.
2 In the Settings window for Geometry, from the Geometry representation list,
choose CAD kernel.
3 In the Home toolbar, click Import .
4 In the Settings window for Import, click Browse.

26 |
5 In your COMSOL installation directory navigate to the folder applications/
CAD_Import_Module/Tutorial_Examples and double click the file
wheel_rim.x_b.
6 Click Import.

Using Remove Details

If you already know that your imported CAD geometry needs defeaturing, an
effective workflow is to add the Remove Details feature to the geometry sequence,
then build a mesh. Meshing may reveal that further defeaturing is needed, in
which case you can go back and adjust the tolerance for Remove Details, or add
additional Remove Details, or other virtual geometry operations. Test this
workflow on the imported wheel rim geometry.
1 In the Geometry toolbar click
Remove Details .
2 Click the Build Selected button in
the Settings window for Remove
Details.
The Remove Details operation
analyzes the geometry to find and
remove details such as vertices with
continuous tangent, short edges,
small and sliver faces, narrow face
regions, and thin domains. These
details are removed by setting up a
sequence of virtual geometry
operations.
According to the Information section
in the Settings window for Remove
Details, several vertices and edges
were ignored, and edges, faces, and
face regions were collapsed.
The automatically determined size
for the details that are removed is
calculated as 0.001 times the longest
edge of the bounding box for the
input entities. Depending on the
input this tolerance could be too
small, so that further defeaturing may

| 27
be needed. The fastest way to determine if this is the case is to build the mesh
and check if the mesh generator displays any Information about small entities.
3 In the Home toolbar, click Build Mesh .

4 Expand the Mesh 1 node in the Model Builder.


Two Information nodes are displayed under Mesh 1.
5 In the Selection list inside the Settings window for Information 1, click edge 39.
6 In the Mesh toolbar, click Measure .
The Messages window displays the length of the edge, which is 8.3282e-4 m —
that is, 8.3282·10-4 m or about 0.033 inches. All edges in the list have the same
length, and all are found on the spokes of the wheel. Now that you know the
length of these remaining short edges, you can go back and modify the
tolerance for Remove Details so that these edges can also be deleted. But first,
examine the second Information node.

28 |
7 Select Information 2 under the Mesh 1 node.
The face appearing in this Information node has several narrow regions
(indicated by blue rectangles in the figure below), which cannot be resolved
well enough using the current mesh size settings.

Since it is not easy to measure the width of a narrow face region without
modifying the geometry, the fastest way to remove the narrow region is to
manually increase the tolerance for Remove Details until the narrow regions are
removed.
8 Click the Remove Details 1 node in the Model Builder.
9 In the Parameters section, choose Absolute from the Detail size list.
The currently displayed value, about 5e-4, is the automatically determined
tolerance that was used the last time Remove Details ran.
10Increase the Maximum absolute size to 8.5e-4.
11Click the Build Selected
button.
The table in the Information
section in the Settings window for
Remove Details should now look
like in the screenshot to the right.
12In the Mesh toolbar, click Build
Mesh .
No Information nodes remain. In the following, take a closer look at how
Remove Details deletes the small entities from the geometry.

| 29
Manual Mode for Remove Details

1 In the Remove Details settings window, locate the Mode of operation list and
set it to Manual.
The Remove Details node in the
Model Builder expands to reveal the
automatically generated sequence of
virtual geometry operations.
In manual mode you can examine and
edit each individual operation. You
could, for example, exclude entities
that you do not want to remove from
the geometry. You could also add
further virtual operations to the
automatically generated sequence to
remove additional entities.
Details are removed in different passes
using increasing tolerances to remove
larger and larger details. A simple
geometry may only need one pass, but with a more complex geometry, like this
wheel rim, the Remove Details operation goes through three passes and a
cleanup pass at the end. Take a closer look at some of the virtual operations in
the sequence.
2 In the Model Builder window, under
Component 1 (comp1)>Geometry 1>Remove Details 1 (rmd1) click
Collapse Faces 1 (aclf1) .
3 In the Settings window for Collapse Faces, under Faces to collapse, toggle the
Activate Selection toggle button.

30 |
4 Use the Zoom to Selection button to find some of the faces on the rim.

Both small faces and sliver faces are removed in this operation. Small faces with
sides that are similar in length are usually collapsed into a vertex, whereas sliver
faces that have a high aspect ratio are more often collapsed into one of the
longer edges. As an alternative to the Collapse Faces operation you can also use
the Merge Edges operation that gives more control over which edges are kept
when collapsing faces.
5 Click the Build Selected button.

6 In the Model Builder window, click Ignore Edges 1 (aige1) .

| 31
7 In the Settings window for Ignore Edges
toggle the Activate Selection toggle
button, then find some of the edges on the
geometry by using Zoom to Selection .
All edges in the list are next to sliver faces,
similarly to the image displayed to the
right. The sliver faces are wider compared
to those that were collapsed in the
previous operation. The faces on the two
sides of the edge are continuous across the
edge, and it is thereby suitable to form a
larger composite face by ignoring the
edge.
As an alternative to the Ignore Edges operation you can also use the Form
Composite Faces operation.
8 Click the Build Selected button. The
geometry in the Graphics window is
updated with the newly formed composite
faces.
The vertex adjacent to the removed edge
can also be removed to avoid leaving a
short edge in the geometry. This is done
by the next operation in the sequence.
9 In the Model Builder window, click
Ignore Vertices 1 (aigv1) .
10Click Build Selected in the Settings
window for Ignore Vertices.

The sequence of virtual operations generated by Remove Details includes


several other Ignore Edges and Ignore Vertices operations to remove slivers

32 |
with increasing face width. In the following take a closer look at the Collapse
Face Regions operation, that is added to the sequence to detect and remove
narrow face regions.
11In the Model Builder window, click Collapse Face Regions 1 (acfr1) .
12In the Settings window toggle the Activate Selection toggle button.
The face with the narrow regions is on the back of the rim, it is the very same
face that appeared in the mesh warning in the first part of this tutorial.

13Click Build Selected in the


Settings window for
Collapse Face Regions.
The operation removes a detected
narrow region by first partitioning
the edges adjacent to it by creating
vertices. Then, new edges are created
between the vertices to partition the
face. This creates a sliver face in place
of the narrow region. As the last
step, the created sliver face is
collapsed into an edge.
Finally, switch Remove Details to automatic mode, and mesh the geometry.
14In the Model Builder window, click Remove Details 1 (rmd1) .
15In the Settings window for Remove Details, locate the Mode of operation list
and set it to Automatic.
16In the Mesh toolbar, click Build Mesh.

| 33
Creating a Fluid Domain Inside a Solid Structure

The majority of 3D CAD files include only the geometry of the product to be
manufactured. For finite element analysis, however, you find yourself often in a
situation where additional geometry is needed, for example, to analyze the flow
inside or outside a device. The example in this section, involving the geometry for
an exhaust manifold, demonstrates how to create an extra domain for flow analysis
after importing and defeaturing a CAD assembly. The following steps are covered:
• Importing a Parasolid® file
• Deleting a larger detail from the geometry
• Creating the union of all imported objects needed to generate a domain
inside the objects
• Moving the imported objects to eliminate a gap
• Using the cap faces operation to create the additional domain
• Controlling where an operation is inserted in the geometry sequence
• Finding and removing fillets and holes from the geometry

Model Wizard

1 Start COMSOL Multiphysics.


2 Select Blank Model to skip the steps of selecting physics interfaces and study
type.
3 In the Home toolbar, click Add Component and select 3D.

I m p o r t i n g t h e G eo m e t r y

Before importing the CAD file, make sure that the CAD kernel is used.
1 In the Model Builder window, under Component 1 (comp1) click Geometry 1.
2 In the Settings window for Geometry, from the Geometry representation list,
choose CAD kernel.
3 In the Home toolbar, click Import .
4 In the Settings window for Import click the Browse button.

34 |
5 In your COMSOL installation directory navigate to the folder applications/
CAD_Import_Module/Tutorial_Examples and double click the file
exhaust_manifold.x_b.
6 Click Import.
As soon as the import is done the geometry appears in the Graphics window.

The geometry consists of three solid objects and is hollow inside.

Opening the Selection List Window

When working with imported CAD assemblies it is helpful to view a list of the
imported objects. You can do this in the Selection List window.
1 In the Geometry toolbar, click Selection List.
2 In the Selection List window that appears, click through the listed objects to
identify each component.
The name of an imported object is derived from the tag of the import feature
and the name of the object from the imported CAD file, or a number when the
file does not contain any names. The list also indicates the object type, which
can be solid (objects with an interior volume), surface, or mixed. The lower

| 35
section of the window that lists named selections is empty as there are no named
selections in the model.
The three imported solid objects are the downpipe (imp1(1)), the gasket
(imp1(2)), and the manifold (imp1(3)).

Deleting Details

Defeaturing an imported CAD geometry may involve deleting geometric details


that may not be important for a simulation. In the following use the Replace Faces
operation to remove the mounting bracket from the downpipe.
1 Click the Zoom Box button in the Graphics toolbar and zoom in to the
mounting bracket.

2 In the Geometry toolbar, click Defeaturing and Repair and choose


Replace Faces.
Using this tool you can delete larger geometric details, and the resulting gap is
automatically healed by one of two methods: the surrounding faces are grown
or shrunken to cover the gap; a new face is constructed based on the edges of
the gap.
Add the boundaries of the bracket to the Faces to delete list in the Tools
window for Replace Faces. The easiest to do this is as follows.
3 Click the Select Box button in the Graphics toolbar.

36 |
4 Hold the left mouse button to draw a square around the bracket to select its
faces. Make sure that the selection includes all faces that make up the bracket,
including the fillet faces.

5 In the Tools window for Replace Faces, click Replace Selected.


The faces of the mounting detail are removed and the surrounding boundaries
are extended to cover the gap.

| 37
Creating an Explicit Selection

The Cap Faces operation, which you will use to create a domain inside the
manifold, needs an input in form of the bounding edges of the empty volume that
should be turned into a solid. For this exhaust manifold these are the edges
highlighted in the figure below.

You could select these edges directly in the Cap Faces operation, however a more
efficient way, which only requires the selection of one segment from each edge
loop, is to use an Explicit Selection where you have the option to automatically
include continuous edges in the selection.
1 In the Geometry toolbar click Selections and choose Explicit Selection .
2 In the Settings window for Explicit Selection select Edge from the Geometric
entity level list.
3 Also select the Group by continuous tangent check box.
4 From the Graphics window select one edge each from the edge loops
highlighted in the figure above. Continuous edges are automatically added to
the selection. When done check that all edges are highlighted, just as in the
figure.
5 Switch to the Selection List window, or open it again, to check that
Explicit Selection 1 now appears under Edge Selections.

38 |
Creating the Union of All Objects

The Cap Faces operation can only generate a solid domain inside the manifold if
the created faces result in a new closed volume. To make sure that this is the case
you will now create the union of all imported objects.
1 In the Geometry toolbar, click Booleans and Partitions and choose Union.
2 Click the Select All button in the Graphics toolbar.
3 In the Settings window for Union, click Build Selected.
Examine this new geometry object using the Measure tool.
4 Right-click Geometry 1 and choose Measure.
5 Select the object uni1 in the Graphics window.

According to the information displayed in the Measure window the object uni1
contains 4 domains.
If the 3 objects do not overlap, the expected result after the union is an object
with 3 domains. The presence of an additional domain after the Union
operation indicates an overlap between the imported objects.

| 39
D e t e c t i n g I n t e r fe r e n c e s

The easiest way to check imported


CAD assemblies for overlaps and gaps is
to use the Detect Interferences tool.
Since this tool works on individual
objects, you can build the Import 1
feature first.
1 In the Model Builder window,
right-click Import 1 (imp1) and
choose Build Selected.
2 In the Geometry toolbar, click
Defeaturing and Repair and choose
Detect Interferences.
3 In the Tools window, Click
Find Interferences.
4 From the Interfering Faces list, select
Intersection 1 and click
Zoom Selected, then rotate and pan
to get a better view of the region
around the interfering objects,
similar to the figure below.

40 |
The objects not involved in the intersection are hidden by default, this makes it
easier to visualize each intersection.
5 From the Show in graphics list, choose All objects.

It seems that in addition to the overlap there is also a gap between the gasket
and the manifold. This is also evident since the interference detection tool did
not find any touching boundaries. Try to increase the tolerance for the
Detect Interferences tool in order to detect and get a measurement of the gap.
6 In the Tools window for Detect Interferences, in the Tolerance text field, type
0.7[mm].

| 41
7 Click Find Interferences.

This time the gap is detected. The gap distance is displayed in the
Interfering faces list, and it is 0.4 mm.
8 Examine the faces involved in the intersection and gap by expanding the entries
in the Interfering faces list and clicking on the subnodes. Selected boundaries
are highlighted in the Graphics window. Turn on Wireframe Rendering
from the Graphics window for a better view, click the same button again to turn
it off.

Moving the Objects to Close the Gap

One way to close the gap is to move the gasket such that it will touch the manifold.
Since the touching boundaries are planar faces, you can align the two objects using
a Rigid Transform operation. Rigid Transform moves an object until its chosen
source coordinate system matches a chosen target coordinate system. You will
start with configuring two Work Planes that will define the source and target
coordinate systems.
1 In the Model Builder window, click Import 1 (imp1).
2 Click the Select Objects button in the Graphics toolbar.
3 Click the Click and Hide button in the Graphics toolbar.
4 In the Graphics window select the object for the manifold (imp1(3)) to hide it
from view.

42 |
5 In the Geometry toolbar, click Work Plane.
This first work plane will become the source Work Plane for the gasket.
6 In the Settings window for Work Plane, from the Plane type list, choose
Face parallel.
7 In the Graphics window, on the object for the gasket (imp1(2)), select
Boundary 4 (the boundary that will touch the manifold).

8 In the Label text field, type gasket coordinate system to recognize the
plane later.
9 Click Build Selected.
10Click the View Hidden Only button in the Graphics toolbar to display only
the object for the manifold in the Graphics window.
11To make the setup of the next work plane easier click the
Wireframe Rendering button in the Graphics toolbar.
12In the Geometry toolbar, click Work Plane. This will define the target
coordinate system.
13In the Settings window for Work Plane, from the Plane type list, choose
Face parallel.
14In the Graphics window, on the object for the manifold (imp1(3)), select
Boundary 83, which is the boundary that will align with the gasket.

| 43
15Select the Reverse normal direction check box. After this the arrow for the
zw direction should point in the same direction as in the figure below. Since
Rigid Transform moves the objects by aligning the coordinate systems, the
z-axes of the two work planes must point in the same direction.

16In the Label text field, type manifold coordinate system to recognize the
plane later.
Reset the view settings.
17Click the Wireframe Rendering button in the Graphics toolbar.
18Click the View Unhidden button in the Graphics toolbar.
19Click the Reset Hiding button in the Graphics toolbar.
20In the Geometry toolbar, click Transforms and choose Rigid Transform.
21In the Graphics window, select the object for the gasket (imp1(2)).
22In the Settings window for Rigid Transform, locate the
Coordinate System for Objects section.
23From the Work plane for objects list, choose gasket coordinate system (wp1).
24Locate the Coordinate System to Match section. From the Work plane list,
choose manifold coordinate system (wp2).

44 |
25Click Build Selected.

The gap between gasket and manifold is now eliminated, but there is still a slight
overlap between the gasket and downpipe. Further ahead, you will delete the
thin domain that results from the overlap by using Remove Details.

Creating a Domain with Cap Faces

At this time the geometry is ready for creating the inside domain. First you need
to make sure that the Cap Faces operation will be inserted after the Union 1 node
in the geometry sequence.
1 In the Model Builder window, right-click Union 1 (uni1) and choose Build
Selected.

| 45
2 In the Geometry toolbar, click
Defeaturing and Repair and
choose Cap Faces.
The bounding edges of the empty
volume inside the manifold are
included in Explicit Selection 1
(sel1).
3 In the Settings window for
Cap Faces, from the
Bounding Edges list choose
Explicit Selection 1, which still
includes the correct edges since
geometry operations are associative.

46 |
4 Click Build Selected to complete the operation.
The operation closed off the inlets and outlets with new faces. The operation
also created a solid domain where it used to be a void inside the exhaust
manifold.

According to the Information section of the Settings window for Cap Faces,
5 boundaries and 1 domain were created.

| 47
Removing Fillets from the Geometry

Assume that you are preparing the geometry for a heat transfer analysis for which
you have decided to remove some fillets.
Note: A geometry object that contains more than one domain is a nonmanifold
object which does not support defeaturing operations such as deleting fillets.
In order to remove the fillets you need to insert the Delete Fillets operation before
the Union 1 node in the geometry sequence.
1 Under the Geometry 1 node, right-click Union 1 (uni1) and choose
Build Preceding .
The Union 1 (uni1) node becomes unavailable, and the Explicit Selection 1
(sel1) node becomes the current node, which is indicated by a green rectangle
around its icon. You can now apply the defeaturing operation, as it is inserted
before the Union 1 (uni1) node.
2 In the Geometry toolbar, click
Defeaturing and Repair and
choose Delete Fillets.
3 In the Tools window all objects
already appear in the Input objects
list, and you can enter 0.003 in the
Maximum fillet radius text field.
4 Click Find Fillets to search for
fillets with a radius less than 0.003
m in the geometry.

48 |
5 Seven fillets are found by the tool. These appear in the Fillet selection list, and
they are also highlighted on the geometry.

6 Clicking Delete All in the Tools window to remove all detected fillets.
As the operation completes and the fillets are
removed note that the Delete Fillets 1 (dfi1)
node is inserted into the geometry sequence,
just above the Union 1 (uni1) node. The
Union 1 (uni1) node is still unavailable,
meaning that it is currently not built.

| 49
Deleting Holes from the Geometry

You can find and delete cylindrical holes in solid objects just as easily as deleting
fillets.
1 In the Tools window for Delete Fillets, click Delete Holes.
2 In the Maximum hole radius text field, type 10[mm].
3 Click Find Holes.
The tool found 22 holes, which appear in the Hole selection list, and they are
also highlighted on the geometry.
4 Click Delete All to remove all holes.

The holes are now deleted, and, similarly to the previous defeaturing operation,
a Delete Holes 1 (dho1) node is inserted into the geometry sequence just above
the Union 1 (uni1) node.

R e m o v i n g a T h i n D o m a i n U s in g R e m o v e D e t a i l s

1 In the Geometry toolbar, click Remove Details.

50 |
2 In the Settings window for Remove Details, click Build Selected.

The thin domain is automatically detected and removed by Remove Details.


The removal of the domain is also
confirmed in the Information section
in the Settings window for
Remove Details.
To understand how the thin domain
is removed switch Remove Details to
manual mode.
3 In the Remove Details settings window, locate the Mode of operation list. Set
it to Manual.
4 In the Model Builder window, expand the
Remove Details 1 (rmd1) node.
The operation generates and builds a sequence of
virtual operations. The thin domain is removed by
the last two operations in the sequence: Collapse Faces 1 (aclf1) and Ignore
Faces 1 (aigf1). The sliver faces that make up the sides of the thin domain are
first collapsed, then one of the interior faces is ignored.

| 51
5 Click on the Collapse Faces 1 and Ignore Faces 1 nodes in the Model Builder
window, then activate their selections to see the input faces highlighted in the
Graphics window.
Finally reset Remove Details to automatic mode and generate a mesh for the
geometry.
6 In the Model Builder window, click Remove Details 1 (rmd1).
7 In the Settings window for Remove Details, locate the Mode of operation list
and set it to Automatic.
8 In the Model Builder window, under Component 1 (comp1) click Mesh 1.
9 In the Settings window for Mesh, from the Element size list, choose Fine.
10In the Settings window for Mesh, click Build All.

52 |

You might also like