Ansys Learning Forum Maintenance

NOTICE: We will be performing backend maintenance of our Learning Forum from April 5 to April 12, 2021. The result will be a new infrastructure but with little impact to user experience and design. Currently the forum is accessible in read-only mode as we complete our final migration. Thank you for your patience. For urgent issues please visit HERE.


Stability of Workbench when run from command line — Ansys Learning Forum

Stability of Workbench when run from command line

langlinatorlanglinator Member Posts: 34
edited March 7 in Embedded Software

Hi,

I have a project in which I am automatically running Workbench. I have a Python 3.* script which runs Windows Command Line, which calls a Workbench project (with 1 mechanical system). It does some data i/o, runs an analysis, then outputs the result.

I call this iteratively, hundreds of time through my Python script.

I am encountering a problem where, for no apparent reason, the Command Line entry (calling Ansys) gets stuck. Normally when my script starts Ansys, I get a nice CMD window with the Workbench coding showing. On occasion, the CMD window opens, but no text shows. My script is waiting for the output of Ansys, which never runs.

This happens maybe 1 in 1000 times. I can run the same data again, without the problem replicating. It is very inconvenient as it renders my script run (taking many hours) useless.

I have had some success avoiding this by adding a 20s delay before each time my script runs Ansys, however it has not eliminated the problem. My thought here was that it could be an issue with delay of licenses checking in/out.

I am looking at ways to program around this in Python, but wondered if anyone has any similar experience / solutions.

Comments

  • langlinatorlanglinator Member Posts: 34

    Further comment: After terminating the commandline process, due to Ansys being non-responsive, the project is locked. So I can't even just run the same command again, if some length of time without a result has passed.

    I investigated this further by unlocking the project, then sending the command (manually), identically to the last automated command (same command, same data). Ansys ran successfully. This must be an instability in the way Ansys is run from commandline.

  • KremellaKremella Admin Posts: 2,468

    Hello,

    This might be a tricky issue to troubleshoot, especially because the issue is not reproducible.

    One possibility is that WB gets disconnected from the license. Perhaps reviewing the %TEMP%\.ansys log files upon failure to see if any logs display licensing errors.

    Which version of Ansys are you using? If you are not using the 2021R1, I suggest you give this a try and see if the issue resurfaces.

    Also, regarding the locked project, this is expected behavior when WB crashes. It is to salvage the WB files on the local hard drive. in the event of a crash.

    Please let us know your findings.

    Thanks.

    Karthik

  • langlinatorlanglinator Member Posts: 34
    edited April 1

    I am using 2021R1. I scripted around this in Python in the end (to manage the hanging condition).

Sign In or Register to comment.