Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



We will in this tutorial focus mostly on the scripting features available in APDL, as they are one of the main reasons to use APDL instead of other more graphical programs.

Info

We will in this tutorial assume that you are familiar with general programming features like variables, loops, statements etc.


Expand
titleWhat is Mechanical APDL?

The Ansys finite element solvers enable a breadth and depth of capabilities unmatched by anyone in the world of computer-aided simulation.  Thermal, Structural, Acoustic, Piezoelectric, Electrostatic and Circuit Coupled Electromagnetics are just an example of what can be simulated.  Regardless of the type of simulation, each model is represented by a powerful scripting language … the Ansys Parametric Design Language (APDL).  APDL is the foundation for all sophisticated features, many of which are not exposed in the Workbench Mechanical user interface.  It also offers many conveniences such as parameterization, macros, branching and looping, and complex math operations.  All these benefits are accessible within the Ansys Mechanical APDL user interface. 

BibTeX Referencing
reference@misc{ansys, title={Introduction to ANSYS Mechanical APDL},author = {ANSYS} , url={https://www.ansys.com/services/training-center/structures/introduction-to-ansys-mechanical-apdl}, journal={ANSYS}}



Panel
borderColor#dfe1e5
bgColor#eff9ff
borderWidth2
titlePage content

Table of Contents


How to run scripts in APDL

Scrips in APDL are usually executed by the use of one of two methods. The first method is to write (or copy & paste) your code directly into the command window available in APDL.

The other method is to read in an input file (txt file) containing your script. To do this, go to File → Read Input From, select the correct file form the menu and click OK.

When locating the correct file, you will often notice that APDL by default opens the wrong directory (e.g. C:USERS when you actually want ../Marine Konstruksjoner/Exercise 7). To fix this, we need to open APDL with our chosen working directory. We may do so by first opening the ANSYS Mechanical APDL Product Launcher and then choose the correct working directory before clicking Run.

Introduction to APDL commands

Although many APDL commands are similar to what we are familiar with from other programming languages, very few have the exact same syntax. This means that to fully understand your code, and to further improve it, you will have to read the APDL commands documentation.

Info

The easiest way to locate the correct documentation is to open Mechanical APDL and click Help → Help Topics. Since we will focus on the scripting part of APDL, the Command reference documentation is the most relevant to us.





BibTeX Display Table