2011 05 19 Design Assessment
2011 05 19 Design Assessment
Eric Miller
Principal
Director, Simulation and
Business Technologies
5/19/2011
PADT, Inc.
DX R13: 02/17/2011
1
Agenda
Note: This presentation is being
recorded
Introduction
Overview
Result Combinations
The API
XML
Python Scripts
Conclusion
DX R13: 02/17/2011
2
Introductions
DX R13: 02/17/2011
3
Upcoming Webinars
May 26, 2011 12:00 pm
Using APDL Snippets in ANSYS Mechanical
DX R13: 02/17/2011
4
About PADT
PADT is an Engineering Services
Company
Mechanical Engineering
17 Years of Growth and Happy customers
68 Employees
3 Business Areas
CAE Sales & Services
Consulting, Training, Sales, Support
Product Development
Rapid Prototyping & Manufacturing
www.CUBE-HVPC.com
DX R13: 02/17/2011
6
Email Subscriptions:
Twitter:
#padtinc
Web:
www.PADTINC.com
LinkedIn:
Search on PADT, Inc.
www.padtinc.com/epubs
DX R13: 02/17/2011
7
Overview
What is Design
Assessment and What
Can it Do?
DX R13: 02/17/2011
8
Design Assessment
First off why so many Ss in Assessment!
Design Assessment (DA) is a new system in ANSYS
Mechanical R13 that allows do sophisticated post processing
It lets you do two things
Solution Combination
Make a DA object and do an Assessment on your results using a
predefined or user defined set of operations
DX R13: 02/17/2011
9
DX R13: 02/17/2011
11
Solution
Combination
DX R13: 02/17/2011
12
2.
3.
4.
5.
6.
DX R13: 02/17/2011
13
Internal pressure of 1
X acceleration of 1
Y acceleration of 1
Z acceleration of 1
DX R13: 02/17/2011
14
DX R13: 02/17/2011
15
Define Combination
After inserting a blank worksheet comes up
Coefficient: Scale factor to be applied to the result value
Environment Name: Name of environment to pull results
from
For when you have multiple systems
Time:
Specify time to pull from
DX R13: 02/17/2011
16
Define Combination
For example the results are scaled for:
534 psi internal pressure
Acceleration vector of (10,4.6,2.5)
DX R13: 02/17/2011
17
DX R13: 02/17/2011
18
View Results
Click Solve or Evaluate Results
Just like normal results
Only exception is no parameters right now
DX R13: 02/17/2011
19
Go to Town
You can Duplicate a Branch to make more
RMB->Duplicate then change the worksheet for your next
combination
No user defined yet
Suggestions/comments
If you are comparing combinations, put some sort of identifier in the
result object name:
Comb1: SX and Comb2: SX
DX R13: 02/17/2011
20
But Wait
They will not be adding capability to this feature in the future.
The new way to do solution combinations will be through a
DA system added to your project
Default configuration
The API
DX R13: 02/17/2011
22
DX R13: 02/17/2011
23
DA Setup
You can do the default Solution Combination, the ASUS code checking,
or User Defined
Solution Combination is just like what is built into ANSYS Mechanical
As mentioned, we are now recommending that you use this because it is
where things will get added in future releases
If you pick User Defined you have to point to your XML file and you will
get your custom Design Assessment
DX R13: 02/17/2011
24
But
This is modern object oriented XML and Python
You are hooking into the Workbench 1 infrastructure
This is not simple scripting no time to do a class today
However
It is not as bad as it looks
The format is verbose, but truly the amount of work you need to do is
pretty small
It is well documented
This is the future of customization, good way to get used to it
<?xml version="1.0" encoding="utf-8"?>
<!--Modified version of standard result combination -->
<DARoot ObjId ="1" Type="CAERep" Ver="2">
<Attributes ObjId="2" Type="CAERepBase" Ver="2">
<!--definition of attributes for re-use throughout the attribute groups.-->
</Attributes>
<AttributeGroups ObjId ="3" Type="CAERepBase" Ver="2">
<!--grouping of attributes used to define the available options in the attribute groups objects-->
</AttributeGroups>
<DAScripts ObjId="4" Type="DAScripts" Ver="2">
<!--analysis script language & contents used to define a script covering how the design assessment will be performed and a script used to obtain results-->
<Solve PropType="string">None</Solve>
<Evaluate PropType="string">None</Evaluate>
<DAData PropType="int">0</DAData>
<CombResults PropType="int">1</CombResults>
<SelectionExtra PropType="vector<string>"></SelectionExtra>
</DAScripts>
<Results ObjId="5" Type="CAERepBase" Ver="2">
<!--definition of the available results and the available options in the results object.-->
</Results>
</DARoot>
DX R13: 02/17/2011
25
Two Parts
XML File
Defines things that WB1 needs to know
Python Scripts
Grabs data from model
Does stuff with it
Brings data back into the model
DX R13: 02/17/2011
26
XML FILES
DX R13: 02/17/2011
27
XML File
You define an XML file: Design Assessment XML Definition
File
Tells ANSYS Mechanical how to fit your DA into your
model
Three things are specified in file:
Attributes and Attribute Groups
Scripts to be run, if any
What results are produced and how to handle them
<?xml version="1.0" encoding="utf-8"?>
<Attributes ObjId="2" Type="CAERepBase" Ver="2">
</Attributes>
<AttributeGroups ObjId ="3" Type="CAERepBase" Ver="2">
</AttributeGroups>
DX R13: 02/17/2011
28
DX R13: 02/17/2011
29
Attributes
You create <DAAttribute> objects in the file for every item
you want to prompt the user for
<DAAttribute ObjId="101" Type="DAAttribute" Ver="2">
ObjID is the handle for the attribute VERY IMPORTANT
<AttributeName PropType="string">Text</AttributeName>
Specifies the name for the attribute
Does not change the headings in details , is its own line in details
<AttributeType PropType=
[Int|Double|Text|DropDown|Table|None]">Value</AttributeT
ype>
Specify the type of data that the user can enter
DX R13: 02/17/2011
30
Attributes, Cont
<Application PropType="string">
[Vertices|Lines|Surfaces|Solids|Geometry|All]</Application>
Defines the type of geometry that the attribute applies to
If other than All, a scoping box is added to the details view.
<Validation PropType="vector<string>
[min,max|lenMax|T1,T2,T3TN]</Validation>
Specifies min,max for Int and Double
Max string length for String
Comma delimited list for dropdown values or table headings
<Default PropType=String>[Value|String|DropDownString]
</Default>
Specifies a default value for the attribute
leave blank for none
Example Attributes
<Attributes ObjId="2" Type="CAERepBase" Ver="2">
<DAAttribute ObjId="101" Type="DAAttribute" Ver="2">
<AttributeName PropType="string">Stress Floor</AttributeName>
<AttributeType PropType="string">Double</AttributeType>
<Application PropType="string">Geometry</Application>
<Validation PropType="vector<string>"> 0,10000000
</Validation>
</DAAttribute>
<DAAttribute ObjId="102" Type="DAAttribute" Ver="2">
<AttributeName PropType="string">Stress Ceiling</AttributeName>
<AttributeType PropType="string">Double</AttributeType>
<Application PropType="string">Geometry</Application>
<Validation PropType="vector<string>"> 0,10000000
</Validation>
</DAAttribute>
<DAAttribute ObjId="201" Type="DAAttribute" Ver="2">
<AttributeName PropType="string">User Comments</AttributeName>
<AttributeType PropType="string">Text</AttributeType>
<Application PropType="string">All</Application>
</DAAttribute>
</Attributes>
DX R13: 02/17/2011
32
Attribute Group
Users access attributes by choosing a group and a subgroup
Not done in the insert menu
Specify:
Group ID:
<DAAttributeGroup ObjId = [ID] Type="DAAttributeGroup" Ver="2">
Group name
<GroupType PropType="string">[NAME]</GroupType>
Subgroup name
<GroupSubtype PropType="string">[NAME]</GroupSubtype>
DX R13: 02/17/2011
34
Script
Tells the program:
What Scripts to run for a Solve and for an Evaluate action
Options on allowing solution combination, results, or attributes to be inserted
Additional result columns to be put in solution selection worksheet
<Solve PropType="string">[Script]"</Solve>
Script name with full path
DX R13: 02/17/2011
35
<Evaluate>
Extract results from post processor
Runs after <Solve> when Solve is chosen by user
Runs when user chooses Evaluate All Results
Why?
User may run some sort of post processing
that updates calculated values without needing
to re-extract information from Mechanical
Just do an Evaluate
DX R13: 02/17/2011
36
Scripts Example
DX R13: 02/17/2011
37
Results
Tells the program what results are available to be added to the tree
Works a lot like the input attributes, and uses them
RMP->Insert->DA Result
Then you pick what result you want with type and subtype
<GroupType PropType="string">[GroupName]</GroupType>
What to call it in the drop down
<DisplayType PropType="string">ElmCont</AttributeIDs>
DX R13: 02/17/2011
38
Results Example
DX R13: 02/17/2011
39
DX R13: 02/17/2011
40
Summary on XML
Start simple and define a few key things
Use RMB on Setup on system on project page to reread
XML file as you build it
In ANSYS Mecanical:
RMB->Insert->Attribute Group to add user prompts
RMB->Insert->DA Result on Solution to define what results to show
DX R13: 02/17/2011
41
PYTHON SCRIPTS
DX R13: 02/17/2011
42
Writing Scripts
Not enough time to even sort of show this
Not really hard, but each application is unique
DX R13: 02/17/2011
43
Helper
DX R13: 02/17/2011
44
DAElement
Access to a specific element: Type, Connectivity, section data, etc.
DANode
Info about a specific node: location and elements it is attached to
SectionData
Info on a specific elements section properties
DX R13: 02/17/2011
45
Attribute
Used to get the specific values entered for an attribute
Selection
Access what the user chose for the Solution Selection branch in the
Mechanical tree
Solution
Access each row of the SolutionSelection tree object
DX R13: 02/17/2011
46
ValueStructure
Get single data values from moedel, mostly stuff in XML file
Set single data values in the Result objects
ResultGroup
Collection of attributes for DA Result Objects
Like AttributeGroup, but for results
ResultClass
Used to set a specific result value
DX R13: 02/17/2011
47
Basic Steps
Usual Steps in Solve Script: Getting Results from your
Mechanical Run
Get any values that the user may have specified as DA attributes
Get results from your Mechanical run
Write an APDL macro using python that will:
Go into MAPDL
Extract info you want
Output in the format you want
DX R13: 02/17/2011
48
Basic Steps
Usual Steps in Evaluation Script: Using Results from your
Mechanical Run to do Calculations
Read results from file created in Solve script
Get any attributes set in the DA Results added to the tree
Loop through DA Results, making calculations
Use MAPDL
Write macro then execute
Use Python
Use an external program
Any combination of the above
DX R13: 02/17/2011
49
da_trunc.xml
da_trunc_solve.xml
da_trunc_eval.xml
DX R13: 02/17/2011
50
DX R13: 02/17/2011
51
Conclusion
DX R13: 02/17/2011
52
Some limitations:
You need to be careful about paths in your script, no relative path yet
If you launch MAPDL in your scripts, you need two licenses
And set Options->tools->license preferences to disable sharing
DX R13: 02/17/2011
53
Best way to do your own custom post processing and stay in Mechanical
Fits in the existing ANSYS Mechanical framework
Very general nature takes getting used to
Groups and SubGroups
No predefined Attributes or results
For many of us: the object oriented bit is hard to get our head around
Stick with it
There is a reason why it is so popular
DX R13: 02/17/2011
54
Recommendations
When working RMB on Setup cell and choose file, that
rereads and redoes the DA
Get an XML script editing tool
Copy & paste existing guys
C:\Program Files\ANSYS Inc\v130\aisol\DesignSpace\DSPages\xml
We will post on The Focus: www.PADTINC.com/blog
DX R13: 02/17/2011
55
DX R13: 02/17/2011
56
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)
Rapid Prototyping
SLA, SLS, FDM, PolyJet, CNC, Soft Tooling,
Injection Molding
DX R13: 02/17/2011
57