层数 3
层序数 厚度m E1(Pa) E2(Pa) v12 v21 G12(Pa) 角度(°)
1 1.00E-03 9.60E+10 0.10 0.40 1.00E+10 0.00
2 1.00E-03 9.60E+10 0.10 0.40 1.00E+10 90.00
3 1.00E-03 9.60E+10 0.10 0.40 1.00E+10 0.00
PROGRAM COMPOSITE
IMPLICIT NONE
REAL(8)::A(3,3),B(3,3),D(3,3),MC(5),TEMP,ROT(3,3)
!A拉伸刚度;B耦合刚度;D弯曲刚度;
!MC读入材料常数;ROT旋转矩阵
REAL(8)::TOTAL_TH,HALF_TH !总厚度;半厚度
REAL(8),ALLOCATABLE::Q(:,:,:),AL(:),T(:),Z(:),Z1(:),Z2(:),Z3(:)
!Q每层板相应刚度;AL转角;T每层板的厚度;Z坐标量
INTEGER(4)::N,I,J,K,SEQ,L
!____IJK循环变量;N板的层数;SEQ序数
CHARACTER(50)::CHR(8),TEMPC,filename1,filename2
!CHR、TEMPC:character variables
WRITE(*,*)"Please insert the INP file name(a.txt for example):"
READ(*,*)filename1
OPEN(8,file=filename1)!Open data file
!Read in data
READ(8,*)TEMPC,N
ALLOCATE(Q(3,3,N),AL(N),T(N),Z(N+1),Z1(N),Z2(N),Z3(N))
READ(8,*)CHR(1:8)
DO I=1,N
READ(8,*)SEQ,T(I),MC(1:5),AL(I)
Q(:,:,I)=0!Calculate stiffness of each layer for the principal axis
TEMP=1./(1-MC(3)*MC(4))
Q(1,1,I)=MC(1)*TEMP
Q(2,2,I)=MC(2)*TEMP
Q(3,3,I)=MC(5)
Q(1,2,I)=MC(4)*MC(2)*TEMP
Q(2,1,I)=Q(1,2,I)
AL(I)=AL(I)*3.1415926535898/180
ROT(1,1)=(cos(AL(I)))**2!Work out Rot Matrix
ROT(2,2)=ROT(1,1)
ROT(3,3)=cos(2*AL(I))
ROT(2,1)=1-ROT(1,1)
ROT(1,2)=ROT(2,1)
ROT(3,1)=0.5*sin(2*AL(I))
ROT(3,2)=-ROT(3,1)
ROT(1,3)=-2*ROT(3,1)
ROT(2,3)=-2*ROT(3,2)
Q(:,:,I)=MATMUL(MATMUL(ROT,Q(:,:,I)),TRANSPOSE(ROT))
ENDDO
TOTAL_TH=sum(T)
HALF_TH=TOTAL_TH/2
Z(1)=-HALF_TH
!Work out Z
DO I=1,N
Z(I+1)=Z(I)+T(I)
ENDDO
!calculate tensor A、B and D
DO K=1,N
Z1(K)=(Z(K+1)-Z(K))
Z2(K)=(Z(K+1)-Z(K))*(Z(K+1)+Z(K))/2
Z3(K)=(Z(K+1)**3-Z(K)**3)/3
ENDDO
A=0;B=0;D=0
WRITE(*,*)"Please insert the OUP file name(b.txt for example):"
READ(*,*)filename2
OPEN(9,file=filename2)
!Write in stiffness tensor for each single ply
DO K=1,N
WRITE(9,100)K
100 FORMAT("The stiffness of number",1X,I2,2X,"ply is:")
DO I=1,3
WRITE(9,200)Q(I,:,K)
200 FORMAT(ES12.4,6X,ES12.4,6X,ES12.4)
ENDDO
WRITE(9,"(/)")
A=A+Q(:,:,K)*Z1(K)
B=B+Q(:,:,K)*Z2(K)
D=D+Q(:,:,K)*Z3(K)
ENDDO
!Output the actual stiffness of the laminate
WRITE(9,"(/)");WRITE(9,"(/)")
WRITE(9,*)"The ACTUAL stiffness tensor of the laminate:"
WRITE(9,"(/)")
WRITE(9,*)"The extension stiffness A equals:"
DO I=1,3
WRITE(9,200)A(I,1:3)
ENDDO
WRITE(9,"(/)")
WRITE(9,*)"The coupling stiffness B equals:"
DO I=1,3
WRITE(9,200)B(I,1:3)
ENDDO
WRITE(9,"(/)")
WRITE(9,*)"The bending stiffness D equals:"
DO I=1,3
WRITE(9,200)D(I,1:3)
ENDDO
!Normalised tensor output
WRITE(9,"(/)");WRITE(9,"(/)")
WRITE(9,*)"The NORMALISED stiffness tensor of the laminate:"
WRITE(9,"(/)")
WRITE(9,*)"The NORMALISED extension stiffness A* equals:"
DO I=1,3
WRITE(9,200)A(I,1:3)/TOTAL_TH
ENDDO
WRITE(9,"(/)")
WRITE(9,*)"The NORMALISED coupling tensor C equals:"
DO I=1,3
WRITE(9,200)A(I,1:3)/TOTAL_TH-12*D(I,1:3)/TOTAL_TH**3
ENDDO
WRITE(9,"(/)")
WRITE(9,*)"The NORMALISED bending stiffness D* equals:"
DO I=1,3
WRITE(9,200)12*D(I,1:3)/TOTAL_TH**3
ENDDO
WRITE(*,*)"OUTPUT successfully,please press any key to end program!"
READ(*,*)
END PROGRAM COMPOSITE
Snipaste_2020-10-25_15-47-14.jpg (80.42 KB, 下载次数: 390)
Snipaste_2020-10-25_17-17-23.jpg (335.49 KB, 下载次数: 384)
风平老涡 发表于 2020-10-25 23:32
查一下变量TEMPC, N, 和 CHR(1:8)。
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |