# MV-1010: 3D Mesh-to-Mesh Contact Simulation

In this tutorial, you will learn about 3D rigid body contact capabilities in MotionSolve and use the mesh-to-mesh contact approach, which uses surface meshes for the bodies in contact during the simulation.

A surface mesh is an interconnected set of triangles that accurately represent the surface of a 3D rigid body. MotionSolve prescribes certain conditions for such a surface mesh.

• Each component mesh should form a closed volume. This means that the given mesh should not contain any open edges (edge which is part of only one element) or T- connections (2 elements joined at the common edge in the form of a T).
• Mesh should be of uniform size.
• Element surface normal should point in the direction of expected contact.
In this tutorial, you will learn how to:
• Import CAD geometry with graphic settings suitable for contact simulation.
• Setup 3D rigid body contact between meshed geometries in the multibody model.
• Perform a transient analysis to calculate the contact forces between these geometries.
• Post-process the results using a report generated automatically.

For this tutorial, you will use a slotted link model.

For this type of meshed representation of 3D rigid bodies, MotionSolve uses a numerical collision engine that detects penetration between two or more surface meshes and subsequently calculates the penetration depth(s) and the contact force(s).

There are numerous 3D contact applications (gears, cams, mechanisms with parts in contact, and so on) that may be solved using this approach.

A slotted link mechanism (sometimes also referred to as a scotch-yoke mechanism) is a type of mechanism used to convert an input rotational motion into continuous or intermittent translational motion of a sliding link or yoke part. The motion is transferred via a contact force between parts of the mechanism that are in contact. Both normal and friction contact force may be responsible for the transfer of motion.

Such mechanisms find common application in valve actuators, air compressors, certain reciprocating and rotary engines, among others. The figure below illustrates a slotted link mechanism that will be modeled in this tutorial.

## Import CAD Geometry into MotionView

1. Copy the slotted_link.x_t file, located in the mbd_modeling\contacts folder, to your working directory.
2. Start a new MotionView session.
3. Click ToolsImport CAD or FE using HyperMesh.
The Import CAD or FE using HyperMesh dialog is displayed.
4. Set the following options in the dialog:
1. Under Import Options, select Import CAD or Finite Element Model with Mass and Inertias.
2. From the Input File drop-down menu, select Parasolid.
3. Click the file browser icon, , to navigate to your working directory and select slotted_link.x_t as the input CAD geometry.
The Output Graphic File text field is automatically populated with the same path and name, however it is suffixed with a _graphic.h3d extension. This file will be used to specify the graphics in the model. You may change the name or path of the graphic H3D if you prefer.
4. Click to expand the Meshing Options for Surface Data section. Select Allow HyperMesh to specify mesh options.
5. Activate the Control mesh coarseness for contacts check box. Set the slider to 5.
Selecting this option instructs HyperMesh to mesh the CAD geometry so it can be used for 3D contact in MotionSolve.
Note: The slider controls the coarseness of the generated mesh, with 1 being the coarsest and 10 being the finest. A very coarse mesh has large triangles, which may not represent the curvature of the CAD surfaces accurately. Alternatively, a very fine mesh has extremely small triangles that may increase element numbers and thereby the solution time. The best practice is to strike a balance between mesh fineness and performance that satisfies the modeling purpose.
At this stage, the Import CAD or FE using HyperMesh dialog should look like the figure below:
5. Click OK.
MotionView invokes HyperMesh in the background to mesh the geometry and calculate its volume properties. The Import CAD dialog is displayed. From this dialog, you can review the components in the CAD file as well as their mass, density, and volume properties.
6. Click OK and clear the Message Log.
The converted geometry is loaded into MotionView for visual inspection. You can inspect the surface mesh by swapping the display to a meshed representation.
7. From the Visualization toolbar, click Graphic Entity Attributes, .
The Graphic Entity Attributes panel is displayed.
8. From the Graphic list on the left side of the panel, click Model to select all graphics, then click Mesh lines, .

## Create Joints and Motion

At this stage, the model contains the following bodies along with their associated graphics:

Entity name Entity type Description
Cam Rigid Body The cam body.
Pin Rigid Body The pin body. Together the cam and the pin bodies engage the slotted link.
Link Rigid Body A connector body between the pin and the cam.
Slotted_Link Graphic The graphic that represents the slotted link body. This is a tessellated graphic.
Cam Graphic The graphic that represents the cam body. This is a tessellated graphic.
Pin Graphic The graphic that represents the pin body. This is a tessellated graphic.
Link Graphic The graphics that represent the link body. This is a tessellated graphic.

The Pin, Link, and Cam bodies are fixed to each other and pivoted to the Ground Body at the Cam center. The Slotted_Link can translate with respect to the Ground Body.

1. Create joints, , per the details in the table below:
S.No Label Type Body 1 Body 2 Origin Alignment Axis
3 Cam Pivot Revolute Joint Cam Ground Body Global Origin Global Y
2. Apply a motion, , on the Cam Pivot joint of the type Displacement and define the Expression as 360d*TIME.

## Define Contact Between the Colliding Geometries

In this step, you will define contact between:
1. From the Force Entity toolbar, right-click on the Contact icon, .
The Add Contact dialog is displayed.
2. For the Label, enter Cam Slotted Link Contact. Select 3D Rigid To Rigid Contact and click OK.
3. From the Connectivity tab of the Contact panel, resolve Body I to Cam and Body J to Slotted_Link. This automatically selects the respective graphics that are attached to these bodies.
4. To properly define the geometries, ensure that the normals are oriented correctly and that there are no open edges or T-connections in the geometries.
5. Activate the Highlight contact side check box. This colors the geometries specified for this contact force element according to the direction of the surface normals. Verify that both geometries are completely red (to visualize clearly, you may have to deactivate the other graphic and reactivate).

The color red indicates the direction of the surface normal and is the side of the expected contact.

6. Check for open edges or T-connections. If the associated graphics mesh has any open edges or T-connections, the Highlight mesh errors option is active. If it is active, check the box for Highlight mesh errors.
Any open edges or T-connections in the geometry are highlighted.
The graphics associated in this contact entity do not have any mesh errors. Therefore, No mesh errors is displayed and grayed out.

The geometry is clean; there are no free edges or T-connections in the model.

Note: For every contact entity added to the model, MotionView automatically creates an output, , of the type Expression that can be used to plot the contact forces for that contact element.
7. Specify the contact properties. Click the Properties tab to display the Normal Force and the Friction Force property sub-tabs within the Contact panel. In this model, you will use an Impact model with the following properties:
Normal Force Model
Impact
Stiffness
1000.0
Exponent
2.1
Damping
0.1
Penetration Depth
0.1
Friction Force Model
Disabled
Note: MotionSolve supports several contact methodologies. A more detailed description on each method and their properties can be found at Force: Contact.
8. Change the location where contact forces are applied to a surface mesh.
2. From the Force Computed at drop-down menu, select Nodes.
Note: By default, contact forces are resolved at the center of each element of the surface mesh. This setting is satisfactory in most contact applications. However, you can force MotionSolve to apply the contact forces on the nodes of the surface mesh instead. This is useful in cases where a geometric edge is in contact but comes with a slight penalty in computational performance.
9. Repeat Steps 1 - 7 for creating contact between the Pin body (Body I) and the Slotted_Link (Body J). You may define the label for this contact to be Pin Slotted Link Contact. Define the same contact properties as listed in Step 7 above.
10. For the contact force element Pin Slotted Link Contact, find the precise time at which contact first occurs between the two colliding bodies.
2. Check the Find precise contact event box.
3. In the text field below, enter 0.01.
Note: With the Find precise contact event option, MotionView automatically adds a sensor entity (defined by Sensor_Event in the solver deck), which has a zero_crossing attribute. During simulation, when the contact force is detected for the first time (force value crossing zero), MotionSolve reduces its step size by the given factor and attempts to determine the contact event more precisely.

## Set Up a Transient Simulation and Run the Model

At this point, you are ready to set up a transient analysis for this model.

1. From the toolbar, click Run, , to open the Run panel.
2. Change the Simulation type to Transient and specify an end time of 3.0 seconds.
3. To obtain accurate results, specify a smaller step size than the default.
1. Click Simulation Settings to display the Simulation Settings dialog.
2. From the Transient tab, set the Maximum Step Size to 1e-3.
3. Click Close.
4. From the Run panel, specify a name for your XML model and click Run.
The transient simulation is started.
The HyperWorks Solver View dialog displays a message from the solver that confirms that the mesh-based contact method is being used for the contact calculations.
The log file contains messages related to the sensor. This is a result of finding the precise contact event for the second contact element in the model.

## Post-process the Results

After the simulation is complete, MotionSolve generates a summary table (both on screen and in the log file) that lists the top five contact pairs, ordered by maximum penetration depth and maximum contact force, for this simulation. This is useful since it can be used to verify that the model is behaving as intended, even before loading the results (ABF, MRF, PLT or H3D) files. You can also use this table to verify the penetration depths and contact forces are within the intended limits for your model. The summary table for this simulation is shown below:
1. Close the solver window.
2. To view a consolidated report of the results, click Analysis > View Reports.
A list of previous simulations you have completed using MotionView is displayed.
3. Select the Contact Report that corresponds to this simulation.
4. Click OK.

MotionView creates several pages in your current HyperWorks session.

### Visualize the Contact Forces via H3D

The first HyperView page (second in the session) displays a vector animation of contact force aggregated over the contact region. You may hide one or more parts to view this clearly in the modeling window. This is illustrated in the figure below.

Note: The forces may need to be scaled by magnitude or uniformly by a factor to be entirely visible. To change the scale, from the Vector panel, , click the Display tab and change the Size scaling option as appropriate.

### Contact Summary

Use the Page Navigation icon, , to navigate to the next page.

The third page in the session can be used to get an overall summary of the contact simulation. This page contains table that tabulates the summary, as well as a HyperView window that displays the penetration for the entire simulation. The table provides a summary of the maximum penetration depth and maximum force. This page provides a bird’s eye view of the contact phenomenon happening within the model. The contour of penetration depth is a static image that highlights all regions that come under contact during the entire period of the simulation.

### Visualize the Penetration Depth via H3D

Navigate to the next page.

The fourth page in the session can be used to visualize the penetration depth over the course of the simulation.

1. Set the graphic display to Transparent Elements and Feature Lines.
2. Click the Start/Pause Animation icon, , to animate the result.
The animation is shown in the figure below:

### Visualize MotionSolve Outputs

1. Select the Vector panel, .
2. For the Result type, select the result type from the drop-down menu and click Apply.
This plots the result type you selected for all relevant graphics in the model. You may have to scale the force vectors accordingly to make sure they are visible.
For example, the point slip velocity vectors are plotted in the figure below:

### Plot the Contact Forces via ABF

Navigate to the next page, . This is the last page in the session.
Each time a new contact entity is created in MotionView, a corresponding output force request is created that can be used to plot the contact forces between the graphics specified in the contact entity. These can then be visualized in HyperGraph. The last page of the contact report plots the contact force magnitude for all the contact elements in the model.

### Manually Plot Other Output Requests

1. Click Add Page, , and change the client to HyperGraph 2D, (if it is not already selected).
2. Click the file browser icon, , to open the ABF output file for the simulated model.
3. Under Y Type, select Expressions and select a request in the Y Request window.
Select REQ/70000003 Force - Pin Slotted Link Contact as the Y Request and F4 as Y Component to plot.
4. Click Apply.