General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

PyMechanical Transient Analysis Fails to Solve (Silent Failure) – But Same Setup

    • m.novoa
      Subscriber

      Hello 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:

      1. Analysis: Transient Structural.
      2. Bodies: 2x shafts, 2x Grippers, 1x Cylinder.
      3. 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."
      4. Contact: Frictionless contact between the "Grippers" and the "Cylinder."
        • Important: The grippers are not touching the cylinder at Time = 0. There is a gap.
      5. Supports:
        • A Fixed Support is applied to the end-face of the "Cylinder."
      6. 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.

    • SaiD
      Ansys Employee

      Hello,

      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.

       

    • m.novoa
      Subscriber

      Thanks for the comment, but unfortunately, it doesn't even write the input file.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.