Page 158 - Using ANSYS for Finite Element Analysis Dynamic, Probabilistic, Design and Heat Transfer Analysis
P. 158
ChaPter 4
aPDl Programming
APDL stands for ANSYS Parametric Design Language, a scripting
language that you can use to automate common tasks or even build your
model in terms of parameters (variables). While all ANSYS commands
can be used as part of the scripting language, the APDL commands
discussed here are the true scripting commands and encompass a wide
range of other features such as repeating a command, macros, if-then-
else branching, do-loops, and scalar, vector, and matrix operations. While
APDL is the foundation for sophisticated features such as design optimi-
zation, probabilistic design analysis, and adaptive meshing, it also offers
many conveniences that you can use in your day-to-day analyses.
APDL is also a macro language to create macros. You can record a
frequently used sequence of ANSYS commands in a macro file (these are
sometimes called command files). Creating a macro enables you to, in
effect, create your own custom ANSYS command. In addition to execut-
ing a series of ANSYS commands, a macro can call graphical user inter-
face (GUI) functions or pass values into arguments.
4.1 Create the anaLysis fiLe
The analysis file is a key component and crucial to ANSYS optimization
and probabilistic design analysis. The program uses the analysis file to
form the loop file, which is used to perform analysis loops. Any type of
ANSYS analysis (structural, thermal, magnetic, etc.; linear or nonlinear)
can be incorporated in the analysis file.
There are two ways to create an analysis file:
• Input commands line by line with a system editor.
• Create the analysis interactively through ANSYS and use the
ANSYS command log as the basis for the analysis file.