TAGGED: -compatibility, apdl, mechanical, pyansys, python, python-scripts, transient-structural
-
-
November 5, 2025 at 3:30 am
m.novoa
SubscriberHello everyone,
I am having trouble with a PyMechanical script for a Transient Structural analysis. The simulation starts, runs for a moment, and then stops without any Python errors or clear solver messages (a "silent failure"). It simply doesn't converge.
Here is the strange part: If I build the exact same model manually in the Ansys Mechanical GUI, it solves perfectly. This must mean my script is missing a default setting or property that the GUI applies automatically.
My Model Setup:
I am simulating a gripper mechanism:
- Analysis: Transient Structural.
- Bodies: 2x shafts, 2x Grippers, 1x Cylinder.
- Joints:
- Two Revolute Joints (Body-to-Ground) are applied to the "Shafts."
- Two Fixed Joints (Body-to-Body) connect the "Shafts" to their respective "Grippers."
- Contact: Frictionless contact between the "Grippers" and the "Cylinder."
- Important: The grippers are not touching the cylinder at Time = 0. There is a gap.
- Supports:
- A Fixed Support is applied to the end-face of the "Cylinder."
- Loads:
- A positive Moment (e.g., +1 N·m) is applied to the first Revolute Joint (around the Global Z-axis).
- A negative Moment (e.g., -1 N·m) is applied to the second Revolute Joint (around the Global Z-axis).
The goal is to have the moments rotate the arms, closing the grippers until they make contact with the fixed cylinder.I already did it in ANSYS and it work! but when tried to do it in the code it fails, all the tree of actions are the same

What default setting could the GUI be applying that I am missing in my script? Is there a hidden property for joints or large-gap contact that must be set via code?
there's a github with the code
https://github.com/mauryk7/Gripper-contact.gitÂ
Thank you for your help.
-
November 5, 2025 at 1:10 pm
SaiD
Ansys EmployeeHello,
Is the PyMechanical code writing the input file (.dat file) for the solver? If yes, could you compare the .dat file from the code vs the one you get when you up the simulation manually? You can compare them in Notepad++ or using some such tool. This could give us a clue as to what might be missing.
Â
-
November 7, 2025 at 7:16 pm
m.novoa
SubscriberThanks for the comment, but unfortunately, it doesn't even write the input file.
-
- You must be logged in to reply to this topic.
- LPBF Simulation of dissimilar materials in ANSYS mechanical (Thermal Transient)
- Convergence error in modal analysis
- APDL, memory, solid
- Meaning of the error
- How to model a bimodular material in Mechanical
- Simulate a fan on the end of shaft
- Nonlinear load cases combinations
- Real Life Example of a non-symmetric eigenvalue problem
- How can the results of Pressures and Motions for all elements be obtained?
- Contact stiffness too big
-
4177
-
1487
-
1363
-
1194
-
1021
© 2025 Copyright ANSYS, Inc. All rights reserved.
