forked from bguest/ansys-macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPRELOAD.mac
63 lines (55 loc) · 1.45 KB
/
PRELOAD.mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/PMACRO
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
!PRELOAD.MAC
!DESCRIPTION:
! THIS MACRO PRELOADS "BOLTS" CREATED BY BOLT.MAC
!PRECONDITIONS:
! BOLTS CREATED BY BOLTS.MAC
! ARG1=DIAMETER OF BOLT
! ARG2=BOLT PRELOAD
! ELSE PRELOAD=0.8*Sty*PI*D^2/4 !Juvinal,p420
! ARG3=SURFACE GAP
! ELSE GAP = 0
! ARG4=BOLT LENGTH
! ELSE BOLT LENGTH = 1
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
CM,temp_ELEM,ELEM
BOLTD=ARG1
!-------------------------------STAINLESS_STEEL_A286
Sty=95000 !Yeild Strength
BoltA=9.20E-06 !Bolt CTE
BoltE=2.91E+07 !Bolt Modulus of Elasticity
!-----------------------------------------------SOLUTION
/SOLU
Bolt_Area=PI/4*BoltD**2 !BOLT AREA
*IF,ARG4,EQ,0,THEN !---------BOLT LENGTH
BoltL=1
*ELSE
BoltL=ARG4
*ENDIF !--------------------------------
*IF,ARG2,EQ,0,THEN !---------PRELOAD CALC
PreLoad=0.8*Bolt_Area*Sty
*ELSE
PreLoad=ARG2
*ENDIF !---------------------------------
*IF,ARG3,EQ,0,THEN !---------"SURFACE GAP"
delG=0
*ELSE
delG=ARG3
*ENDIF !---------------------------------
DelT=delG/BoltA/BoltL + PreLoad/Bolt_Area/BoltE/BoltA
ESEL,S,MAT,,BOLTD*10000
BFE,ALL,TEMP,1,-DelT
!=======================CLEAN UP=========================
!--RESUME TEMPORARY COMPONENTS
CMSEL,A,temp_ELEM
!--DELETE TEMPORARY COMPONENTS
CMDELE,temp_ELEM
*SET,Sty
*SET,BoltA
*SET,BoltE
*SET,BoltL
*SET,Bolt_Area
*SET,DelT
!======THE--END========THE--END========THE--END========
!ITS THE END OF THE FILE AS WE KNOW IT, AND I FEEL FINE