Verifying Pressures

Download Report

Transcript Verifying Pressures

Workshop 9
Macro Basics
Verifying Pressures
9. Macro Basics
Verifying Pressures
Create a macro called SFEPLOT to
verify and plot the pressure applied
on a specified face of a surface effect
element. The macro should have
arguments as follows:
SFEPLOT, TYPE, FACE
where TYPE is the element type
number for SURF154 and FACE is the
face number for which effective
pressure is desired.
•
Given: A database file containing a
"bolt load" applied on a plate with a
hole.
INTRODUCTION TO ANSYS 6.0 - Part 2
•
Workshop Supplement
October 30, 2001
Inventory #001572
W9-2
9. Macro Basics
Verifying Pressures
Workshop Supplement
Enter ANSYS in the working directory specified by your instructor using “bpressure”
as the jobname.
2.
Resume the “bpressure.db1” database file.
3.
Enter Solution and solve.
4.
Enter POST1 and plot SY stresses.
INTRODUCTION TO ANSYS 6.0 - Part 2
1.
October 30, 2001
Inventory #001572
W9-3
9. Macro Basics
Verifying Pressures
Now do the operations you want the macro to do. We can then use the
corresponding commands from the log file to create the macro.
a) Select elements of type 1 (SURF154 elements) and all nodes attached to them:
–
–
Utility Menu > Select > Entities …
•
Choose [Elements], [By Attributes], "Elem type Num" and "From Full"
•
Min,Max,Inc = 1
•
[Apply]
•
Choose [Nodes], [Attached to], and "Elements"
• [Apply]
Or issue:
ESEL,S,TYPE,,1
NSLE
INTRODUCTION TO ANSYS 6.0 - Part 2
5.
Workshop Supplement
October 30, 2001
Inventory #001572
W9-4
9. Macro Basics
Verifying Pressures
(cont'd)
b) Create an element table item containing effective pressure on face 5 of SURF154
elements. This is "SMISC 17" as documented in the Elements Reference manual.
–
Main Menu > General Postproc > Element Table > Define Table …
•
[Add…]
– Lab = peff
– Item = By Sequence Num
– Comp = SMISC, 17 (type in the number 17 in the selection box)
– [OK]
–
• [Close]
Or issue:
ETABLE,PEFF,SMISC,17
INTRODUCTION TO ANSYS 6.0 - Part 2
5.
Workshop Supplement
October 30, 2001
Inventory #001572
W9-5
9. Macro Basics
Verifying Pressures
(cont'd)
c) Plot the element table item PEFF.
–
Element Table > Plot Elem Table…
•
–
Itlab = PEFF
• Avgkey = No - do not avg
Or issue:
PLETAB,PEFF
d) Select everything.
–
–
Utility Menu > Select > Everything
Or issue:
ALLSEL
INTRODUCTION TO ANSYS 6.0 - Part 2
5.
Workshop Supplement
October 30, 2001
Inventory #001572
W9-6
9. Macro Basics
Verifying Pressures
List the log file to see the commands that were just executed in step 5, then create a
macro with those commands. The only change is that the element type number and
SMISC item number are replaced by ARG1 and ARG2+12, respectively.
–
Utility Menu > List > Files > Log File
–
Utility Menu > Macro > Create Macro …
•
Macro file name = sfeplot.mac
•
Then type one command per line as shown below. Note: The "Create Macro" dialog is
suitable only for short macros such as this one. It is not an editor and cannot be used to
edit an existing macro. Therefore, we recommend using your system's text editor to
create macros. If you wish, you may use a system editor now (but please be aware that
your favorite editor may not be available at this training facility!).
esel,s,type,,arg1
nsle,s
etable,peff,smisc,arg2+12
pletab,peff,noav
allsel,all
•
[OK]
INTRODUCTION TO ANSYS 6.0 - Part 2
6.
Workshop Supplement
October 30, 2001
Inventory #001572
W9-7
9. Macro Basics
Verifying Pressures
Test the macro by typing the following command:
SFEPLOT,1,5
8.
If time permits, edit the macro using a text editor and add if-tests for valid values of
arg2. (Arg2 can only take values of 1 to 5.) Refer to the "Branching" section of
Chapter 10 in your Training Manual for a sample if-test.
9.
Exit ANSYS.
INTRODUCTION TO ANSYS 6.0 - Part 2
7.
Workshop Supplement
October 30, 2001
Inventory #001572
W9-8