建立好模型
…..
/SOLU
!*
ANTYPE,0
/INPUT,'input','txt',
/INPUT,'output1','txt',
!*
ISFILE,READ,1,txt, ,0
SOLVE
=====================
!定義殘餘應力矩陣
I=1
fy=310e6
!定義單元中心坐標數組,初應力數組
*DIM,EleCenter,ARRAY,NumNode,3,1, , ,
*DIM,EleIS,ARRAY,NumNode,1,1, , ,
*DO,I, 1, NumNode,1
!得到單元中心坐標
*GET,EleCenter(I,1,1),ELEM,I,CENT,X
*GET,EleCenter(I,2,1),ELEM,I,CENT,Y
*GET,EleCenter(I,3,1),ELEM,I,CENT,Z
!焊縫位置在X=1.0 到1.05 之間
*IF,EleCenter(I,1,1),GT,1,THEN
*IF,EleCenter(I,1,1),LT,1.05,THEN
*IF,EleCenter(I,2,1),GT,0.5,THEN
!上翼緣初始應力
EleIS(I,1,1)=-20*fy*EleCenter(I,3,1)**2+0.3*fy
*endif
*IF,EleCenter(I,2,1),LT,0.0,THEN
!下翼緣初始應力
EleIS(I,1,1)=-20*fy*EleCenter(I,3,1)**2+0.3*fy
*endif
!腹板初始應力
*if,EleCenter(I,2,1),GE,0.0,THEN
*IF,ELECENTER(I,2,1),LE,0.5,THEN
EleIS(I,1,1)=4.076*fy*(EleCenter(I,2,1)-0.5)**2
EleIS(I,1,1)=EleIS(I,1,1)-0.719*fy
*IF,EleIS(I,1,1),LT,-0.3*fy,THEN
ELeIS(I,1,1)=-0.3*fy
*ENDIF
*ENDIF
*ENDIF
*ENDIF
*ENDIF
*ENDDO
===============
!輸出應力數值
*CFOPEN,'1','txt',' '
*DO,I,1,3840
!*IF,EleIS(I,1,1),ne,0.,then
*VWRITE,'!'
(A)
*VWRITE,'! Stress for element',
(A,F)
*VWRITE,'!'
(A)
*VWRITE,'eis,',I
(A,F)
P=EleIS(I,1,1)
*VWRITE,P,0.,0.,0.,0.,0.
(E,E,E,E,E,E)
!*ENDIF
*ENDDO
*CFCLOS
…..
/SOLU
!*
ANTYPE,0
/INPUT,'input','txt',
/INPUT,'output1','txt',
!*
ISFILE,READ,1,txt, ,0
SOLVE
=====================
!定義殘餘應力矩陣
I=1
fy=310e6
!定義單元中心坐標數組,初應力數組
*DIM,EleCenter,ARRAY,NumNode,3,1, , ,
*DIM,EleIS,ARRAY,NumNode,1,1, , ,
*DO,I, 1, NumNode,1
!得到單元中心坐標
*GET,EleCenter(I,1,1),ELEM,I,CENT,X
*GET,EleCenter(I,2,1),ELEM,I,CENT,Y
*GET,EleCenter(I,3,1),ELEM,I,CENT,Z
!焊縫位置在X=1.0 到1.05 之間
*IF,EleCenter(I,1,1),GT,1,THEN
*IF,EleCenter(I,1,1),LT,1.05,THEN
*IF,EleCenter(I,2,1),GT,0.5,THEN
!上翼緣初始應力
EleIS(I,1,1)=-20*fy*EleCenter(I,3,1)**2+0.3*fy
*endif
*IF,EleCenter(I,2,1),LT,0.0,THEN
!下翼緣初始應力
EleIS(I,1,1)=-20*fy*EleCenter(I,3,1)**2+0.3*fy
*endif
!腹板初始應力
*if,EleCenter(I,2,1),GE,0.0,THEN
*IF,ELECENTER(I,2,1),LE,0.5,THEN
EleIS(I,1,1)=4.076*fy*(EleCenter(I,2,1)-0.5)**2
EleIS(I,1,1)=EleIS(I,1,1)-0.719*fy
*IF,EleIS(I,1,1),LT,-0.3*fy,THEN
ELeIS(I,1,1)=-0.3*fy
*ENDIF
*ENDIF
*ENDIF
*ENDIF
*ENDIF
*ENDDO
===============
!輸出應力數值
*CFOPEN,'1','txt',' '
*DO,I,1,3840
!*IF,EleIS(I,1,1),ne,0.,then
*VWRITE,'!'
(A)
*VWRITE,'! Stress for element',
(A,F)
*VWRITE,'!'
(A)
*VWRITE,'eis,',I
(A,F)
P=EleIS(I,1,1)
*VWRITE,P,0.,0.,0.,0.,0.
(E,E,E,E,E,E)
!*ENDIF
*ENDDO
*CFCLOS