January 4

ANSYS APDL: Everything to Know

ANSYS APDL: Everything to Know

Sohaib Alam

What is ANSYS APDL and why it is still used today?

ANSYS has several design languages that they incorporate for the vast number of simulation capabilities that ANSYS allows its users to have. One of the most prominent design languages used by ANSYS is the APDL.

Table of Contents (click to navigate)

What is ANSYS APDL?

ANSYS APDL or ANSYS Parametric Design Language is the primary language used to commute with the Mechanical APDL solver. APDL is commonly used to automate the task or even make a complete parametric model. It comprises of a wide array of different features such as matrix and vector operations, do-loop and if-then-else functions. ANSYS APDL is a time-tested old-fashioned command-driven program that allows the user to input line by line codes one at a time and execute them on demand. Using APDL instead of the modern user-interface is said to give the users more power and control over each step of their simulation.

Writing simple codes in ANSYS APDL

Five common ANSYS APDL commands users should know

The APDL code system has a number of different codes that the users can memorize to speed up and streamline their workflow. Some of the common set of codes are discussed below;

  1. /SOLU – /POST1 – /PREP7 /FINISH – Processors

The APDL program has a total of ten processors. In the past, there used to be more than ten processors, but now most of them have been undocumented. The commands that the users use are at times dedicated to one processor only. In the case where you input a preprocessor command when you are in the postprocessor section, the system will generate an error. 

If you create a command in your ANSYS APDL model, it will be performed directly into the pre-processor, solution processor, and in the post-processor. Regardless of where you are in the model tree of your project, if you need to go from your current processor to another processor, you just need to insert the proper set of commands to change the processors. The following are the processor types and their respective commands.

/SOLU – this command will take you into the solution processor. This processor comprises of all the design modification and changes that need to be done to your geometry. This is the most visited processor in product design and testing. 

/POST1 – this command will take you to the post-processor. The post-processor allows the users to work with their results, makes graphical outputs, and do in-depth post-processing.

/PREP7 – this command takes the users to the pre-processor. This command is seldom used as the users are already in this processor while working on their product. This processor enables the users to change elements, create things, or modify the meshing according to the requirements.

/FINISH – this command takes the users to the first level. The users usually go to this processor only when they require the name changing or changes to the file properties.


2.*GET command

*GET is one of the most useful and innovative command in the ANSYS APDL. This command is a way to interrogate your model with all sorts of the useful information such as the largest Y value for node position, number of nodes, loads on a particular node and the information on results. The *GET command is known to save user time and energy to get what they require in a matter of few clicks. 


3.CM/CMSEL

All the ANSYS Mechanical users are quite familiar with the section of Named selection. Named selection is the group of entities such as the edges, vertices, and elements that are grouped so that the user can scope on them rather than selecting each function individually. In terms of ANSYS APDL language, these are termed as components and commands. Any named selection that the user creates into ANSYS APDL is automatically converted into nodal components. All the nodes

that are in contact with the Named selection are converted into components. The user can also create their own nodes and elements.

The user can also use CM to create your own components in the ANSYS APDL script or can select components with the CMSEL command. The users must give it a unique name and operate it away.

MATLAB can also be used to write APDL codes and commands


4./OUTPUT

When you are using ANSYS APDL solver, the solver writes part of the user information to a file named jobname.out. The jobname is the name of your solver job. In some cases, the users may want to write out specific information on the output file. To do so, the user must use /OUTPUT file command to redirect the output to the file. When you are done specifying the /OUTPUT with no options, the settings will go back to the standard output. 


5.NROTATE

One thing that each user must be aware of that is that each model has a rotation element associated with it. By default, the UZ, UY and UX DOF are oriented with the global Cartesian coordinate system. Under ANSYS Mechanical, when you specify a boundary condition or a load as tangent or normal to the surface, APDL automatically rotates the nodes so that the DOF is normal to the surface. 

In the case where you want to apply a boundary condition or load in a particular direction besides the Cartesian plane, use the NROTATE function. The user technically has to select the nodes that he wants to rotate, specify the active coordinates with the CSYS, then issue the NROTATE command, select all and then rotate.

This list is certainly not a definitive list of important commands for APDL. Ask different regular ANSYS APDL users, and you might get a few commands in common. The key to using APDL is to know the fact that commands are your friend for this software, and you should learn how to implement these commands for your own benefit. 

Nodal Analysis carried out using ANSYS APDL

Why APDL still exist?

Though in the eyes of many of us, ANSYS APDL solver is an outdated method of doing simulations and setting up the model in different simulation setups, however, the core APDL users would argue that APDL is the best option that ANSYS has to offer. The following are some of the reasons why many professionals still prefer APDL over other solver systems.

More command and control at each step

The current solving methods and the modern GUI allows the user to select from preset options and have limited selections. Using presets and templates causes the users to lose control over the design and simulation in some cases. Though the loss of command is quite unnoticeable for most of the users, but for in-depth simulators, they need more control at each step of their simulation. The ANSYS APDL thus gives the users with more command and control at each phase of their simulation.

Better suited for programmers

In some cases, the user carrying out the simulations are good in programming and much more efficient in coding than navigating a complex GUI. For such users, who are fluent in coding and prefer the keyboard to write the commands rather than click here and there, the ANSYS APDL serves as a good platform to carry out their simulations.

Faster and efficient

Though ANSYS has worked hard to make the user interface as efficient and streamline as possible, no user interface can beat the power of direct coding to carry out the commands and the functions. Navigating to different panels and sections to do one part of the simulation is comparatively slower than just opening the APDL window and typing in the command.

Troubleshooting is easier

Troubleshooting via APDL window is comparatively easy if the user knows how to read the error reports. The conventional user interfaces simple states the error, whereas, in APDL, the user can directly work with the lines of code to see the error and work out the solution on the spot.

The future of ANSYS APDL

While there are some features that come and go in ANSYS with each of its iterations, ANSYS APDL is said to stay forever as all the functions and features of ANSYS are built upon it. Though learning APDL is not necessary, but if you do, it gives you an edge over conventional ANSYS users. There are many different courses available online that teach ANSYS APDL. If you are looking for an edge over your competitors, then APDL is what you should master.

References

  • ANSYS Inc., 2017. ANSYS Mechanical APDL Introductory Tutorials, Canonsburg, PA: ANSYS.
  • Ozen Engineering Inc, 2017. Introduction to ANSYS Mechanical APDL. [Online]
    Available at: https://www.ozeninc.com/classes-offered/
    [Accessed 2nd May 2019]. 

Loved this? Spread the word


About the Author

Sohaib Alam is an Undergraduate at the University of Sunderland specializing in Mechanical Engineering. Sohaib specializes in Physics among many other engineering subject matter. He focuses his writing on ANSYS and AutoCAD Inventor.

Sohaib Alam

Related posts

How to Use Bill of Materials (BOM) in SolidWorks: Review Beginner’s Guide

​Read More

Compare Autodesk Inventor vs Fusion 360: Review Which One to Buy

​Read More

How to Use Convert Entities Tool in SolidWorks: Beginner Tutorial

​Read More

[May 2020] Best Free CAD Design Software for Mac

​Read More
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Subscribe to our newsletter now!