forked from bguest/ansys-macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PCOMP.mac
91 lines (80 loc) · 2.27 KB
/
PCOMP.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
!PCOMP.mac
!DESCRIPTION: This macro creates a composite property
!PRECONDITIONS:
! numLay = number of layers in the property
! layThick = Array with the layers thicknesses
! layAngle = Array with the layer angles IN DEGREESE
! layMat = Array with the layer material numbers
! flagPrintPCOMP = 1 ~> Lamina properties printed to file
! ARGUMENTS:
! ARG1: Resulting material property number
! ARG2: Element Type To be used, supported types are
! 'SHELL91','SHELL181', 'SHELL281', 'SOLID186' (More Added On Request)
! ARG3: Added mass (mass/area)
! ARG4: use sandwich option? 1 --> YES, 0 --> NO
!=====================================================
*if,ARG1,gt,0,then !Resultant Property Number
MNum = Arg1
*else
MNum = 'MatNum'
*endif
EType = UPCASE(ARG2) !Set Material Property Type
*if,ARG3,GT,0,then !Added Mass
ADMSUA = ARG3
*else
ADMSUA = 0
*endif
useSandwich = ARG4 !Sandwich option
!Only applicable for SHELL91
! Create Properties
*if,EType,EQ,'SHELL181',or,EType,EQ,'SHELL281',then
ET,MNum,EType
R,MNum
SECTYPE,MNum,SHELL
SECCONTROLS,,,,ADMSUA
!SECDATA,<Thickness>,<MatNum>,<Theata>,<NUMPT>,<LayerName>
*do,i,1,numLay,
SECDATA,layThick(i),layMat(i),layAngle(i)
*enddo
*elseif,EType,EQ,'SOLID185',OR,EType,EQ,'SOLID186',then
ET,MNum,EType
R,MNum
KEYOPT,MNum,3,1 !Layered Solid
SECTYPE,MNum,SHELL
!SECDATA,<Thickness>,<MatNum>,<Theata>,<NUMPT>,<LayerName>
*do,i,1,numLay,
SECDATA,layThick(i),layMat(i),layAngle(i)
*enddo
*elseif,EType,EQ,'SHELL91',then
ET,MNum,SHELL91
R,MNum,numLay,,,,,ADMSUA,
RMORE,,,,,,, !NEEDED!
!LAYERED DATA:
!RMORE,<MatNum>,THEATA,TK(I), TK(J), TK(K), TK(L)
*do,i,1,numLay
t = layThick(i)
RMORE,layMat(i),layAngle(i),t,t,t,t
*enddo
KEYOPT,MNum,1,numLay
KEYOPT,MNum,9,useSandwich
*endif
MP,DENS,MNum,0 !Dummy Material
! Write Layer info to file if flagPrintPCOMP
*if,flagPrintPCOMP,eq,1,then
*cfopen,OUT_PCOMP_%MNum%,out
*vwrite,MNum
Composite Layup Number %I
*vwrite
NO. MatNum Angle Thickness
*do,i,1,numLay
layAng_ = layAngle(i)
layThk_ = layThick(i)
layMat_ = layMat(i)
*vwrite,i,layMat_,layAng_,layThk_
%I %I %13G %13G
*enddo
*cfclos
*endif
!======THE--END========THE--END========THE--END========
!ITS THE END OF THE FILE AS WE KNOW IT, AND I FEEL FINE