-
Notifications
You must be signed in to change notification settings - Fork 2
/
cyc_princ.inp
177 lines (133 loc) · 4.02 KB
/
cyc_princ.inp
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
! *******************************************************************
! Cyclic symmetry problem: use of *VGET command
!
! C. Semler, Ph.D.
! Mechanical Dynamics Ltd.
! 1 Place du Commerce, # 220
! Verdun, QC H3E 1A2
! Tel: (514) 761-3333
!
! This macro shows how to use *VGET command and compute principal stresses
! on all corner nodes using the response on the basic and duplicate sectors.
! Valid only for Version 6.0 or above.
!
! Use at your own risk.
! March 7th, 2002
! *******************************************************************
finish
/clear
/efacet,2
/view,,1,1,1
/angle,,-120
/graphics,power
/PREP7
ET,1,solid45
MP,EX,1,10e6
MP,PRXY,1,0
MP,DENS,1,1e-4
num_sect=12
ANG=360/num_sect
A=2*acos(-1)/num_sect
CYL4,0,0,1,0,5,ANG,0.5
esize,,10
CSYS,1
LSEL,S,LOC,Y,0
LSEL,A,LOC,Y,ang
LSEL,R,LOC,X,1
LESIZE,ALL, , ,3, , , , ,1 ! 3 elements
CSYS,0
cyclic ! new command at 6.0
cyclic,status ! new command at 6.0
vsweep,1
CM,e_init_,ELEM ! Put elements into components
ALLSEL,BELOW,ELEM
CM,n_init_,NODE ! Put nodes into components
*get,sect_node,NODE,,count
!N,10000 ,,,,,,,
*GET,n_max_,node,,num,max ! Get maximum node number defined
CMSEL,S,N_INIT_
CMSEL,S,E_INIT_
/solution
ANTYPE,modal
MODOPT,LANB,10,0,0, ,ON
EQSLV,SPAR
MXPAND,10,,,YES
K=4 ! This corresponds to the nodal diameter
cycopt,noddia,K ! new command at 6.0
cycopt,status ! new command at 6.0
SOLVE
FINISH
/prep7
cyclic,status ! new command at 6.0
/post1
set,,6
/CYCEXPAND,,ON ! new command at 6.0
plns,u,z
! UA = real part of solution (basic sector)
! UB = imaginary part of solution (duplicate sector)
! N = sector number for expansion
! K = nodal diameter
! A = sector angle (radians)
! UN = expanded result for sector N
! UN = UA * cos[(N-1)KA] - UB * sin[(N-1)KA]
CMSEL,S,N_INIT_
*DIM,NMASK_,ARRAY,n_max_ ! Masking array
*VGET,NMASK_(1),node,1,nsel
*DIM,stressR_,ARRAY,n_max_,6,1, , ,
*DIM,stressI_,ARRAY,sect_node,6,1, , ,
! ***********************************************************************
! ** This is the trick !! You need to be in RSYS,1 to get proper stresses
! ***********************************************************************
RSYS,1 ! This is probably the axis of rotation
! ***********************************************************************
! Get stresses on the initial sector (real part)
! ***********************************************************************
*VMASK,NMASK_(1)
*VGET,stressR_(1,1),NODE, ,S,X, , ,2
*VMASK,NMASK_(1)
*VGET,stressR_(1,2),NODE, ,S,Y, , ,2
*VMASK,NMASK_(1)
*VGET,stressR_(1,3),NODE, ,S,Z, , ,2
*VMASK,NMASK_(1)
*VGET,stressR_(1,4),NODE, ,S,XY, , ,2
*VMASK,NMASK_(1)
*VGET,stressR_(1,5),NODE, ,S,YZ, , ,2
*VMASK,NMASK_(1)
*VGET,stressR_(1,6),NODE, ,S,XZ, , ,2
NSEL,ALL
CMSEL,U,N_INIT_
! ***********************************************************************
! Get stresses on the duplicate sector (complex part)
! ***********************************************************************
*VGET,stressI_(1,1),NODE,1+n_max_ ,S,X, , ,2
*VGET,stressI_(1,2),NODE,1+n_max_ ,S,Y, , ,2
*VGET,stressI_(1,3),NODE,1+n_max_ ,S,Z, , ,2
*VGET,stressI_(1,4),NODE,1+n_max_ ,S,XY, , ,2
*VGET,stressI_(1,5),NODE,1+n_max_ ,S,YZ, , ,2
*VGET,stressI_(1,6),NODE,1+n_max_ ,S,XZ, , ,2
CMSEL,S,N_INIT_
*ASK,sector_,Sector number to calculate,3
*DIM,stressC_,ARRAY,sect_node,6,1
*DO,k_,sector_,sector_ ! Calculate only for sector of interest
fact_r_=cos((k_-1)*K*A)
fact_i_=sin((k_-1)*K*A)
*DO,j_,1,6
*VFACT,1,fact_r_,fact_i_,1,
*VOPER,stressC_(1,j_,1),stressR_(1,j_),SUB,stressI_(1,j_), , ,
*ENDDO
*ENDDO
*DIM,princ_,ARRAY,n_max_,5,1, , ,
*VMASK,NMASK_(1)
*VFUN,princ_(1,1),PRIN,stressC_(1,1) ! Undocumented command
/CYCEXPAND, ,OFF
*VMASK,NMASK_(1)
*VPUT,princ_(1,1),NODE, ,U,X, , ,2
*VMASK,NMASK_(1)
*VPUT,princ_(1,2),NODE, ,U,Y, , ,2
*VMASK,NMASK_(1)
*VPUT,princ_(1,3),NODE, ,U,Z, , ,2
CMSEL,S,N_INIT_
CMSEL,S,E_INIT_
/DSCALE,1,OFF
/TITLE, Displacements contain principal stresses of sector %sector_%
PLNSOL,U,X,0,1