You are on page 1of 36

Ch t 2 Chapter 2

Mechanical APDL
I t d ti Introduction
ANSYS Mechanical Advanced
(Using Command Objects)
2-1
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
( g j )
ANSYS Mechanical APDL
Training Manual
A. Introduction to Mechanical APDL
ANSYS Mechanical uses ANSYS Mechanical APDL as the finite
element solver.
When a user clicks on the Solve icon in Mechanical, an input file is sent
to the Mechanical APDL solver. After the solution is complete, a result
file is created, which is read by Mechanical. This is conceptually shown
below.
By using Commands objects additional instructions are given to the By using Commands objects, additional instructions are given to the
Mechanical APDL solver to perform user-specified tasks.
Because the solver is Mechanical APDL, it is helpful to understand how
Mechanical APDL behaves, which will be the focus of this chapter. , p
Automatically Performed in the Background
Solver Input File
Result File
2-2
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Introduction to Mechanical APDL
Mechanical APDL can also be run interactively with its own GUI, as
shown below. As noted earlier, it is important to understand how
Mechanical APDL operates in order to take advantage of its solver
f technology to its fullest extent.
2-3
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL User Interface
ANSYS Mechanical APDL
Training Manual
Introduction to Mechanical APDL
Details of using Command Objects in ANSYS Mechanical will be
covered in the later chapters.
This chapter will introduce the ANSYS Mechanical APDL graphical
user interface (GUI)
There are two main reasons why a user may wish to run the y y
Mechanical APDL GUI:
1. Visually inspect the model prior to solving to ensure that the users
Command Objects perform the required actions correctly
2. Postprocess the model in Mechanical APDL if special postprocessing
techniques are required that are not available in Mechanical
2-4
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
B. Launching Mechanical APDL
If a user wishes to verify the model prior to solving, Mechanical APDL
can be launched through the Setup cell of a Mechanical solution
1. Under Toolbox: Component Systems, drag-and-drop the Mechanical
APDL icon onto the Setup branch of interest
or
1. Right-click on the Setup cell and select Transfer Data to New >
M h i l APDL Mechanical APDL
2. Then, right-click on the Analysis cell and select Edit in Mechanical
APDL. The model will be loaded into Mechanical APDL.
Check the status icon on the
Project Schematic page. Right-
click on the Analysis cell in
the Mechanical APDL system
and select Update, if
necessary.
2-5
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
necessary.
ANSYS Mechanical APDL
Training Manual
Launching Mechanical APDL
For situations where a user would like to postprocess a model in
Mechanical APDL, the Solution cell should be referenced
1. Before solving the model, set Save ANSYS db: Yes under the Analysis
Settings branch
2. Solve the model in Mechanical
3. Under Toolbox: Component Systems, drag-and-drop the Mechanical
APDL i t th S l ti b h f i t t APDL icon onto the Solution branch of interest
or
3. Right-click on the Solution cell and select Transfer Data to New >
Mechanical APDL Mechanical APDL
4. Then, right-click on the Analysis cell and select Edit in Mechanical
APDL. Use File menu > Resume Jobname.db to read in the model
and begin postprocessing in Mechanical APDL g p p g
2-6
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Launching Mechanical APDL
Additional considerations:
A user should not transfer from a Geometry or Model cell, as only a
subset of the model will be transferred to Mechanical APDL:
To verify the model in Mechanical APDL, always transfer from the Setup cell
To postprocess in Mechanical APDL, always transfer fro the Solution cell
Transferring from a Geometry cell will only send the geometric entities
Transferring from a Model cell will only send the mesh (MESH200 elements) Transferring from a Model cell will only send the mesh (MESH200 elements)
Be sure that all cells are updated accordingly prior to transferring to
Mechanical APDL
The status of the cells up to and including the cell being transferred should p g g
indicate it is up-to-date
If the upstream data is not up-to-date, right-clicking on the Analysis cell in
the Mechanical APDL system allows one to Refresh or Update all
downstream cells downstream cells.
See the Help system, under Workbench > Getting Started in Workbench >
Getting Started in ANSYS Workbench > The ANSYS Workbench Interface >
Project Schematic > Systems and Cells > Understanding Cell States for more
details
2-7
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
details
ANSYS Mechanical APDL
Training Manual
Further Information
There are other ways in which Mechanical APDL can interact with
other ANSYS Workbench components, although the discussion is
outside of the scope of this course.
Refer to the following section of the ANSYS Help for details:
Workbench > Getting Started in Workbench > Systems > Component Systems
> Mechanical APDL
2-8
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
ANSYS Help System
The ANSYS Help System provides comprehensive details on all
aspects of ANSYS. One can access the Help System from either of
the following methods:
Windows: Start menu > Programs > ANSYS 12.0 > Help > ANSYS Help
From ANSYS: Utility menu > Help > Help Topics
2-9
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
ANSYS Help System
All pertinent help information is grouped
under Mechanical APDL (formerly ANSYS),
as shown on the right
Guides give detailed procedural information,
such as the Thermal Analysis Guide for steady-
state and transient heat transfer analyses,
including radiation including radiation
References are used to look up specific
information. For example, one can look up the
constitutive equations for nonlinear materials q
in the Theory Reference.
The Verification Manual provides simple
examples comparing Mechanical APDL results
ith k l ti d T t i l id with known solutions, and Tutorials provides
step-by-step tutorials on using Mechanical
APDL for different physics.
2-10
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
ANSYS Help System
The various Guides provide detailed information on analysis
procedures, including sample APDL commands or APDL templates:
2-11
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
C. Mechanical APDL Files
Mechanical APDL reads and writes various files, so it is helpful to
understand some of the more important, commonly-used ones:
file.db: Mechanical APDL database, containing material properties,
loading, mesh. May also contain 1 result set if postprocessing.
This file is saved by Mechanical or by the user
file.rst, file.rth, file.rmg: Mechanical APDL result file, also used
by Mechanical Contains multiple result sets for analyses in the time or by Mechanical. Contains multiple result sets for analyses in the time or
frequency domain
The file extension refers to the physics: .rst=structural, .rth=thermal,
.rmg=electromagnetic (coupled-field analyses use .rst)
This file is generated upon successful completion of a FE solution
file.log: Mechanical APDL log (journal) file, which records all actions
performed by the user, whether through commands or the GUI
f This file is automatically generated and appended to
file.err: Mechanical APDL error log file, containing all warning and
error messages encountered during a session
This file is automatically generated and appended to
2-12
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
This file is automatically generated and appended to
ANSYS Mechanical APDL
Training Manual
Saving the Mechanical APDL Database
The Mechanical APDL database (file.db) is not
saved by default by Mechanical
It is good practice to save the Mechanical APDL
database for all models in which the user expects to
use Command objects
In the Details view of the Analysis Settings branch,
expand the Analysis Data Management section expand the Analysis Data Management section
Set Save ANSYS db to Yes
If additional solver files are to be kept, the user may also
set Delete Unneeded Files to No
2-13
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Resuming Databases
Opening a model (file.db) in Mechanical APDL is called the act of
resuming a database
From the Utility menu (uppermost menu), select
File > Resume Jobname.db to resume the
database file.db
APDL command is RESUME
The Jobname is the name of the files Mechanical The Jobname is the name of the files Mechanical
APDL creates. Unlike other software which may
saves a single file, Mechanical APDL deals with
many files. Hence, the jobname is the filename
common to all files for an analysis, where each
file has a different file extension.
The default jobname for models transferred from
Mechanical is file so Resume Jobname db Mechanical is file, so Resume Jobname.db
will open file.db, if present. (It does not literally
open a file called jobname.db.)
Use File > Resume from if the saved database
2-14
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
Use File Resume from if the saved database
is not generated from Mechanical
ANSYS Mechanical APDL
Training Manual
Reading Results
The data from a results file (file.rst, file.rth,
file.rmg) is read into memory for postprocessing:
From the Main menu (left-most menu), use General
Postproc > Read Results > By Pick to select a result to
review from the result file
APDL command is SET
The Mechanical APDL database should be resumed first The Mechanical APDL database should be resumed first
before reading a result
The associated result file is automatically selected
based on the current jobname (file), but a user may based o t e cu e t job a e ( e ), but a use ay
choose a different result file using Main Menu >
General Postproc > Data & File Opts prior to using
Read Results
Once data is read into memory, the user may plot
contour or vector results, list quantities, or manipulate
the result data in Mechanical APDL
2-15
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Mechanical APDL File Generation
Generally speaking, all required Mechanical APDL files will be
generated by Mechanical.
Hence, at this point in time, the user should not worry about saving
data in Mechanical APDL files
Instead, what will be discussed later is the use of Command objects to
save all actions within the Mechanical system
Mechanical APDL will therefore be used to verify the model input as well
as for postprocessing only
2-16
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Further Information
There are other files that may be created by Mechanical APDL. For
more details, refer to the following section of the ANSYS Help:
Mechanical APDL (formerly ANSYS) > Basic Analysis Guide > Section
20.4.2 Files that ANSYS Writes
2-17
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
D. Mechanical APDL GUI
The main components of the Mechanical APDL GUI are shown below:
Utility Menu
ANSYS Toolbar
Command Prompt
Standard Toolbar
Graphics Toolbar
Graphics Window
Main Menu
2-18
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
Output Window Status Area Active Attributes
ANSYS Mechanical APDL
Training Manual
Main Menu
Main Menu:
All analysis-specific actions are available from the
Main Menu, located on the left side of the GUI
Each submenu level is color coded differently to make Each submenu level is color-coded differently to make
differentiation of levels easy
For each item, the left-most icon indicates the type of
action that will be taken:
A + or - symbol indicates a submenu
An arrow indicates a picking action will be performed
A dialog box icon reflects data to be entered in a window
All actions performed in the Main Menu are recorded to p
the file.log command log file. Each action is
associated with one or more APDL commands.
The status bar prompts the user for the necessary
input input
2-19
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Utility Menu
Utility Menu:
Generally used for analysis-independent actions, such as changing graphics
settings, creating local coordinate systems, defining parameters, etc.
The right most symbol indicates the type of action to be performed: The right-most symbol indicates the type of action to be performed:
> indicates a submenu
indicates a dialog box
+ indicates a picking action
2-20
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Command Prompt
Command Prompt:
The Command Prompt allows users to type in APDL commands. A dynamic
prompt (blue) is a helpful reminder of the necessary arguments.
A history of previously entered commands is available by selecting the left A history of previously-entered commands is available by selecting the left-
most button (circled below)
To access help for commands or an element, type HELP,command or
HELP,element to bring up the relevant help section (where command is the
APDL d l t i th l t lib b ) APDL command name or element is the element library number)
2-21
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Output Window
Output Window:
In an interactive session, the
Output Window provides feedback
for all actions performed It is the for all actions performed. It is the
same output as the Solution
Information branch in Mechanical.
The contents of the Output Window
are not saved to a file in an are not saved to a file in an
interactive session; hence, the user
can make the DOS window buffer
large enough to store as much
information as required information as required.
Do not close the Output Window.
By clicking on the x icon, one will
abruptly terminate the Mechanical
APDL i I t d i i i APDL session. Instead, minimize
the Output Window if it is not
needed.
(The Output Window is typically
2-22
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
grey text on black background but
has been reversed here for clarity.)
ANSYS Mechanical APDL
Training Manual
Further Information
The other components of the GUI will be discussed in later slides, as
the need arises. Refer to the following section of the ANSYS Help for
complete information on the GUI layout:
Mechanical APDL (formerly ANSYS) > Operations Guide > Section 4.3
Layout of the GUI
2-23
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
E. Graphics
Plotting the model is performed
under Utility menu > Plot
When dealing with models generated
in Mechanical, only nodes and
elements are transferred
The user may plot either nodes or
elements elements
Equivalent APDL commands are
NPLOT and EPLOT
The user can also plot both at once p
with Multi-plots
APDL command is GPLOT
To refresh the screen, use Replot
APDL command is /REPLOT
The APDL commands listed above
may be typed in the Command
P t t t th t ti
2-24
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
Prompt to execute that action
ANSYS Mechanical APDL
Training Manual
Changing Graphics Display
Changing the graphics display,
saving image files, or creating
animations are all accessed under
C the PlotCtrls menu
Differentiating elements by color is
under Numbering
Sh i l d d b d Showing load and boundary
condition symbols or coordinate
systems is under Symbols
Animating results is under the Animating results is under the
Animate submenu
Taking a snapshot of the image is
done under Hard Copy > To File
2-25
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Mechanical and Mechanical APDL
There are some differences between graphics behavior in Mechanical
and Mechanical APDL worth noting:
In Mechanical, the finite element (FE) mesh is only displayed when the
user selects the Mesh branch or when reviewing results with Edges >
Show Elements activated. On the other hand, in Mechanical APDL, the
mesh is always shown. The user decides to plot nodes and/or elements.
In Mechanical the result of actions is usually shown immediately in the In Mechanical, the result of actions is usually shown immediately in the
Graphics window. In Mechanical APDL, the Output Window gives
immediate feedback of an action however, the Graphics Window may
need to be updated by using the Plot > Replot command.
Because scripts performing hundreds actions may be run in Mechanical APDL,
each command may not refresh the display for efficiency reasons
2-26
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Mouse Controls Graphics
By pressing down on the Ctrl key, the user can manipulate the model
in the Graphics window:
Ctrl + Left mouse button pans the model.
Ctrl + Middle mouse button zooms in/out (up-down movement of mouse)
or spins the model about the screen Z-axis (right-left movement of
mouse)
The heel if present can be sed to oom in/o t The wheel, if present, can be used to zoom in/out
Ctrl + Right mouse button rotates the model
The user may re-map these actions with the /UIS,BORD command
P Z R Ctrl
2-27
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Mouse Controls Graphics
A single click with the Right mouse button on the Graphics window
brings up a context-sensitive pop-up menu
Click-drag with the Right mouse button on the Graphics window will
f b perform a box zoom
2-28
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Mouse Controls Picking
Some actions in Mechanical APDL require the
user to select items on the screen.
Actions that require the user to select entities
are designated by a + icon in the Utility menu
or by an arrow icon in the Main Menu
The picker menu will appear, as highlighted on
the right The picker menu will display the right. The picker menu will display
information on the items selected
The status area will indicate what items need to
be picked p
The mouse buttons are as follows:
Left mouse button to pick (or unpick)
Middle mouse button to Apply Middle mouse button to Apply
Right mouse button to toggle between picking
or unpicking
2-29
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Mouse Controls Picking
In Mechanical, the left mouse button is used to select or unselect
items. If an entity is selected, a left mouse button will unselect that
item and vice-versa.
In Mechanical APDL, the right mouse button will control whether
picking or unpicking is performed it is a toggle switch, and the
cursor will change to an up or down arrow for pick and unpick,
i l Th l f b if i i k d ill l i k respectively. The left mouse button, if in pick mode, will only pick
items.
Apply
Cursor display:
Pick
Toggle
Pick / Unpick
Unpick
Pick
p y
2-30
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Mouse Controls Picking
When picking items, Mechanical APDL will highlight the entity whose
centroid is nearest to the location where the pick action occurred
Important Tip: In Mechanical APDL, click and hold down the left mouse
button. Drag the mouse on the screen until the desired entity is
highlighted. Then let go of the left mouse button to complete the picking
operation.
In Mechanical the item directly underneath the cursor when the left mouse In Mechanical, the item directly underneath the cursor when the left mouse
button is clicked is highlighted. However, in Mechanical APDL, it is the
centroid of the element closest to the cursor that is selected.
Note that Selection Planes and Paint Select features in Mechanical are not
present in Mechanical APDL present in Mechanical APDL.
If a user uses the tip above, it becomes easy to select an item of interest. By
keeping the left mouse button pressed, the user can move the mouse around
until the correct entity is highlighted.
2-31
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
[OK] and [Apply] Buttons
In the picker, as well as in dialog boxes, the user will typically be
presented with [OK], [Apply] and [Cancel] buttons
[OK] performs the action, then closes the picker or dialog box
[Apply] performs the action, yet keeps the picker/dialog box open
[Cancel] closes the picker/dialog box without doing anything
2-32
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
[OK] and [Apply] Buttons
A common mistake made by users is to click on [Apply], then click on
[OK]. In Mechanical APDL, this would perform the action twice!
If an action has been performed by clicking on [Apply], but the user wishes to
close the dialog box or picker then select [Cancel] close the dialog box or picker, then select [Cancel]
Remember that both [OK] and [Apply] perform the action. The difference is
that the former closes the dialog box/picker whereas the latter leaves it open to
allow the user to perform that action again on other entities.
When in doubt, check the Output Window for feedback to see if the previous
action was executed
[Cancel] just closes the dialog box/picker; it does not undo the previous action
2-33
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
[OK] and [Apply] Buttons
In addition to the [OK], [Apply], and [Cancel] buttons, there is a [Help]
button for dialog boxes and pickers
The [Help] button will open the relevant section of the ANSYS Help for that
action action
The Commands Reference provides information on the purpose of the
command, its arguments, and notes on the action
The APDL command name is presented in square brackets
2-34
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
F. Exiting Mechanical APDL
To exit from Mechanical APDL, use Utility menu > File > Exit or
the x icon on the Utility menu
A dialog box will appear asking what data to save
Note that the x icon is for the Utility menu not the Output Window!
2-35
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669
ANSYS Mechanical APDL
Training Manual
Exiting Mechanical APDL
Usually, Mechanical APDL will be used to verify the FE mesh as well
as for postprocessing, so data may not need to be saved.
For users wishing to save the data, the Exit prompt below asks the
user what data to save in file.db.
Save Geom+Loads saves only input data in file.db (no results)
Save Geo+Ld+Solu saves input data and 1 result set (if available)
Save Everything saves input data, 1 result set, and any additional user-
defined postprocessing data in file.db
Quit No Save exits Mechanical APDL, leaving file.db untouched
Note that the result file (e.g., file.rst) is not saved by the user but is
automatically created when the solution finishes successfully.
2-36
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.
June 2009
Inventory #002669

You might also like