Bonded contact elements #4019
Answered
by
mikerife
AidanMcConneheyOVT
asked this question in
Q&A
-
I'm sure this is just a simple matter of an attribute that I'm missing, but when using gcgen I'm not sure how to apply bonded contacts as opposed to frictional. As an example, here's an implementation that leverages the setup used in the ANSYS documentation examples: from ansys.mapdl import core as pymapdl
# Start MAPDL session
mapdl = pymapdl.launch_mapdl()
mapdl.clear()
mapdl.prep7()
# === Create Lower Volume ===
vnum0 = mapdl.block(0, 1, 0, 1, 0, 0.5)
mapdl.et(1, 187)
mapdl.esize(0.1)
mapdl.vmesh(vnum0)
# === Create Upper Volume ===
mapdl.esize(0.09)
mapdl.et(2, 186)
mapdl.type(2)
vnum1 = mapdl.block(0, 1, 0, 1, 0.50001, 1)
mapdl.vmesh(vnum1)
# === Automatically Generate Contact Elements ===
mapdl.nsel("s", "loc", "z", 0.5, 0.50001)
mapdl.esln("s")
mapdl.gcgen("NEW", splitkey="SPLIT", selopt="SELECT")
# === Apply Boundary Conditions ===
mapdl.finish()
mapdl.run("/SOLU")
# Fix bottom surface in all directions
mapdl.nsel("s", "loc", "z", 0)
mapdl.d("ALL", "ALL", 0)
# Apply lateral force on top surface
mapdl.nsel("s", "loc", "z", 1)
mapdl.f("ALL", "FX", 1000)
# Solve
mapdl.allsel()
mapdl.solve()
mapdl.finish()
# === Post-processing ===
mapdl.post1()
mapdl.set(1)
# Plot deformed shape and contact status
mapdl.plnsol("U", "X") # X displacement
mapdl.etable("CONTSTAT", "CONT", 19) # Contact status flag (SSTAT)
mapdl.pltab("CONTSTAT") # Plot contact status My current theory is that the code is failing due to it being not fully constrained in the contact region. |
Beta Was this translation helpful? Give feedback.
Answered by
mikerife
Jun 20, 2025
Replies: 1 comment
-
Hi @AidanMcConneheyOVT
Here are the non-postprocessing changes. This will solve. mapdl.clear()
mapdl.prep7()
# define linear material
mapdl.mp('ex', 1, 1e7)
mapdl.mp('nuxy', 1, 0.3)
# === Create Lower Volume ===
vnum0 = mapdl.block(0, 1, 0, 1, 0, 0.5)
mapdl.et(1, 187)
mapdl.esize(0.1)
mapdl.vmesh(vnum0)
# create node component of contacting face
mapdl.nsel('s', 'loc', 'z', 0.5)
mapdl.cm('node_contact', 'node')
mapdl.allsel()
# === Create Upper Volume ===
mapdl.esize(0.09)
mapdl.et(2, 186)
mapdl.type(2)
vnum1 = mapdl.block(0, 1, 0, 1, 0.5, 1)
mapdl.vmesh(vnum1)
# create node component of contacting face
mapdl.esel('s', 'type', '', 2)
mapdl.nsle()
mapdl.nsel('r', 'loc', 'z', 0.5)
mapdl.cm('node_target', 'node')
mapdl.allsel()
# === Automatically Generate Contact Elements ===
mapdl.gcgen("NEW", splitkey="SPLIT", selopt="SELECT")
mapdl.gcdef('auto', 'node_contact', 'node_target', 2, 2)
mapdl.tb('inter', 2, '', '', 'bonded')
mapdl.allsel() mike |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
AidanMcConneheyOVT
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @AidanMcConneheyOVT
There are a few things going on here:
Here are the non-post…