Professional Documents
Culture Documents
Workbench Scripting PDF
Workbench Scripting PDF
ANSYS Workbench
Scripting in
ANSYS 1212.1
1
November 2009
Tools ->
> Options
Options ->
> Journals and Logs
Start a journal
recording
P
Property:
t
Data belonging to an object
Defined by its name,
name type,
type and value
Property types: Boolean, String, Integer, Real, etc.
Dictionaries and Lists can also be property types
Note: Python
y is a loosely-typed
y yp language;
g g youy do not
need to declare variables.
2009 ANSYS, Inc. All rights reserved. 16 ANSYS, Inc. Proprietary
Project & Data Model Concepts
System:
A collection of components that
together provide a workflow to
achieve an engineering
simulation goal.
Component:
A collection of data and a data
editor that work together to
achieve a CAE-related task.
A Component is represented
by a Cell in the Workbench
Project Schematic.
Data Entity:
A data structure defined within a
d
data container.
i Ad
data
container often has several data
entities.
# Q
Query
y for the static structural analysis
y template
p
ss_template = GetTemplate(TemplateName="Static Structural",
Solver="ANSYS")
# Q
Query f
for th
the material
t i l ddata
t entity
tit iin th
the d
data
t container
t i
steel = ed_container.GetMaterial(Name="Structural Steel")
# Query for the property data entity associated with structural steel
elasticity = steel.GetProperty(Name="Elasticity")
# Set Youngs
Young s modulus
elasticity.SetData(Variables="Young's Modulus", Values=2E+11)
Native applications
Built entirely on new Workbench Framework
Fully supported by Workbench scripting
E.g.,
g Project
j Schematic, Design
g Exploration,
p
Engineering Data
Data-integrated applications
Share data and parameters with Workbench,
native
ti applications,
li ti andd other
th ddata-integrated
t i t t d
applications
Created independently
p y from new Workbench
Framework
Often have their own scripting languages
E.g.,
E M h i l Mechanical
Mechanical, M h i l APDLAPDL,
CFX, FLUENT, DesignModeler
2009 ANSYS, Inc. All rights reserved. 23 ANSYS, Inc. Proprietary
Data-Integrated Applications
Application
Application-level
level scripting can be embedded in a
Workbench script
APDL,
APDL CCL
CCL, Scheme
Scheme, JScript,
JScript etc.
etc