Professional Documents
Culture Documents
Automated Postprocessing
Automated Postprocessing
Automated Postprocessing
/inquire,jnam,JOBNAME
1 PLNS,S,1
/rename,,jpg,,%jnam(1)%_S1,jpg
PLNS,S,3
/rename,,jpg,,%jnam(1)%_S3,jpg
S S Q PLNS,S,EQV
/rename,,jpg,,%jnam(1)%_SEQV,jpg
PLNS,U,SUM
/rename,,jpg,,%jnam(1)%_USUM,jpg
37
/SHOW,CLOSE
Plots to File in WB
In Workbench the current viewcan be saved to an image file by clicking: In 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 procedures for generating a report and However, Workbench has 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 i th f Fi d I ill k th t ti
38
Changing the name of Figures and Images will make the report captions more
meaningful.
WB Report Generation
Comments can also be entered for any itemin the tree These comment Comments can also be entered for any item in the 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: The report will contain a summary of all model information:
40
WB Report Generation
Path results are automatically included as plots and tabular data: Path results are automatically included as plots and tabular data:
41
WB Report Generation
Once the previewis satisfactory the report can be sent to MS Word or Once the preview is 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 requirements for documentation. p actce equ e e ts o docu e tato
42
Automated Stress
E t ti Extraction
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 maximumstress 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 SORT Get the maximumvalue fromthe last sort NSORT; GET,,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: Stress extraction sample macro:
*get,nsets,ACTIVE,,SET,NSET
s1max=0
Determine how many sets on RST file
s1max=0
*do,iset,1,nsets
set,,,,,,,iset
nsort,s,1
*get s1maxi sort max
Loop through and read in each set
Sort nodes based on S1 stress
get,s1maxi,sort,,max
*get,s1maxni,sort,,imax
*if,s1maxi,gt,s1max,then
s1max=s1maxi
s1maxnode=s1maxni
Get the maximum value from the last sort.
Get the node number where the max occurred.
If greater than previous max save the value
s1maxnode=s1maxni
s1maxlc=iset
*endif
*enddo
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 command is useful for writing data to files in a specified The 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
Define an array nsetsX2
Loop through and read in each set
set,,,,,,,iset
nsort,s,1
*get,slist(iset,1),sort,,max
*get,slist(iset,2),sort,,imax
Loop through and read in each set
Store the maximum value in first column of
array.
Store the node number in the second
*enddo
*cfopen,s1out,csv
*vwrite
1
Store the node number in the second
column.
Open a new file for writing to.
Load Case, Max S1, Node
*vwrite,SEQU,slist(1,1),slist(1,2)
%I, %G, %I
* f l
Write out headers to file
Write array data to file
46
*cfclose
Stress Extraction
This will create a CSV file tha tcna be read directly into Excel: This will create a CSV file tha tcna be read directly into Excel:
Load Case Max S1 Node LoadCase MaxS1 Node
1 14823.21 17428
2 29648.53 17428
3 44475.96 17428
4 40390.54 17428
5 36634.85 17429
6 32984.73 17429
47
Maximum Stress in WB
In WB the maximum(and minimum) values for each result itemare 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 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 comprehensive report with consistent types of information for all 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 This can be done by storing these macros in a macro 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 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 users can be Once the directory with the macros has be 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