General Mechanical

General Mechanical

Scripting – Workbench vs APDL

    • kramer
      Subscriber

      Scripts can be written for Workbench (.wbjn) or APDL (.inp). I'm in a situation where I have a large table with input parameters (eg. xlsx or csv), including geometry parameters. If necessary, I can modify them into any required format or split them into multiple files. Each line represents one simulation. Now I want to convert the data into Ansys jobs which are then queued and solved. The process should be automated. What is the best way to do that? Should I convert each line from the table to an .inp file and have them solved in a loop in APDL? The thing is, I think coding APDL is a bit clunky, especially when dealing with complex geometries. The alternative would be to record an exemplary .wbjn file in Workbench and then parametrize it include some code to read the input parameters for every subsequent sample from the table and wrap the whole thing into a loop. Are both ways equally good (or bad 😉)? Or does one have significant advantages over the other regarding performance etc?

    • Aniket
      Ansys Employee
      Can you please provide some more information? Are these input parameters defined using DesignModeler or SpaceClaim already and then you want to simply change parameters and rerun the current project?
      If that is the case, you do not need any scripting at all, and you should be able to use parameters manager to create different design points and run them one after the other. You can retain only specific output parameters from the runs or entire project if you have storage space.
      -Aniket
      How to access Ansys help links
      Guidelines for Posting on Ansys Learning Forum
    • kramer
      Subscriber
      No, the input parameters are not defined in Ansys. They include numerical point coordinates in plain text format, which I want to import into Ansys and then create the model geometry around them. I know about parameters manager but I think it's not possible to define a "point cloud" as an input parameter.
    • Aniket
      Ansys Employee
      I believe you should be able to create script parameters in SpaceClaim, (https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v211/en/spaceclaim/Discovery/user_manual/scripting.html) and then use regular parameter manager to run multiple design points usual way.
      Please note that workbench journals do not record things done inside SpaceClaim or Mechanical (you can still script them, in a different way) and hence I think I am focusing more on native resolution with parameters. It is very much possible to automate it either ACT python way or MAPDL way, but as you might have already noticed that creating geometries with point cloud in MAPDL can be somewhat difficult as compared to SpaceClaim.

      -Aniket
      How to access Ansys help links
      Guidelines for Posting on Ansys Learning Forum
    • kramer
      Subscriber
      Ok thanks. I'll try it and see how far I get ;)
Viewing 4 reply threads
  • You must be logged in to reply to this topic.