Note
Go to the end to download the full example code.
Contact Element Example#
This example demonstrates how to create contact elements for general contact.
Begin by launching MAPDL.
from ansys.mapdl import core as pymapdl
mapdl = pymapdl.launch_mapdl()
Enter the pre-processor, create a block and mesh it with tetrahedral elements.
Second a volume block above the existing block and mesh it with quadratic hexahedral elements. Ensure that these blocks do not touch by starting it slightly higher than the existing block.
Note how these two blocks do not touch and the mesh is non-conformal.
Select all the elements at the intersection between the two blocks and generate contact elements.
mapdl.nsel("s", "loc", "z", 0.5, 0.50001)
mapdl.esln("s")
output = mapdl.gcgen("NEW", splitkey="SPLIT", selopt="SELECT")
print(output)
GENERATE GENERAL CONTACT ELEMENTS
FEATURE ANGLE FOR SURFACE SPLITTING = 42.0 DEGREES
ASSIGN SECNUM BASED ON SPLIT SURFACES
USE EXTERIOR FACES OF SELECTED ELEMENTS ONLY
Number of general CONTA174 elements created = 366
on exterior faces of 3D solid base elements
New general contact elements have Section ID from 3 to 4
Plot the contact element pairs. Note from the command output above that the section IDs are 5 and 6.
Here, we plot the element mesh as a wire-frame to show that the contact pairs overlap.
mapdl.esel("S", "SEC", vmin=3, vmax=4)
mapdl.eplot(style="wireframe", line_width=3)
Stop mapdl#
mapdl.exit()
Total running time of the script: (0 minutes 29.039 seconds)