Chapter 5
Accessing ANSYS Options
Accessing ANSYS Options
Chapter Overview
In this chapter, the following ways of interfacing with
ANSYS will be covered:
Named Selections and ANSYS Components
Using Commands Objects
Loading a Simulation Environment Directly in ANSYS
The capabilities described in this section are generally
applicable to ANSYS Professional licenses or above.
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
A. Named Selections and ANSYS
Training Manual
ANSYS Workbench Simulation
As will be seen subsequently, there are different ways to
interface with ANSYS to access advanced functionality
However, when the model is transferred to ANSYS, only
node and element entities are sent
Solid model geometry is not referenced by the ANSYS solver
Because of this, it may be difficult to select or manipulate the
model if only the finite element mesh is present
Named Selections provide a convenient way of selecting
and manipulating the mesh
Named Selections are defined in Simulation
These are transferred as Components in ANSYS, where they
can be selected or manipulated, as needed.
To reference any geometry in ANSYS, the geometry must first
be defined as a Named Component in Simulation
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
Availability
x
x
x
Februar
Accessing ANSYS Options
Transferring to ANSYS
Named Selections transferred as ANSYS Components:
Vertex, edge, and surface named selections are transferred as
nodal components with the same name
Named selections of solid, surface, and line bodies transfer as
element components with the same name
Change the selection filter to Body. This allows selection of
surface and line bodies, not just solid bodies!
The following conventions apply when Named Selections in
Simulation are transferred as ANSYS Components:
Names beginning with a number have the prefix C_ added
Spaces will be replaced by underscores
If multiple selection groups have the same name, only the last
one is converted as an ANSYS component
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
ANSYS Workbench Simulation
Training Manual
Availability
x
x
x
Februar
Accessing ANSYS Options
Transferring to ANSYS
Once Named Selections are transferred to ANSYS, they can
be referenced as Components to do the following:
Apply types of loads not supported in Simulation
Change element attributes
Define additional elements not supported in Simulation
Special postprocessing tasks
etc.
Most ANSYS commands accept component names as an
argument, facilitating component use in ANSYS
Named Selections are associative with the CAD geometry,
so users do not have to worry if CAD model is updated
Use of components is numbering-independent, so users do
not have to worry if the mesh changes
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
ANSYS Workbench Simulation
Training Manual
Availability
x
x
x
Februar
Accessing ANSYS Options
B. Overview of Command Objects
Command Objects enable users to add APDL (ANSYS
Parametric Design Language) commands, which expose
advanced ANSYS functionality not otherwise available in
Simulation
The Command objects requires that the user has familiarity
with APDL commands
Command objects can be inserted in the Part, Contact,
Environment or Solution branches:
Part branch: commands are inserted following the material
definition in ANSYS /prep7
Contact branch: commands are inserted following the contact
definitions in ANSYS /prep7
Environment branch: commands inserted prior to the SOLVE
command
ANSYS Workbench Simulation
Training Manual
Solution branch: commands inserted after the /POST1 command
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
Availability
x
x
x
Februar
Accessing ANSYS Options
Adding Command Objects
Adding command objects is done by right-clicking in the
appropriate branch and using Insert > Commands
A new branch with a Worksheet view will be shown where
APDL commands can be inserted.
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
ANSYS Workbench Simulation
Training Manual
Availability
x
x
x
Februar
Accessing ANSYS Options
Parameterizing Command Objects
The details window for each command object can contain
up to 9 parameter definitions (ARG1 to ARG9).
Just as with other detail information throughout Workbench
these arguments can be made parametric.
In this example a command object
placed in the Environment branch
contains the NSUB command. The
syntax of the command is:
NSUB, Initial substeps, max substeps, min substeps
Notice we have substituted ARG1 in the
command resulting in:
Nsub, 10, arg1, 2
ANSYS Workbench Simulation
Training Manual
This parameter can be used throughout
Workbench including DesignXplorer
Februar
Accessing ANSYS Options
. . . Specifying Material Properties
Training Manual
Command objects inserted in part branches allow quick
material modification without having to know each parts
material number (ANSYS)
In the example below the mp command is used to modify
the Youngs modulus for the material used for Part1.
Notice the parameter matid is inserted into the command in
place of the materials reference number.
ANSYS Workbench Simulation
Februar
Accessing ANSYS Options
. . . Specifying Contact Properties
Training Manual
Contact branch command objects can be used to modify
ANSYS element type , real constant and material number
data using parametric references.
Can be used with symmetric or asymmetric contact pairs.
Insert ANSYS commands using parametric references.
ANSYS Workbench Simulation
Februar
Accessing ANSYS Options
Obtaining Output Parameters
Inserting a Command Object under the Solution
branch allows for the use of postprocessing
commands.
Certain types of APDL parameters may be
retrieved as Simulation parameters for use with
design studies
A output prefix is specified (default is my_), so
all APDL parameters with that prefix will be
searched and parsed.
Output parameters can be used with Parameter
Manager (discussed earlier in Chapter 10) or
DesignXplorer, enabling inclusion of APDL
commands
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
ANSYS Workbench Simulation
Training Manual
Availability
x
x
x
Februar
Accessing ANSYS Options
Retrieving ANSYS Output Information
Training Manual
Command objects placed in the Solution branch can be
used to retrieve plots from ANSYS
Place the appropriate plot formating information (file type,
size, etc.) in the command object.
Issue the desired plot commands.
ANSYS plots are placed below the command object.
Plots are static images (see next page).
ANSYS Workbench Simulation
Februar
Accessing ANSYS Options
Retrieving ANSYS Output Information
ANSYS plots are retrieved below the command object.
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Linking with Text File
The Command Objects contents can be exported or
imported to/from a text file:
The Command Object contents can be refreshed to reflect
current text file contents
In Details view, linked filename will be shown
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
ANSYS Workbench Simulation
Training Manual
Availability
x
x
x
Februar
Accessing ANSYS Options
Command Objects Summary
Command Objects provide a convenient means of adding
APDL commands to a Simulation model in order to access
advanced ANSYS functionality not otherwise exposed
Commands branch provides pre- and post-processing access
inside of ANSYS, including linking contents with external text
files (e.g., ANSYS input or macro files)
When used for post-processing, certain parameters with a
given prefix may be retrieved back into Simulation. This is
useful not only to view APDL parameter output but also for
design studies, such as with Parameter Manager or
DesignXplorer
For users not as familiar with APDL commands, the
Preprocessing and Postprocessing Commands branches,
discussed next, provide an alternate means of including
ANSYS functionality within Simulation.
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
ANSYS Workbench Simulation
Training Manual
Availability
x
x
x
Februar
Accessing ANSYS Options
C. Transferring Models to ANSYS
Training Manual
As seen in the previous section, the two types of
Commands branches allow the user to add ANSYS APDL
commands within the Simulation environment to access
advanced functionality
In some cases, users may wish to transfer the Simulation
model into ANSYS directly and run the model from there
All of these options will transfer the mesh only, not the solid
model geometry, to ANSYS
There are three ways to transfer the mesh/loads to ANSYS:
Saving the Environment as a binary ANSYS database
Saving the Environment as an ASCII ANSYS input file
Loading the Environment in an ANSYS session
ANSYS Workbench Simulation
Februar
Accessing ANSYS Options
Saving the ANSYS Database
During solution, the ANSYS binary database can be saved
In the Details view of the Solution branch, change Save
ANSYS db to Yes
Specify the ANSYS database filename in the ANSYS db File
Name textbox, which will appear underneath
Solve the model, which will initiate solution and save the
ANSYS database (*.db)
Things to keep in mind:
A solution must be initiated to create/save the
.db file
The ANSYS .db file will be saved in the active
units (Units menu)
This is also used in conjunction with saving
ANSYS result files after a solution (see next slide)
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
Availability
x
x
x
x
x
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Saving Other ANSYS Binary Files
ANSYS files written during solution may also be saved:
Use with the Postprocessing Commands Builder
Enable use to manually post-process within ANSYS later
In the Tools menu > Options > Simulation: Solution,
user can save ANSYS files as well as specify where these
files are stored. To save ANSYS files for each Simulation
database, use the option Use Project Directory.
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
Availability
x
x
x
x
x
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Writing an ANSYS Input File
Training Manual
Select a Solution branch
Select Tools > Write ANSYS Input File and
enter the name and location of the input file
Things to keep in mind:
As with saving the binary ANSYS database, only the currently selected
Environment will be written. Write multiple input files for each
Environment branch to be saved.
Unlike saving the binary ANSYS database, this option does not require a
Simulation solution. If loads/supports and requested results are
incomplete, Simulation will not know what type of analysis to specify, so
the model may be transferred as MESH200 generic mesh-only elements.
Otherwise, see previous chapters as to how the model will be translated
to ANSYS
ANSYS Workbench Simulation
An ANSYS input file may be generated,
independent of the Simulation solution
There will be an /EOF command prior to SOLVE
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
Availability
x
x
x
x
x
To make the input file generate the mesh and solve, simply remove the
/EOF line in any text editor
Februar
Accessing ANSYS Options
Loading Environment in ANSYS
It is possible to load an Environment directly into ANSYS:
In the Workbench Project page, select a Model
On the right-side menu, one can list Environments contained
in that Model branch
Select the Environment of interest to load into ANSYS
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
ANSYS Workbench Simulation
Training Manual
Availability
x
x
x
Februar
Accessing ANSYS Options
Loading Environment in ANSYS
Training Manual
The analysis may be continued from within ANSYS
Note that any actions performed in ANSYS will be captured in an
ANSYS log file, but these will not be stored in Simulation
When leaving ANSYS, the user will be prompted to save files
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
ANSYS Workbench Simulation
After selecting the Environment, the ANSYS Output Window
will appear, and the Workbench GUI will change to ANSYS
Availability
x
x
x
Februar
Accessing ANSYS Options
Loading Environment in ANSYS
All pertinent files from the ANSYS session will be stored in
a new subdirectory in the Solver Working Directory
The subdirectory name will be called filename_num where
filename is the name of the .dsdb file and num is the
numerical Environment number
For example, for the third environment branch of a Project.dsdb
file, the subdirectory will be named Project_3
All ANSYS-generated files, including the input file, error file,
log file, and database, will be contained in the subdirectory
filename_AWE.inp: text input file generated from Simulation and
automatically read into ANSYS
filename.db (optional): binary ANSYS database of mesh and loads
filename.err: text file containing all error or warning messages
filename.log: text file containing ANSYS command history
ANSYS Workbench Simulation
Training Manual
filename.page: temporary binary file (leave untouched)
ANSYS License
DesignSpace Entra
DesignSpace
Professional
Structural
Mechanical/Multiphysics
Availability
x
x
x
Februar
Workshop 5
Accessing ANSYS Options
Hyperelastic with Contact
Nonlinear Analysis of a Keyboard
Accessing ANSYS Options
D. Workshop 5 Hyperelastic with Contact
Training Manual
General use of Commands
object in the Geometry,
Environment, and Solution
branches
Use of Named Selections will
facilitate manipulating data
in ANSYS
Output parameters and plots
will be retrieved from the
solution
Items shown with round
bullet points are tasks to be
performed.
ANSYS Workbench Simulation
This exercise will cover accessing ANSYS options through
the Commands object. A 2D analysis of a portion of a
hyperelastic keyboard will be performed, as shown below.
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Launch Workbench and open a new
Simulation session
Under the Geometry branch in the
Details view:
Turn off import of solid and line
bodies and only select import of
surface bodies
Change the Analysis Type to 2-D
From the Context toolbar, choose
Geometry > From File and select
the Parasolid file keyboard.x_t
The model will be attached to
Simulation, as shown next
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Select the menu item Units > Metric
(mm, kg, N, C, s, mV, mA)
Right-click on Part 1 and select
Rename to rename it to ground
Likewise, right-click on Part 2 and
rename it to keyboard
Right-click on keyboard and select
Insert > Commands from the popup menu
In the contents of the Commands
object, type the following:
ANSYS Workbench Simulation
Training Manual
mpdele,all,MATID
tb,hyper,MATID,1,,neo
tbdata,1,80.194
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
The matid parameter is used to
reference the material ID for that given
part, so the element type or material
can easily be changed using ANSYS
commands
The active Simulation units are used
during analysis, so it is important that
all materials defined in the Commands
object have the same units as the
active Simulation Units.
mpdele,all,MATID
tb,hyper,MATID,1,,neo
tbdata,1,80.194
Contact regions can also be
changed in a similar manner
under the Contact branch.
The ANSYS APDL parameters
CID and TID refer to the
contact and target real
constant numbers.
ANSYS Workbench Simulation
The commands that were added in
the previous slide delete the existing
material properties for the
keyboard part and replace it with a
neo-Hookean hyperelastic model.
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Using the Control Key, select both
ground and keyboard from the
Geometry branch
In the Details view, ensure that Plane
Stress is the Behavior
Enter 10 mm for the Thickness
In this example, the keyboard is
assumed to have a plane stress state
with a thickness of 10 mm.
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Right-click on Contact Region
under the Contact branch and select
Rename Based on Geometry
The contact pair will be renamed to
ground To keyboard, as shown on
the right
In this case, the automatic contact
detection selected the top of the
ground as the contact surface
(red). We need to flip the contact pair
such that the top of the ground is
the target, as it is the stiffer material.
ANSYS Workbench Simulation
Training Manual
Right click on ground To keyboard
and select Flip Contact/Target
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
In the Details view, select Contact.
The bottom of the keyboard will be
highlighted. With the Edge
selection active and the Control key
pressed, select the other two lines as
shown on the right, as these will be
expected to touch the ground
Click on Apply to complete the
selection
Change Type to Frictionless
Change Behavior to Asymmetric
Change Formulation to Augmented
Lagrange
ANSYS Workbench Simulation
Training Manual
Toggle Pinball Region to Radius
and enter 10 mm for the radius.
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Select the Mesh branch and, in the
Details view, toggle the Global
Control to Advanced
The Element Size should be set to
1 mm
Change Curve/Proximity to 100
The Shape Checking can be
switched to Aggressive
Change the selection filter to Face
and select the ground part. From
the Context toolbar, select Mesh
Control > Mapped Face Meshing, as
shown on the right
The Element Shape can be set to
Quadrilaterals
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Change the selection filter back to
Edge and select the four lines of
the ground part, as shown on the
right
From the Context toolbar, select
Mesh Control > Sizing
In the Details view, change Type to
Number of Divisions, with the
number of divisions being 1
In this example, the ground is not of
interest and is much stiffer than the
keyboard, so it will be meshed with
just one element.
Right click on the Mesh branch and
select Preview Mesh
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Select the topmost line of the
keyboard part and select the
Create Selection Group icon
When asked for a name, enter
PUSH_TOP
A new Named Selection branch and
PUSH_TOP object will be created in
the Tree.
The Named Selection can be
referenced as a nodal component in
ANSYS Command objects in order to
manipulate the model. In this case, a
special loading will be applied to the
nodes in PUSH_TOP
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Highlight the Environment branch,
then select the leftmost line of the
keyboard part
From the Context toolbar, select
Structural > Frictionless Support
Do the same for the rightmost line of
the keyboard part and add a
Frictionless Support there as well.
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Select the bottommost line of the
ground part
Add Structural > Fixed Support from
the Context toolbar
Right-click on the Environment
branch and select Insert >
Commands
In the Commands object, select
Import from the Context toolbar
Select keyboard2.mac as the file
The contents of keyboard2.mac will
be inserted into the Commands object
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Training Manual
All results are saved for each substep
The nodal component (Named
Selection) called PUSH_NODE is
selected, and a coupled set for the ydirection is created for all of the
nodes
/show,png
time,54
outres,erase
outres,all,all
cmsel,s,PUSH_TOP
PUSH_NODE=ndnext(0)
A displacement of 54 mm is applied
in the y-direction on the master node
of the coupled set.
cp,next,uy,all
An element plot is generated, so the
user can see the mesh and boundary
conditions in Workbench Simulation
allsel,all
d,PUSH_NODE,uy,-54
/pbc,all,1
ANSYS Workbench Simulation
It may be worth pausing for a
moment to examine the commands
inserted from keyboard2.mac
eplot
/show,close
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Select the Solution branch. In the
Details view, change the following:
Solver Type to Direct
This model has hyperelastic and steel
materials, so the matrix may be illconditioned. The sparse direct solver
will suffice for such a small problem.
Weak Springs to Off
Large Deflection to On
Although the text box may change to
yellow, this is because no results have
been requested yet.
Auto Time Stepping to On
Initial Substeps and Minimum
Substeps of 10 and Maximum
Substeps of 1000
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
From the Context toolbar, select the
following:
Stress > Equivalent (von-Mises)
Strain > Equivalent (von-Mises)
Deformation > Total
Tools > Solution Information
Tools > Contact Tool
Change the Contact Tool detail to
Worksheet, change Contact Side
to Contact > Apply.
Then RMB > Insert:
ANSYS Workbench Simulation
Training Manual
Contact > Pressure
Contact > Penetration
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Right-click on the Solution branch
and Insert > Commands
From the Context toolbar, select
Import and read in the
keyboard3.mac file
The contents will be displayed in the
worksheet. Notice the inclusion of the
output parameter MY_REACTION in
the Details view.
ANSYS Workbench Simulation
There are some type of results that
cannot be viewed directly from
Simulation. These include loadhistory response (POST26) as well as
element table items
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
The keyboard3.mac contains postprocessing ANSYS
commands
/show,png
The Time-History Postprocessor is used to plot
force vs. displacement at the
top of the keyboard
The General Postprocessor
is then used to get the
reaction force due to pushing
the keyboard down. This is
reported as MY_REACTION,
which is also recognized by
Simulation as an output
parameter that can be used
with the Parameter Manager
or DesignXplorer
The resulting thicknesses are
also plotted.
/post26
rforce,2,PUSH_NODE,f,y,FORCE
/axlab,x,Displacement
/axlab,y,Force
plvar,2
finish
/post1
set,last
*get,MY_REACTION,node,PUSH_NODE,rf,fy
/title,Equivalent Stresses
plesol,s,eqv,2
ANSYS Workbench Simulation
Training Manual
/title,Out-of-plane Thicknesses
plesol,nmisc,1
/show,close
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Click on the Solve icon to initiate
the solution.
Select the Solution Information
branch to review the contents of the
Output window.
The Force Convergence graph can
also be reviewed during solution to
monitor the progress of the analysis
At the end of the solution, a warning
message may appear. The user does
not have to worry about this, as the
frictionless supports used in this
example are fine for this largedeflection solution.
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Select Equivalent Elastic Strain and
review the strains.
Change the scaling in the Context
toolbar to 1.0 (True Scale)
The undeformed model may also be
superimposed to get a better sense of
how much the keyboard deformed.
Note that the equivalent elastic strains
are very large (~66%), as this is a
hyperelastic model.
Review other results, such as
stresses, deformation, and contact
results. Contact pressure
distribution is shown on the right.
ANSYS Workbench Simulation
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
If no objects are shown under the
Commands branch, click on the
Workbench Project tab on the very top,
then return back to Simulation tab to
refresh the window
Select Post Output 2 this is a plot of
force vs. deflection in the y-direction.
Note that the force is relatively small at
first. Then, the slope changes when the
front of the keyboard initiates contact.
Another change in slope occurs when the
middle contacts the ground.
ANSYS Workbench Simulation
Note that under the Commands object in
the Solution branch, there are four Post
Output objects
Training Manual
Februar
Accessing ANSYS Options
Workshop 5 Hyperelastic with Contact
Post Output 4 shows the final
thicknesses
Recall that the initial thickness was 10 mm
(Step 3)
Because of the incompressibility of the
hyperelastic material, some areas (yellow)
became thinner while other areas (red)
became thicker.
Post Output 3 shows equivalent
stresses
Note that the max stress in ANSYS is 141
MPa while max stress is 140 MPa in
Simulation. This slight difference is due to
the fact that ANSYS has different options
for output, including averaged or
unaveraged stresses, so the user has more
control over output results with the
Commands object.
ANSYS Workbench Simulation
Training Manual
Februar