You are on page 1of 54

A Post 26 Primer:

Post Processing over Multiple


Time/Load Steps in Mechanical APDL

Eric Miller
Co-Owner
Principal, Simulation and
Business Technologies

04/12/2012
PADT, Inc.

DX R13: 02/17/2011
1
Agenda
• Note: This presentation is being
recorded

• Introductions
• Fundamentals
• Defining Variables
• Viewing Variables
• Calculating
• Other POST26 Tools
• Suggestions and
Recommendations

DX R13: 02/17/2011
2
Introductions

DX R13: 02/17/2011
3
Upcoming Webinars
• Upcoming Webinars
– Feb 9, 2012 - 12:00 MST
Working Directly with Nodes and Elements in ANSYS Mechanical
– Feb 23, 2012 - 12:00 MST
Assembly Meshing in ANSYS R14 CANCELED
– March 8, 2012 - 12:00 MST
Intro to Workbench Framework Scripting - Controlling projects, materials, and solution execution with python
– March 22, 2012 - 12:00 MST
Mastering the Remote Solver Manager (RSM) at R14
– April 12, 2012 – 12:00 MST
A POST26 Primer: Post Processing over Multiple Time/Load Steps in Mechanical APDL
– April 26, 2012 – 12:00 MST
A Constraint Equation Primer: How to Tie Degrees of Freedom Together
– May 10, 2012 – 12:00 MST
Optimization with ANSYS DesignXplorer at R14
– May 24, 2012 – 12:00 MST
Modeling Moisture Diffusion in ANSYS
– Summer Break: June & July (maybe August)
• Primers are new:
– Oriented towards newer users or Workbench users who may not have experience with
some of the fundamentals in the ANSYS Mechanical APDL solver
• See upcoming and past webinars at:
– padtincevents.webex.com
• Click on ANSYS Webinar Series

DX R13: 02/17/2011
4
About PADT
• PADT is an Engineering Services
Company
– Mechanical Engineering
– 18 Years of Growth and Happy customers
– 70’ish Employees
• 3 Business Areas
– CAE Sales & Services
• Consulting, Training, Sales, Support
– Product Development
– Rapid Prototyping & Manufacturing
• Learn More: www.PADTINC.com

We Make Innovation Work

DX R13: 02/17/2011
5
Cube HVPC Systems
• Balance between speed and cost
– Mini-Cluster
96 Cores / 512 GB RAM / 6 TB Disk
Mobile Rack / UPS / Monitor / Keyboard
$34,900
– Compute Server
32 Cores / 256 GB RAM / 3 TB Disk
$14,250
– Simulation Workstation (Intel)
12 Cores / 96 GB RAM / 3 TB Disk
$11,750
– Simulation Workstation (AMD)
12 Cores / 64 GB RAM / 3 TB Disk
$6,300
• www.CUBE-HVPC.com

DX R13: 02/17/2011
6
PeDAL – The APDL Editor
• Side-by-side editor and help viewer layout.
• Instant help on any documented APDL command by pressing F1.
• Full syntax highlighting for ANSYS v12 Mechanical APDL.
• Auto-complete drop downs for APDL Commands.
• APDL Command argument hints while typing commands.
• Search ANSYS help phrases and keywords.
• Multiple tabs for the editor and html viewer.
• Full capability web browser built in allows for rich web experience and web
searches.

DX R13: 02/17/2011
7
Connect with PADT
Facebook: Email Subscriptions:
facebook.com/padtinc www.padtinc.com/epubs

Twitter: Web:
#padtinc www.PADTINC.com

LinkedIn: ANSYS User Blog:


Search on PADT, Inc. padtinc.com/focus

DX R13: 02/17/2011
8
Fundamentals

DX R13: 02/17/2011
9
Assumptions
• You know the basics of MAPDL
• You are not an MAPDL expert or guru
– Need reminders on where some of the commands are
• That you will be accessing this via the MAPDL GUI, APDL
macros, and code snippets in Workbench

DX R13: 02/17/2011
10
ANSYS Results
• The ANSYS RST file stores results at various points
– A point can be at a given time in a transient run or it can
be a location on a load curve for a static run
– Not necessarily every point that a solution is calculated at
• User determines how often results are saved
– Each record has a time, load step, and sub step
associated with it
– Static or Transient, even modal results are stored the
same way
• Header and analysis type tell you what type of solution you
have
• Do a SET,LIST to see what is in the file
• Results are stored by node or element
– DOF stuff by node
– Stresses/Strains/etc… by element at each corner node
– So to get at Stress/Strains/etc you must
• Average over an element
• Un-averaged for a corner node
• Average over all elements attached to a node

DX R13: 02/17/2011
11
Conventions/Words
• We will refer to a given loadstep/substep, time point, or frequency as a
“point”
• Solution set is the collection of result solutions stored in the RST file. It is
made up of solution points.
• The “database” is not the *.db file.
– It is the model and result information currently stored in memory
• An array is an APDL parameter of type array
– A vector you can stick stuff in

DX R13: 02/17/2011
12
POST1 vs. POST26
• POST1, the general post processor
– It looks at results across the whole model at a given point
• LS/SS, Time, or Freq
– Use it to make contour plots, animations, list results at a given point
– SET,LS,SS,FACT,KIMG,TIME to store a given point in the database
• POST26, the Time History Post Processor
– Looks at a result value on a node or element over the solution set
– Instead of loading all the results at a point into the database, it stores
the results over the solution set for user specified nodes or elements
– No model plots, just lists and graphs (usually vs. time)
– Allows complex calculations on results
• You can do what POST26 does set,1,1
dim,myux,,nmstp
in POST1 with do loops *do,i,1,nmstp
– But every step loads all results – slow *get,myux(i),node,mynode,u,x
set,next
– POST26 “skips” through the file - fast *enddo

DX R13: 02/17/2011
13
Getting into POST26
• /post26
– Required, commands are filtered
• Click on TimeHist PostPro in Main Menu

DX R13: 02/17/2011
14
Its all About Variables
• A table of a result item at a location in the model vs time or
frequency
• Not an APDL parameter
– But you can push one into an array
• You tell POST26 what variables you want to create
• Whole set of commands for defining, modifying,
mathamatizing, and controlling variables
• Also a GUI tool to build the commands

DX R13: 02/17/2011
15
Our Test Model finish
/clear
/prep7
blc4,-1,-1,2,2,60
et,1,185
mptemp,1,70
mpdata,ex,1,1,20e6

• Infamous “Tower of Test” mpdata,nuxy,1,1,.23


mpdata,dens,1,1,.001
alphad,5
esize,.9

– Transient, large deflection vmesh,all


/view,1,1,1,1
/vup,1,z

– Move base in UX (time,ux):


eplot

nsel,s,loc,z,0

• 0,0 cm,nbt,node
nsel,all

d,nbt,uy,0

• .1,1 d,nbt,uz,0
d,nbt,ux,1
time,.1

• .2,5 antype,4
trnopt,full
lumpm,0

• .3,0 nlgeom,1
kbc,0
timint,1


nsubst,40,40,40
1,0 outres,all,1
lswrite,1

• Will post on blog


d,nbt,ux,5
time,.2
lswrite,2

d,nbt,ux,0
time,.3
lswrite,3

time,2
lswrite,4

/solu
lssolve ,1,4
finish
/post1
plnsol,u,sum

/POST26
FILE,'p26','rst','.'
/UI,COLL,1
NUMVAR,200
SOLU,191,NCMIT
STORE,MERGE
FILLDATA,191,,,,1,1
REALVAR,191,191
!*
NSOL,2,18,U,X, UX_2
STORE,MERGE
XVAR,1
PLVAR,2

DX R13: 02/17/2011
16
Defining Variables

DX R13: 02/17/2011
17
Defining Variables
• You have to tell POST26 what information you want and how
you want it:
– Node/Element, Where in an element, What type of result, How to
average, etc…
• Each variable has a unique variable number
– You access the variable with this number for operations/plotting/etc…
– You can also give it a name: Label only
• Use:
– ANSOL, NSOL, ESOL, EDREAD, RFORCE, JSOL, GSSOL, GAPF,
SOLU
• Control with:
– FORCE, LAYERP26, SHELL, CFACT, TVAR
• Or use the Tool
• NOTE: Time or Freq automatically created and is Var=1

DX R13: 02/17/2011
18
Two Step Process
• Define the variables with variable definition commands
• Store them in the database
• Separate Store for efficiency
– Reads all the variables in at once

DX R13: 02/17/2011
19
Time History Variable Tool
• When you enter POST26 in the GUI, it comes up
– Or click “TimeHist Postpro->Variable Viewer”
• Even if you are doing scripting, use the GUI to figure it out

DX R13: 02/17/2011
20
Defining Variables in the Tool
• Click the Plus Sign
• Pick from list
– It handles all the options/different commands for you
• Pick or give number of node/element
• Example: Reaction Force on Bottom Node, in X
– RFORCE,2,4,F,X, FX_2

DX R13: 02/17/2011
21
More on Tool
• Icons from Left to Right:
– ADD | Delete | Graph | List | Properties | Import | Save | Overlay | Clear |
Refresh
• Variable list shows all the stored variables with name, node/element,
what it is, min/max
– Note that VAR number is not shown… count or do a STAT
• If you are not using the calculator, it gets in the way
– Collapse and expand Variable list
• Automatically does a Store

DX R13: 02/17/2011
22
Variable Store Commands: Common
• ANSOL, NVAR, NODE, Item, Comp, Name, Mat, Real, Ename
– Average Nodal Data (stress/strain)
• You can tell it what material/real/element type to use when node is on boundary
• Uses RSYS
• Uses AVPRIN to tell it how to average if default (average components then derive)
is not OK
• ESOL, NVAR, ELEM, NODE, Item, Comp, Name
– Element data (Stress/Strain)
– If no node specified, then average for all nodes in element
– Gets at a lot more values, including SMISC, NMISC
• NSOL, NVAR, NODE, Item, Comp, Name, SECTOR
– Nodal Data (DOF solutions)
– Supports SECTOR for cyclic Symmetry
• RFORCE, NVAR, NODE, Item, Comp, Name
– Reaction Forces
• JSOL, NVAR, ELEM, ITEM, COMP, Name
– Joint information (U, V, A, Forces/Moments)

DX R13: 02/17/2011
23
Variable Store Commands: LS-DYNA
• EDREAD, NSTART, Label, NUM, STEP1, STEP2
• Reads the various LSDYNA time history files and stores their entire
contents into multiple variables.
• You specify a starting number (NSTART), not an NVAR
• Files:
– GLSTAT, MATSUM, SPCFORC, RCFORC, SLEOUT, NODOUT,RBOUT
• NUM defines what item to read
– part (MATSUM, RBDOUT)
– node number (SPCFORC, NODOUT)
– contact entity (SLEOUT, RCFORC)

DX R13: 02/17/2011
24
Variable Store Commands: Other
• SOLU: Stores solution (solver) information
– Convergence, and solver parameters
• CISOL: J-Integral Info
• ENERSOL: Energies
• GAPF: Gap Force Data
• GSSOL: Generalized Plane Strain Length, Rotation, Force, Moment

DX R13: 02/17/2011
25
What File to Get From
• Jobname.rst is the default
• You can change with:
– GUI: TimeHist PostPro->Settings->File
– Tool: File->Open Results
– APDL: FILE, fname, ext
• Use this to point to an LS-DYNA *.his file as well

DX R13: 02/17/2011
26
Number of Variables
• By default, in batch, you get room for 10 variables for
ANSYS runs
– 30 for LS-DYNA
– If you are using the Tool, it automatically raises it to 200
• You can raise that to 200, and you get 190
– ANSYS needs 10 of its own
• Has to do with how they very quickly get, store, and access
the variables – efficiency
• Change from default with:
– GUI: TimeHist PostPro->Settings->File
– Tool: Automatically sets at maximum
– APDL: NUMVAR,nvar
• Recommendation: Just put an numvar,200 in your macros

DX R13: 02/17/2011
27
Reading in Your Own Variables
• Data command
– DATA, IR, LSTRT, LSTOP, LINC, Name, KCPLX
– Must be followed by a FORTRAN format statement
– I can never get this one to work…
• Use APDL Parameters
– *TREAD to read into an APDL table array
– Use VPUT to convert from APDL array to a Variable
– Does not interpolate, you need the same time points as in your NSOL
type command - need to find a work around.
– Recommended way
• Use ~eui or Tool to read it in
– Nice if you are going to do it a lot
– Very specific format
– See next slide for example

DX R13: 02/17/2011
28
Tool or ~EUI format
• ~eui,'ansys::results::timeHist::TREAD d:\test1\harmonic.prn
TESTMID'
• ~eui,'ansys::results::timeHist::vputData TESTMID 5'

# TEST DATA FILE EXAMPLE


# ALL COMMENT LINES BEGIN WITH #
# Blank lines are ignored
#
# The first line without # sign must contain the variable names to be used
# for each column of data read into POST26. NOTE that for complex data only
# one variable name should be supplied per (real, imaginary) pair as shown below.
# The next line can either be left blank or have descriptors for each column
# such as REAL and IMAGINARY
#
# The data itself can be in free format with the columns "comma delimited",
# "tab delimited", or "blank delimited"
#
# The first column of data is always reserved for the independent variable
# (usually TIME or FREQUENCY)
#
FREQ TEST1 TEST2
REAL IMAGINARY REAL IMAGINARY
1.00000E-02 -128.32 0.17764 5.6480 -4.47762E-03
2.00000E-02 -150.08 0.36474 5.6712 -8.99666E-03
3.00000E-02 -163.12 0.57210 5.7097 -1.35897E-02
4.00000E-02 -147.63 0.81364 5.7629 -1.82673E-02
5.00000E-02 -133.90 1.1091 5.8298 -2.29925E-02
6.00000E-02 -172.38 1.4886 5.9080 -2.76290E-02

DX R13: 02/17/2011
29
The Store Command
• When in batch/command line you need to do a STORE
command to actually read the results in
• STORE, Lab, NPTS
– Lab:
• Merge (default). Overwrites Vars that exist, adds new ones
• New. Replace all data with new definitions
• Appen. Appends data. Use this when you want to add time segments
• ALLOC. Creates the data records for npts but does not create any
variables.
• PSD. Create frequency points for PSD calculations
– NPTS
• Number of time (frequency) points.

DX R13: 02/17/2011
30
STAT
• STAT
– Issue a STAT option first, then STAT
• PRINT
STAT
– Find out your listing options and what variables you have
– Default
• DEFINE
STAT
– Tells you what
your settings are
and what
variables you
have defined
• OPERATE
STAT
– Lists any operation settings you may have, and variables defined
• PLOTTING
STAT
– Shows the POST26 display settings.

DX R13: 02/17/2011
31
Displaying
Variables

DX R13: 02/17/2011
32
Plotting
• Most of the time you will be making a line graph
• Time on X axis, value on Y
• You can stack multiple Variables
• Tool: Use the graph button
• GUI: TimeHist Postpro->Graph Variables
• APDL: PLVAR

DX R13: 02/17/2011
33
PLVAR
• PLVAR, NVAR1, NVAR2, NVAR3, NVAR4, NVAR5, NVAR6,
NVAR7, NVAR8, NVAR9, NVAR10
• Allows you to plot up to 10 variables against each other
– Just give the variable number
• Plot controlled by normal graphing controls
– Google: focus graphing in ansys
• Related Commands:
– XVAR: Allows you to change X axis to a variable
– PLCPLX: Change to allow for complex portion of results
– PLTIME: Specify time range

DX R13: 02/17/2011
34
Simple
• The number of points you use with store, and your data,
determine graph resolution
• Great for quick plots
• ANSYS Mechanical?
– If your code post processing snippet has a /show,png and you make
plots, those come back to ANSYS Mechanical

DX R13: 02/17/2011
35
Listing
• GUI: TimeHist Postpro->List Variables
• TOOL: Little sheet of paper (List) icon
• APDL: PRVAR
– PRVAR, NVAR1, NVAR2, NVAR3, NVAR4, NVAR5, NVAR6
• Standard listing commands and controls apply
– Google: Tools of Post Processing: Listing focus
• Also EXTREM
– It lists the min and max for all variables
• Related commands:
– PRCPLX: Display complex values
– PRTIME: Time range

DX R13: 02/17/2011
36
Exporting and Such
• If you want to do more you can put variables into APDL table
or array and then write it out with *VWRITE
• If you “save data” to a file in the Tool, it writes the code for
you.
– Modify to write as you want
– Very easy to read into Excel as fixed width

*DEL,_P26_EXPORT
*DIM,_P26_EXPORT,TABLE,160,1
VGET,_P26_EXPORT(1,0),1
VGET,_P26_EXPORT(1,1),2
/OUTPUT,'foo','txt','.'
*VWRITE,'TIME','UX_2'
%14C %14C
*VWRITE,_P26_EXPORT(1,0),_P26_EXPORT(1,1)
%14.5G %14.5G
/OUTPUT,TERM

DX R13: 02/17/2011
37
Calculating

DX R13: 02/17/2011
38
Operations
• The calculator has a purpose: you can build calculations with
it
– Uses standard operators
– Variables use their names in {}
• APDL has vector math commands
– Add/Subtract/Multiply/Divide
– Integrate/Differentiate
– Sqrt/Absolute Value
/Logs/Exponent,
– Find Large/Small
• You can overwrite!
– 21 can be used in a calc and
be the destination as well

DX R13: 02/17/2011
39
Example: FSUM
• SQRT of the sum of the squares
• Do it in the tool using the calculator or by writing in equation
• Our put in commands
• Good way to do a script is use calculator, then look at code
generated

rforce,11,8,f,x,FX_8
rforce,12,8,f,y,FY_8
rforce,13,8,f,z,FZ_8
prod,14,11,11
prod,15,12,12
prod,16,13,13
add,17,14,15,16
sqrt,18,17
plvar,18

DX R13: 02/17/2011
40
Example: Max Stress on 1,-1 Corner Edges
• Grab nodes on top
• Stick first node’s S1 into Variable 20
• Loop on remaining nodes
– Put S1 into Variable 21 nsel,s,loc,x,1
nsel,r,loc,y,-1
– Overwrite 20 with max
*get,nnd,node,,count
of 20 and 21 (LARGE) nn = ndnext(-1)
• Max is in 21 at end ansol,20,nn,s,1
nn = ndnext(nn)
*do,i,1,nnd
ansol,21,nn,s,1
large,20,20,21
nn = ndnext(nn)
*enddo
plvar,20
nsel,all

DX R13: 02/17/2011
41
*GET tools
• There is a whole set of *GET commands that read a variable
and return a scalar value
– *get,myval,VARI,nvar,Item1,Item2
– Item1,Item 2 can be:
• EXTREM
– Min, max, last value or the time that value occurs at
» If nvar 32 is stresses, to get max stress and when it occurs:
» *get,mxs,vari,32,extrem,vmax
» *get,mxt,vari,32,extrem,tmax
– Covariance between two variables
• RTIME,t
– Real Values at a given time
• ITIME,t
– Imaginary Values at a given time

DX R13: 02/17/2011
42
Even more with VGET & VPUT
• You can also transfer variables into APDL arrays with VGET
and the put it back with VPUT
• Opens up the full spectrum of APDL array math

DX R13: 02/17/2011
43
Full List of Commands
• ABS: Forms the absolute value of a variable.
• ADD: Adds variables.
• ATAN: Forms the arctangent of a complex variable.
• CLOG: Forms the common log of a variable
• CONJUG: Forms the complex conjugate of a variable.
• DERIV: Differentiates a variable.
• EXP: Forms the exponential of a variable.
• FILLDATA: Fills a variable by a ramp function.
• IMAGIN: Forms an imaginary variable from a complex variable.
• INT1: Integrates a variable.
• LARGE: Finds the largest (the envelope) of three variables.
• NLOG: Forms the natural log of a variable.
• PROD: Multiplies variables.
• QUOT: Divides two variables.
• REALVAR: Forms a variable using only the real part of a complex variable.
• SMALL: Finds the smallest of three variables.
• SQRT: Forms the square root of a variable.

DX R13: 02/17/2011
44
Other POST26
Commands

DX R13: 02/17/2011
45
Lots more Complex Stuff…
• This is a primer, so we are skipping the details on the
complicated stuff
• Read manual for details

DX R13: 02/17/2011
46
PSD
• POST26 will take Mode Shapes and PSD data and calculate
Covariance and Response PSD
• Covariance
– Get variable for the nodes and quantities
you want covariance on
– Use CVAR on two variables
– Then use *get,par,VARI,nvar,extrem,cvar
• Response PSD
– Store PSD file information with STORE,PSD
– Get variable for the nodes and quantities
you want response at
– Use RPSD to calculate the response PSD

DX R13: 02/17/2011
47
Make Response Spectrum from a Transient Run
• RESP command
• You create a table with the “oscillator” frequencies in it.
– Use FILLDATA or DATA
• You fill a variable with the time dependent result you want a
response spectrum for
• Use RESP to get U, V, A
• See Theory Manual for details
• Or run using Tool

DX R13: 02/17/2011
48
Smoothing Data
• SMOOTH command
• SMOOTH, Vect1, Vect2, DATAP, FITPT, Vect3, Vect4, DISP
• Lots of options
• Vect1 is the Independent value, Vect2 is the time variable
– Backwards…
• Vect3 and Vect4 contain the smoothed data after the
command is run
• Not a button in calculator, you have to type in:
– Smoothed_response = SMOOTH ({UY_AT_MIDPOINT},{TIME},2)

DX R13: 02/17/2011
49
Suggestions &
Recommendations

DX R13: 02/17/2011
50
Crawl, Walk, Run
• Really not very complex
• But can get complicated bookkeeping wise
• Use a simple model (ToT…) to prove out your process
• Remember you can use APDL (VGET/VPUT) if what you are
looking for is not in POST26 commands
• Get your head around the fact that you are working with data
at a point, over time.
– Not data at a lot of points at a single time (POST1)

DX R13: 02/17/2011
51
Working with Mechanical
• For many things, probes do what POST26 does

• If you are using POST26 as a post processing snippet:


– Don’t forget to put a FINISH and /POST26 at the top of your script
– Use a /SHOW,PNG to bring back any plots
– *get scalar results can also be brought back as parameters

DX R13: 02/17/2011
52
Resources
• Go the Focus Blog (www.padtinc.com/focus) and I’ll post the
macro I used and a workbench example
– This PowerPoint as well
• The manuals
• www.ansys.net
– Has some post26 examples. Best is a Bode plot by Bill Bullat

DX R13: 02/17/2011
53
Thank You…
• PADT Enjoys doing these webinars…
• Please consider us as your partner
• ANSYS Related
– Training, Mentoring
– Consulting Services
– Customization
– Sales (if in AZ, NM, CO, UT, NV)
• Stratasys 3D Printers and Systems
• CUBE HVPC Systems
• Product Development
– High-end engineering with practical, real world application
• Rapid Prototyping
– SLA, SLS, FDM, PolyJet, CNC, Soft Tooling,
Injection Molding
• Help us by letting us Help you

DX R13: 02/17/2011
54

You might also like