ANSYS Mechanical is a very powerful tool right out of the box. Long gone are the days when an FEA tool was just a solver, and users had to write code to create input files and interpret the results. Most of the time you never have to write anything to effectively use ANSYS Mechanical. But, users can realize significant gains in productivity and access greater functionality through customization. And it is easy to do.
Before we talk about the four options, we need to remember how the tool, ANSYS Mechanical, is actually structured. The interface that users interact with is a version of ANSYS Workbench called ANSYS Mechanical. The interface allows users to connect to geometry, build and modify their model, set up their solution, submit a solve, and review results. The solve itself is done in ANSYS Mechanical APDL. This is the original ANSYS Multiphysics program.
When you press the solve button ANSYS Mechanical writes out commands in the languages used by ANSYS Mechanical APDL, called the ANSYS Parametric Design Language, or APDL. Yes, that is where ANSYS Mechanical APDL got its name. We like to call it MAPDL for short. (Side note: years ago we started a campaign to call it map-dul. It didn’t work.) Once the file is written, MAPDL is started, the file is read in, the solve happens, and all of the requested output files are written. Then ANSYS Mechanical reads those files and shows results to the user.
Customization Tool 1: Command Snippets for Controlling the Solver
Not every capability that is found in ANSYS Mechanical APDL is exposed in the interface for ANSYS Mechanical. That is not a problem because users can use the APDL language in ANSYS Mechanical to access the full capability of the solver. These small pieces of code are called Snippets and they are added to the tree for your ANSYS Mechanical model. When the solver file is written, ANSYS Mechanical inserts your snippets into the command stream. Simple and elegant.
PADT has a seminar from back in 2011 that lays it all out. You can find the PowerPoint Presentation here. We do have plans to update this webinar soon.
This approach is used when you want to access capabilities in the solver that are not supported in the interface but you want to get to those features and keep track of them from inside your ANSYS Mechanical Model.
If you are not familiar with APDL, find a more “seasoned” user to help you. Or you can teach yourself APDL programming with PADT’s Guide to APDL .
Customization Tool 2: ANSYS Customization Toolkit (ACT) for Controlling the User Interface and Accessing the Model
As mentioned above, ANSYS Mechanical is used to define the model and review results. The ANSYS Customization Toolkit (ACT) is how users customize the user interface, automate tasks in the interface, add tools to the interface, and access the model database. This type of customization can be as simple as a new feature, presented as an app, or it can be used to create a focused tool to streamline a certain type of simulation – what we call a vertical application.
Unlike APDL, ACT does is not have its own language. It uses Python and is a collection of Application Programmer Interface (API) calls from Python. This is a very powerful toolset that increases in capability at every release. PADT has written stand alone applications using ACT to reduce simulation time significantly. We have also written features and apps for ourselves and users that make everyday use of ANSYS Mechanical better.
Do note that ACT is supported in most of the major ANSYS products and more capability is being added across the available programs over time, not just in ANSYS Mechanical. You can also use ACT to connect ANSYS Mechanical to in-house or 3rd party software.
Because this is a standard environment, you can share your ACT applications on the ANSYS App Store found here. Take a look and you can see what users have done with ACT across the ANSYS Product suite, including ANSYS Mechanical. PADT has two in the library, one for adding a PID controller to your model and the other is a tool for saving your ANSYS Mechanical APDL database.
Another great aspect of ACT is that it is fully documented. If you go to the Customization Suite documentation in the ANSYS help library you can find everything you need.
Customization Tool 3: APDL for Automating the Solve
With Code Snippets we talked about using APDL to access solver functions from ANSYS Mechanical that were not supported in ANSYS Mechanical. You can also use APDL to automate what is going on during the solve. Every capability in the ANSYS solver is accessible through APDL.
The most common usage of APDL is to create a tool that solves in batch mode. APDL programs are used to carry out tasks without going back to ANSYS Mechanical. As an example, maybe you want to solve a load step, save some information from the solve, export it, read it in to a 3rd party program, modify it, modify some property in your model, then solve the next load step. You can do all of that with APDL in batch mode.
This is not for the faint of heart, you are getting into complex programming with a custom language. But if you take the time, it can be very powerful. All of the commands are documented in the ANSYS Mechanical APDL help and details on the language are in the ANSYS Parametric Design Language Guide. The PADT Blog is full of articles going back over a decade on using APDL in this way.
Customization Tool 4: User Programable Features in the Solver
One of the most powerful capabilities in the ANSYS Mechanical ADPL solver is the ability for end-users to add their own subroutines. These User Programable Features, or UPF’s, allow you to create your own elements, make custom material models, customize loads, or customize contact behavior.
There are other general purpose FEA tools on the market that heavily publicize their user elements and user materials and they try to use it to differentiate themselves from ANSYS. However, ANSYS Mechanical APDL has always had this capability. Many universities and companies add new capability to ANSYS using this method.
To learn more about how to do create your own custom version of ANSYS, consult the Programer’s Reference in the ANSYS Help. PADT also has a webinar sharing how to make a custom material here.
Next Steps
The key to successful customization ANSYS is to know your options, understand what you really want to do, and to use the wide range of tools you have available. Everything is documented in the help and this blog has some great examples. Start small with a simple project and work your way up.
Or, you can leverage PADT’s expertise and contract with PADT to do your customization. This is what a half-dozen companies large and small have done over the years. We understand ANSYS, we get engineering, and we know how to program. A perfect combination.
Regardless of how you customize ANSYS Mechanical, you will find it a rewording experience. Greater functionality and more efficient usage are only a few lines of custom code away.
You must be logged in to post a comment.