You are on page 1of 50

Path Plots and

Automated Post
Processing in
MADPL and
Workbench
6/20/2012
CAE Associates Inc. and ANSYS Inc. Proprietary
2012 CAE Associates Inc. and ANSYS Inc. All rights reserved.

Introduction

CAE Associates Inc. and ANSYS Inc. Proprietary


2012 CAE Associates Inc. and ANSYS Inc. All rights reserved.

Engineering Advantage

CAE Associates are the leading simulation engineers in the North East
region. With global reach and local focus, we have been assisting, best in
class, engineers since 1981 and chosen by ANSYS to be one of the
original 4 exclusive Channel Partners in 1985. (Over 250 today)
CAE integrates simulation and analysis solutions into their client's projects
as well as into their client's portfolio of skills.

How CAEA Works with your Company

We offer tailored solutions to work


within your timing, budget and
manpower guidelines by identifying:

Consulting Services to assist and/or


solve your simulation needs
Software Solutions to match your user
needs
Training to ensure you maximize your
investment
One on one "Jump-Start" mentoring
customized around your project
Fle ible partnering options to work
Flexible
ork
with you in any way that will help you
achieve your simulation goals

Engineering Advantage

CAE Associates brings unmatched simulation expertise from a team that


utilizes simulation tools on a daily basis. This team, with an average of 15+
years of practical experience and all holding advanced degrees, doubles
as your direct support line, no call center, just timely response for
successful results.

CAEA Technical Staff


Nicholas M. Veikos, Ph.D., President
Peter R. Barrett, M.S.C.E., P.E., Vice President
Michael Bak, Ph.D., Sr. Engineering Manager
P ti kC
Patrick
Cunningham,
i h
M
M.S.M.E.,
SME S
Sr. E
Engineering
i
i M
Mgr.
James Kosloski, M.S.M.E., Sr. Engineering Manager
Steven Hale,, M.S.M.E.,, Sr. Engineering
g
g Manager
g
Hsin-Hua Tsuei, Ph.D., CFD Manager
George Bauer, M.S.M.E., Engineering Manager
Eric Stamper, M.S.M.E., Project Manager
Michael Kuron, M.S.M.E., Project Manager
Reni Raju,
Raju Ph.D,
Ph D Project Manager
Lawrence L. Durocher, Ph.D., Director

ANSYS Technical Support

CAE Associates provides ANSYS hotline support to over 150 different


companies, including two of the world's biggest ANSYS users.
Our Clients have chosen us above all others because of our practical,
technical knowledge of both the ANSYS software and their engineering
applications.
We handle upwards of 99% of the questions ourselves with same day
response.
response

Training Center In Middlebury, CT

Training Classes

Introduction to ANSYS Mechanical


APDL Part I
Introduction to ANSYS Mechanical
APDL Part II
Introduction to ANSYS Mechanical
ANSYS DesignModeler
CFD Fundamentals
Introduction to CFX
Introduction to ICEM Meshing
Heat Transfer
Structural Nonlinearities
Modeling Contact with ANSYS
Dynamics
y
Introduction to Fatigue and Fracture
ANSYS Composite PrepPost

Multiphysics Simulation for MEMS


Advanced Structural Material
Nonlinearities
Random Vibration
ANSYS/LS-Dyna (Explicit Dynamics)
Advanced ANSYS Modeling &
Meshing
g
FEA Fundamentals
FEA Best Practices
ANSYS Customization &
Programming (APDL)
Introduction to AUTODYN
Introduction to CivilFEM
Multiple Customized Training
Programs
CAEA Averages Over 100 Classes
Annually
9

Mentoring and Consulting Specialties

Structural Analysis

Thermal Analysis

Linear and Nonlinear


St d St t and
Steady-State
d Transient
T
i t
Coupled Thermal-Flow

CFD

Linear and Nonlinear


Static and Dynamic
Implicit and Explicit Dynamics

Aerodynamics analysis, Flowfield analysis


Turbo machinery, Propulsion
Chemical reacting flows, Physical models

Custom Software Development

10

Path Plots

CAE Associates Inc. and ANSYS Inc. Proprietary


2012 CAE Associates Inc. and ANSYS Inc. All rights reserved.

Path Operations in MAPDL

One useful way to review results is via path operations


operations, which allow you to:

Map results data onto an arbitrary path through the model.


Perform mathematical operations along the path, including integration and
differentiation.
differentiation
Display a path plot see how a result item varies along the path.

Available only for models containing 2D or 3D solid elements or shell


elements.
elements

12

Path Operations

Three steps to produce a path plot:


1. Define a path.
2. Map data onto the path.
3 Plot the data
3.
data.

1. Define a path:

Requires the following information:

Points defining the path (2 to 1000). You can use existing nodes, locations on the
working plane or locations in the global cartesian system.
Path curvature,
curvature determined by the active coordinate system (CSYS)
(CSYS).
A name for the path.

13

Path Operations

Activate the desired coordinate system (CSYS)


(CSYS).
Define path via:
General Postproc > Path Operations > Define Path > By Nodes or On Working
Plane
Pick the nodes or WP locations that form the desired path, and press OK.
Choose a path name.
The nSets field refers to how many different items might be mapped onto this path (30 is
more than enough in almost all cases)
nDiv field refers to the number of divisions between each specified point. For 2 points it
may be beneficial to increase the number of divisions.

14

Path Operations
2 Map data onto path:
2.

Choose the desired quantity, such as S1, and enter a label to be used on plots
and listings:

General Postproc > Path Operations > Map onto Path (or PDEF command)

You can now display the path if needed.

General Postproc > Path Operations > Plot Paths


(or issue /PBC,PATH,1 followed by NPLOT or EPLOT)

15

Path Operations

By default there are 3 data items defined for each path


path.

XG, YG, ZG: Global coordinates of each path point


S: Distance along the path.

16

Path Operations

Plot the data:

You can plot path items either on a graph:


PLPATH or General Postproc > Path Operations > Plot Path Item > On Graph
The data is always plotted vs
vs. S (distance along path)
path).

Or along path geometry:


PLPAGM or General Postproc > Path Operations > Plot Path Item > On
Geometry

17

Path Operations

ANSYS allows you to define multiple paths, each with


a unique name that you assign. Only one path can
be active at a time.

To change the active path use


Recall Path

Besides plots and listings, there are many other path


capabilities,
biliti
iincluding:
l di

Stress linearization used in the pressure vessel


industry to decompose stress along a path into its
membrane and bending components
components.
Calculus functions used in fracture mechanics to
calculate J-integrals and stress concentration factors.
Also useful in thermal analyses
y
to calculate the heat
lost or gained across a path.
Dot products and cross products used widely in
electromagnetics analyses to operate on vector
quantities.
titi
18

Stress Linearization

When doing stress linearization


linearization, the path MUST be defined by 2 nodes
nodes.

If you try to do a stress linearization on a path defined by coordinates, you will


get an error:

The path must also be completely contained in the model. I.e. it cannot
pass through a hole
hole, or gap
gap.

If there are gaps in the path you will get an error:

19

Stress Linearization

For stress linearization


linearization, the section path is defined by the two end nodes
nodes,
and by 47 intermediate points that are automatically determined by linear
interpolation in the active display coordinate system.

The number and location of the intermediate points are not affected by the
number of divisions set by PATH,,,,nDiv.

20

Stress Linearization

Linearized stress in MAPDL


MAPDL.

21

Listing Paths

The path data can be listed using:

General Postproc > Path Operations > Plot Path Item > List Path Items
Or

PRPATH command.
command

The listing will appear on screen in interactive mode or in the output file in
batch mode.
The screen listing can be saved to a file with the File menu of that window.

By default the listing has the headers repeated every 56 lines


This can be modified with the /PAGE command

/PAGE,9999,,9999
Write 9999 lines before new headers
Makes it easier to read data into other programs.

22

Path Automation

CAE Associates has developed a macro that will automatically define a


path through the model in the maximum principal stress direction (starting
at a specified node or the node with the max S1 stress).

Procedure:

Find node with max S1 stress (if no node specified).


Ali WP with
Align
ith principal
i i l di
directions
ti
att node
d
*VFUN,,DIRCOS will give direction cosines of principal stress directions
Use these to align WP

Create a path starting at WP origin,


origin and proceed 1 unit (or maxthk specified as
ARG2) in the WP X direction (First principal).
Map data onto this path, then loop through points of path and find point where
data = 0, assume this is the p
point where p
path exits model.
Define second path from starting node, to node nearest point where first path
exited model.
Map S1 stress onto new path.

23

Paths in WB

Similarly paths can be defined in the Workbench Mechanical interface


interface.

In Mechanical, paths are considered construction geometry.


To create a path, first insert the Construction Geometry Item to the tree.

Then under construction geometry insert a path

24

Paths in WB

In Mechanical paths can be defined by:

Two points
Edge geometry
X Axis intersection
X-Axis

To define by Edge, simply choose an edge in the model that you want the
path
th tto ffollow.
ll
IIn mostt cases this
thi will
ill require
i up front
f t planning
l
i in
i the
th
geometry creation.

To define by X-Axis intersection, first create a coordinate system whose xaxis represents the desired path direction. Then choose this system as
the Path Coordinate System.

25

Paths in WB

To define by two points,


points the user must select the beginning and ending
point for the path by clicking on items in the model, or typing in coordinates
in the specified coordinate system.

Clicking on a geometry item will center the point at the centroid of that
geometry.
Selecting this surface
centers the path point
at the
h CG off the
h
cylindrical surface
Selecting this edge
l
locates
t th
the path
th
point at the arc
center.

26

Paths in WB

To define a path at a more arbitrary location it is necessary to switch to


coordinate picking mode.

Then any arbitrary location in the model can be chosen.

Locations must be on the model geometry.


The path end points can be forced to use an actual node in the model by right
click and choose snap to mesh nodes.
It may also help to display the mesh

27

Paths in WB

Warning, when defining the path using two points


Warning
points, only the coordinates of
the points are saved.
If the geometry is updated, the paths are not updated to move with the
geometry even if a vertex,
geometry,
vertex line or surface was selected to define the end
points.

If you want
a t a pat
path to move
o e with
t geo
geometry
et y updates, ccreate
eate coo
coordinate
d ate
systems associated with geometry and define the path using these
coordinate systems.

28

Paths in WB

To use a path in Mechanical


Mechanical, you must scope a result item to the path
path.

By default result items are scoped to All Bodies.


After inserting the desired item (i.e. Max Principal Stress), change the Scoping
Method to Path
Path

Then choose the path form the drop down list.

29

Paths in WB

When adding a Linearized Stress item the scoping method is automatically


set to Path.

30

Paths in WB

To view the path results,


results first right click and choose Evaluate All Results
Results.
The results are shown as color contours along the line of the path in the
main window.

And as a graph of result vs. distance in the graph window.

31

Paths in WB

To compare results of two different paths


paths, the chart tool can be used:

Once the chart is added, you can select multiple items in the tree to
compare;

32

Saving Images

CAE Associates Inc. and ANSYS Inc. Proprietary


2012 CAE Associates Inc. and ANSYS Inc. All rights reserved.

Saving Plots as Image Files

In both MAPDL and Workbench plots can be saved as image files


files.
In MAPDL use:

PlotCtrls > Redirect Plots > To JPEG File


Or any of the other image file options
options.

Recommended to set:

Quality
Q
lit = 100
Force White BG and Black FG = On

34

Saving Plots as Image Files

The set of APDL commands executed by this menu pick is:

Open JPEG file


Set JPEG options

Save current colors


Switch black and white
Replot current plot
Restore colors

/SHOW,JPEG,,0
JPEG,QUAL,100,
JPEG ORIENT HORIZ
JPEG,ORIENT,HORIZ
JPEG,COLOR,2
JPEG,TMOD,1
/GFILE,800,
!*
!
/CMAP,_TEMPCMAP_,CMP,,SAVE
/RGB,INDEX,100,100,100,0
/RGB,INDEX,0,0,0,15
/REPLOT
/CMAP,_TEMPCMAP_,CMP
/DELETE,_TEMPCMAP_,CMP
/SHOW,CLOSE

Each image will be saved in the current working directory as:

jobnameXXX.jpg
Wh
Where XXX iis a number
b starting
t ti with
ith 000 and
d iincrementing
ti b
by one ffor each
h new
image.
35

Saving Plots as Image Files

The set of commands can easily be turned into a macro to automatically


generate a series of plots:
/SHOW,JPEG,,0
JPEG,QUAL,100,
JPEG ORIENT HORIZ
JPEG,ORIENT,HORIZ
JPEG,COLOR,2
JPEG,TMOD,1
/GFILE,800,
!
!*
/CMAP,_TEMPCMAP_,CMP,,SAVE
/RGB,INDEX,100,100,100,0
/RGB,INDEX,0,0,0,15

Each of these commands


will generate a separate
JPEG file

PLNS,S,1
PLNS,S,3
PLNS,S,EQV
PLNS U SUM
PLNS,U,SUM
/CMAP,_TEMPCMAP_,CMP
/DELETE,_TEMPCMAP_,CMP
/SHOW,CLOSE

36

Saving Plots as Image Files

It may be convenient to rename the plot files something more descriptive


than just jobname000.jpg.
The problem is that you cannot be sure what number plot you are up to.
To address this there is a command to tturn
rn OFF a
automatic
tomatic n
numbering.
mbering

/DEV,PSFN,NINC
With this option set the plot is always sent to jobname.jpg
So it is easy to rename
/
/DEV,PSFN,NINC
/SHOW,JPEG,,0

/inquire,jnam,JOBNAME
PLNS,S,1
1
/rename,,jpg,,%jnam(1)%_S1,jpg
PLNS,S,3
/rename,,jpg,,%jnam(1)%_S3,jpg
PLNS,S,EQV
S S Q
/rename,,jpg,,%jnam(1)%_SEQV,jpg
PLNS,U,SUM
/rename,,jpg,,%jnam(1)%_USUM,jpg

/SHOW,CLOSE
37

Plots to File in WB

In Workbench
Workbench, the current view can be saved to an image file by clicking:

Which will bring up a dialog box for saving the file.

However, Workbench has built-in


However
built in procedures for generating a report and
saving it to MS Word or PPT.

This report will automatically contain any Figures or Images added to the
tree.
Image: A static image of the current view, cannot be modified.
Figure: A separate view of the current tree item.
Figures can be rotated, zoomed, etc, just like the main view.

Ch
Changing
i th
the name off Fi
Figures and
d IImages will
ill make
k th
the reportt captions
ti
more
meaningful.
38

WB Report Generation

Comments can also be entered for any item in the tree


tree. These comment
will appear in the report.

Once you have added all the desired figure, images, and comments, the
report can be viewed by clicking on the Report Preview tab.

39

WB Report Generation

The report will contain a summary of all model information:

40

WB Report Generation

Path results are automatically included as plots and tabular data:

41

WB Report Generation

Once the preview is satisfactory


satisfactory, the report can be sent to MS Word or
PowerPoint, or published to the web.

Sending to MS Word will contain the complete report with all data.
Sending to PowerPoint will contain only the images and figures from the
report.

The report generator from WB is a good way to meet certain design


practice
p
act ce requirements
equ e e ts for
o docu
documentation.
e tat o

42

Automated Stress
E t
Extraction
ti

CAE Associates Inc. and ANSYS Inc. Proprietary


2012 CAE Associates Inc. and ANSYS Inc. All rights reserved.

Stress Extraction

There are a number of ways to determine and store the maximum stress
for a particular load case:

*GET,,PLNSOL Get the maximum value from the last plot


NSORT; *GET
GET,,SORT
SORT Get the maximum value from the last sort
*VGET,,NODE,S,1 ; *VSCFUN,,MAX Store stress data for all nodes in an
array and find the maximum from that array.

Using these methods in a *DO loop that loops over all load cases, one can
find the maximum stress value of all load cases.

44

Stress Extraction

Stress extraction sample macro:


*get,nsets,ACTIVE,,SET,NSET
Determine how many sets on RST file
s1max=0
*do,iset,1,nsets
set,,,,,,,iset
nsort,s,1
*get
get,s1maxi,sort,,max
s1maxi sort max
*get,s1maxni,sort,,imax
*if,s1maxi,gt,s1max,then
s1max=s1maxi
s1maxnode=s1maxni
s1maxlc=iset
*endif
*enddo

Loop through and read in each set


Sort nodes based on S1 stress
Get the maximum value from the last sort.
Get the node number where the max occurred.
If greater than previous max save the value
Write out data to output file

*vwrite,s1max,s1maxnode,s1maxlc
The maximum S1 stress of %G, occurs at node %i, in set number %i

45

Stress Extraction

The *VWRITE
VWRITE command is useful for writing data to files in a specified
format. Lets modify the macro slightly to write the max S1 stress for each
results set.

*get,nsets,ACTIVE,,SET,NSET
*dim,slist,array,nsets,2
*do,iset,1,nsets
set,,,,,,,iset
nsort,s,1
*get,slist(iset,1),sort,,max
*get,slist(iset,2),sort,,imax
*enddo
*cfopen,s1out,csv
*vwrite
Load Case, Max S1,
1 Node
*vwrite,SEQU,slist(1,1),slist(1,2)
%I, %G, %I
* f l
*cfclose

Define an array nsetsX2


Loop through and read in each set
Store the maximum value in first column of
array.
Store the node number in the second
column.
Open a new file for writing to.
Write out headers to file
Write array data to file

46

Stress Extraction

This will create a CSV file tha tcna be read directly into Excel:

LoadCase
Load
Case
1
2
3
4
5
6

MaxS1
Max
S1 Node
14823.21
17428
29648.53
17428
44475.96
17428
40390.54
17428
36634.85
17429
32984.73
17429

47

Maximum Stress in WB

In WB the maximum (and minimum) values for each result item are
automatically stored for each results set.
The graph tab will show a plot of maximum value vs. time for each quantity
plotted.
plotted

To display the results for the time point of interest, simply right click on the
graph at the location of interest, and choose Retrieve This Result

48

Macro Library and Toolbar

One of the major issues with postprocessing is consistency across the


company.
We have seen how the WB report generator can be used to create a
comprehensive report with consistent types of information for all users
users.
Another way to help with consistency is to make the same macros
available to all users.

This can be done by storing these macros in a macro library


library.
A macro library is a company wide accessible network directory that is
identified by a system environment variable: ANSYS_MACROLIB
If this environment variable is defined ANSYS will search in the directory
specified for macros.

49

Macro Library and Toolbar

Once the directory with the macros has be established


established, users can be
made aware of these macros by adding them to the default toolbar via the
start140.ans file.

%ANSYS140 DIR%\apdl\start140 ans


%ANSYS140_DIR%\apdl\start140.ans

Adding abbreviations to this file will cause them to appear on the tool bar
in ANSYS MAPDL.

50

You might also like