Sunteți pe pagina 1din 14

Chapter 3: APDL (“ANSYS

Parametric Design
Language”) 15.0 Release

Introduction to Mechanical
APDL (MAPDL)
1 © 2015 ANSYS, Inc. March 30, 2015
General Remarks on APDL
Command Syntax

2 © 2015 ANSYS, Inc. March 30, 2015


APDL Command Syntax
Although we created the model at the beginning of this course
interactively with menu picks in the GUI, MAPDL is a command-driven
program. The commands providing instruction to MAPDL are known
collectively as APDL (ANSYS Parametric Design Language).
• The GUI creates APDL commands and sends them to MAPDL, which processes
the commands continuously as they are received
• In response to the commands it receives, MAPDL performs the task requested
by the command and sends a “reply” (usually an brief description of how it
interpreted the command and of the action taken) to the Output Window.
 Modeling in MAPDL is much like an ongoing dialogue between the user
and the program
• As one works in the GUI, the commands it sends to MAPDL as well as any
entered directly on the command line are saved to an ASCII text log file
• A copy of the log file can be read into a new MAPDL session to recreate work
done in a previous session. Thus, a copy of the log file can serve as an input file.
• A text file can be created by a user knowledgeable in APDL syntax and read in
to automatically perform any number of tasks, including geometry creation or
import, element attribute definition, meshing, boundary condition assignment,
solution, and post processing. This is often referred to as an input file.
3 © 2015 ANSYS, Inc. March 30, 2015
MAPDL Command Syntax
ANSYS Parametric Design Language (APDL) is the command language that controls
MAPDL
• APDL commands begin with a command name followed by a comma-separated list of
arguments
• COMMAND_NAME,Field1,Field2,…,Fieldn
• COMMAND_NAME usually alludes to purpose for which the command is intended
• SPHERE creates a sphere, MP defines a Material Property, ET defines an Element
Type, SOLVE solves the model, PLNSOL Plots the Nodal SOLution results
• Alphanumeric data is entered in the fields
• The number of fields and the data required in each field is command dependent
• Commands are documented in the Help

• Note: sometimes the command name is referred to as “Field1” and the first data field is
referred to as “Field2”

4 © 2015 ANSYS, Inc. March 30, 2015


MAPDL Command Syntax

Before proceeding, it
will be helpful to
bring up the Help on
MAPDL Commands

5 © 2015 ANSYS, Inc. March 30, 2015


MAPDL Command Syntax
MAPDL is organized into two basic levels
• Begin level
• Processor (or Routine) level

Begin Level

/PREP7 /SOLU /POST1 /POST26 /AUX3

Begin level is a gateway into and out of the program and location for entering
global program control commands
• enter program at the BEGIN level
• slash commands (/PREP7, /SOLU, etc) are used to enter a processor
• FINISH command is used to exit processor and return to Begin level
6 © 2015 ANSYS, Inc. March 30, 2015
MAPDL Command Syntax
There are ~2000 commands in MAPDL, but many are rarely used.
• To facilitate finding a command that may suit your objective, commands are
grouped in the Help according to functionality and/or the Processor to which
they apply

GRAPHICS: display settings that


affect appearance of plots
PREP7: geometry, material
property definition, meshing, load
and boundary condition definition

SOLUTION: analysis type and


related solution options

POST1: General post processing

POST26: Time-history post


processing

7 © 2015 ANSYS, Inc. March 30, 2015


MAPDL Command Syntax
In the Help, command groupings are further refined into smaller groups
devoted to certain types of tasks. Commands applicable to material
property definition are shown here:
Clicking on “MP” will display the
documentation of the MP command

8 © 2015 ANSYS, Inc. March 30, 2015


MAPDL Command Syntax
APDL commands can be categorized into several groups based on the first
character and function
• Basic commands - those beginning with a letter
• Slash commands - those beginning with a forward slash (/)
• Star commands - those beginning with an asterisk (*)
• Tilda commands - those beginning with a tilda (~)

9 © 2015 ANSYS, Inc. March 30, 2015


MAPDL Command Syntax
Basic commands begin with a letter
• Most common type of APDL commands
• Typically perform an action
– D command defines DOF constraints on nodes
– NSEL command selects a group of nodes
– ANTYPE command defines analysis type
– SOLVE command initiates solution
– PLNSOL plots nodal solution results
Slash commands begin with a forward slash (/) and typically control
• Graphics
– /VIEW sets viewing direction
• Processor selection
– /PREP7 command opens the PREP7 processor
• File management
– /INPUT reads APDL commands from an existing external text file

10 © 2015 ANSYS, Inc. March 30, 2015


MAPDL Command Syntax
Star commands begin with an asterisk (*) and typically control
• Logic
– *IF conditionally causes commands to be read
• Input/output
– *VWRITE writes formatted data to a text file
• user interaction
– *ASK prompts the user to input a parameter value

Tilde commands begin with a tilde (~) and control external functionality with CAD
programs
• ~PARAIN reads a parasolid file

11 © 2015 ANSYS, Inc. March 30, 2015


MAPDL Command Syntax
Commands can be entered:
• Directly
– Individual commands can be typed into the Input Line
– Groups of commands can be cut and pasted from external text editor
– A text file containing commands can be read in (/INPUT)
• Indirectly by selecting them from the GUI pull down menus

Command Window or Input Line

Main GUI Menu

12 © 2015 ANSYS, Inc. March 30, 2015


MAPDL Command Syntax
Direct and indirect approach can be used interchangeably in the same MAPDL
session
• All executed commands (either direct or indirect) are saved to the log file

Dialog boxes created by GUI identify underlying APDL commands in square


brackets

13 © 2015 ANSYS, Inc. March 30, 2015


MAPDL Command Syntax
Ultimately, all phases of modeling are accomplished by sending commands to
MAPDL
• More details on command usage will be provided throughout the remainder of the course
• Commands relevant to tasks necessary to perform workshops will be introduced
when and as needed

14 © 2015 ANSYS, Inc. March 30, 2015

S-ar putea să vă placă și