Sie sind auf Seite 1von 9

WS-4: Develop a custom load

extension (reuse APDL)

1 © 2011 ANSYS, Inc. December 3, 2012


Objectives
• The purpose of this exercise is to have the user create a new basic custom load object
– User will need to use the knowledge gathered so far
– User can use the solutions from Workshop-1 as a starting point
• The APDL commands required are provided

• Problem definition:
– Create a clampLoad extension

2 © 2011 ANSYS, Inc. December 3, 2012


Problem Statement
LS-1 LS-2

LS-3

Load Step-1: Apply the pressure  Allow the body to bend


Load Step-2: Clamp the top surface in its deformed state
Load Step-3: Apply a deformation to the clamped surface

3 © 2011 ANSYS, Inc. December 3, 2012


Solution using Command Snippet
Definition based on named selection
previously defined

LS 2

LS 3

4 © 2011 ANSYS, Inc. December 3, 2012


Solution using ACT (reuse the APDL commands)

User inputs in the APDL command snippets are


converted to the ACT load properties :
• The location provided by the named selection is now
defined based on a scoping method compatible with both
named selection and direct geometry selection

• The load step number for clamping is available from a drop-


down menu initialized with the number of steps already
defined in the Analysis Settings object

• The X Displacement value for the next load step is defined


by a new property declared as a length. This makes this
property always consistent with the current unit system
activated in Mechanical

In the ACT extension:


• Create a toolbar button to encapsulate the 2 APDL
files as a single load
• Assume 3 load steps and hardcode it in the
definition (you can try to remove this assumption
5
later)
© 2011 ANSYS, Inc. December 3, 2012
Steps ( 1)
• Start with
– WB project file clampLoad.wbpz
• It has all the settings done (material, loads, analysis settings etc.)
• Review the 2 command snippets

• Load your extension and launch Mechanical


– The load button should be available from the Mechanical toolbar
– Check that the extension is correctly loaded: The log file should not contain error
messages

• Setup and solve the analysis


– Solve the model with the command snippets
– Analyze the results
– Suppress the command snippets
– Insert your Load and resolve
– The results should match with the previous!

6 © 2011 ANSYS, Inc. December 3, 2012


Information
• The following technical topics will be covered:
– ACT custom result object creation: initial declaration and definition
– Get use of the ACT-based APIs: geometry, mesh, result reader…

• Keep the main principles in mind for ACT extension development


– The extension consists of
• An XML file  For the GUI controls etc.
• An IronPython script file  For the function declarations etc.

– One can use the IronPython console extension to interactively explore the desired
commands
• These commands can then be implemented in the extension’s functions

– Always check that the extension is correctly loaded


• Check the log file for error messages

– Include desired messages for the log file in the Python functions

7 © 2011 ANSYS, Inc. December 3, 2012


Planning the extension

XML
• Need a button in toolbar for
the ‘clampLoad’
• Details of the load:
– Scope to Geometry or
Named Selection
• Only allow edge selection
– A load step selector
– Displacement with
appropriate unit

Python
• Create the load under analysis
• Insert the desired APDL
commands to ‘ds.dat’ during
runtime
1. Collect the user inputs
2. Convert the user inputs to
APDL commands
3. Reuse the APDL commands
for applying the load using
the user inputs
8 © 2011 ANSYS, Inc. December 3, 2012
9 © 2011 ANSYS, Inc. December 3, 2012

Das könnte Ihnen auch gefallen