资源预览内容
第1页 / 共13页
第2页 / 共13页
第3页 / 共13页
第4页 / 共13页
第5页 / 共13页
第6页 / 共13页
第7页 / 共13页
第8页 / 共13页
第9页 / 共13页
第10页 / 共13页
亲,该文档总共13页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
* PROGRAM CST * CONSTANT STRAIN TRIANGLE * T.R.Chandrupatla and A.D.Belegundu *DefInt I-NDefDbl A-H, O-ZDim NN, NE, NM, NDIM, NEN, NDNDim ND, NL, NPR, NMPC, NBWDim X(), NOC(), MAT(), PM()Dim TH(), DT(), NU(), U(), F(), MPC(), BT()Dim D(), B(), DB(), SE(), Q(), STR(), TL(), S()Dim Stress(), React(), PrinStress(), PltStress()Dim CNST, LC, IPL, NQ, DJDim File1 As String, File2 As String, File3 As StringDim Title As String, Dummy As StringPrivate Sub cmdEnd_Click()EndEnd SubPrivate Sub cmdStart_Click()Call InputDataCall BandwidthCall StiffnessCall ModifyForBCCall BandSolverCall StressCalcCall ReactionCalcCall OutputcmdView.Enabled = TruecmdStart.Enabled = FalseEnd SubPrivate Sub InputData()Dim msg As String, File1 As StringFile1 = InputBox(Input File d:dirfileName.ext, Name of File)msg = 1. Plane Stress Analysis & Chr(13)msg = msg + 2. Plane Strain Analysis & Chr(13)msg = msg + Your Choice ?LC = InputBox(msg, Type of Problem, 1)NPR = 3 Material Properties E, Nu, Alphamsg = 1) No Plot Data & Chr(13)msg = msg + 2) Create Data File for in-plane Shear Stress & Chr(13)msg = msg + 3) Create Data File for Von Mises Stress & Chr(13)msg = msg + Choose 1 or 2 or 3IPL = InputBox(msg, Plot Choice, 1)Open File1 For Input As #1Line Input #1, Dummy: Input #1, TitleLine Input #1, Dummy: Input #1, NN, NE, NM, NDIM, NEN, NDNLine Input #1, Dummy: Input #1, ND, NL, NMPC- Total dof is NQNQ = NDN * NNReDim X(NN, NDIM), NOC(NE, NEN), MAT(NE), PM(NM, NPR)ReDim TH(NE), DT(NE), NU(ND), U(ND), F(NQ), MPC(NMPC, 2), BT(NMPC, 3)ReDim D(3, 3), B(3, 6), DB(3, 6), SE(6, 6), Q(6), STR(3), TL(6)= READ DATA =- CoordinatesLine Input #1, DummyFor I = 1 To NNInput #1, NFor J = 1 To NDIMInput #1, X(N, J)Next JNext I - Connectivity, Material, Thickness, Temp-changeLine Input #1, DummyFor I = 1 To NEInput #1, NFor J = 1 To NENInput #1, NOC(N, J)Next JInput #1, MAT(N), TH(N), DT(N)Next I- Displacement BCLine Input #1, DummyFor I = 1 To NDInput #1, NU(I), U(I)Next I- Component LoadsLine Input #1, DummyFor I = 1 To NLInput #1, NInput #1, F(N)Next I- Material PropertiesLine Input #1, DummyFor I = 1 To NMInput #1, NFor J = 1 To NPRInput #1, PM(N, J)Next JNext IIf NMPC 0 Then- Multi-point ConstraintsLine Input #1, Dummy For I = 1 To NMPCInput #1, BT(I, 1), MPC(I, 1), BT(I, 2), MPC(I, 2), BT(I, 3)Next IEnd IfClose #1End SubPrivate Sub Bandwidth()- Bandwidth Evaluation -For I = 1 To NENMIN = NOC(I, 1): NMAX = NOC(I, 1)For J = 2 To 3If NMIN NOC(I, J) Then NMIN = NOC(I, J)If NMAX 0 ThenS(NR, NC) = S(NR, NC) + SE(I, J)End IfNext JTNext JJF(NR) = F(NR) + TL(I) Next ITNext IINext NEnd SubPrivate Sub ModifyForBC()- Decide Penalty Parameter CNST -CNST = 0For I = 1 To NQIf CNST I2 Then IR = I2IC = Abs(I2 - I1) + 1S(IR, IC) = S(IR, IC) + CNST * BT(I, 1) * BT(I, 2)F(I1) = F(I1) + CNST * BT(I, 1) * BT(I, 3)F(I2) = F(I2) + CNST * BT(I, 2) * BT(I, 3)Next IEnd SubPrivate Sub BandSolver() - Band Solver -N1 = NQ - 1- Forward EliminationFor K = 1 To N1NK = NQ - K + 1If NK NBW Then NK = NBWFor I = 2 To NKC1 = S(K, I) / S(K, 1)I1 = K + I - 1For J = I To NKJ1 = J - I + 1S(I1, J1) = S(I1, J1) - C1 * S(K, J)Next JF(I1) = F(I1) - C1 * F(K)Next INext K- Back-substitutionF(NQ) = F(NQ) / S(NQ, 1)For KK = 1 To N1K = NQ - KKC1 = 1 / S(K, 1)F(K) = C1 * F(K)NK = NQ - K + 1If NK NBW Then NK = NBWFor J = 2 To NKF(K) = F(K) - C1 * S(K, J) * F(K + J - 1)Next JNext KKEnd SubPrivate Sub StressCalc()ReDim Stress(NE, 3), PrinStress(NE, 3), PltStress(NE) - Stress CalculationsFor N = 1 To NECall DbMat(N, 2)- Principal Stress CalculationsIf STR(3) = 0 ThenS1 = STR(1): S2 = STR(2): ANG = 0If S2 S1 ThenS1 = STR(2): S2 = STR(1): ANG = 90End IfElseC = 0.5 * (STR(1) + STR(2)R = Sqr(0.25 * (STR(1) - STR(2) 2 + (STR(3) 2)S1 = C + R: S2 = C - RIf C STR(1) ThenANG = 57.2957795 * Atn(STR(3) / (S1 - STR(1)If STR(3) 0 Then ANG = 90 - ANGIf STR(3) S1For N = 1 To NE Print #2, Format(N, );Print #2, Format(Stress(N, 1), 0.0000E+00 );Print #2, Format(Stress(N, 2), 0.0000E+00 );Print #2, Format(Stress(N, 3), 0.0000E+00 );Print #2, Format(PrinStress(N, 1), 0.0000E+00 );Print #2, Format(PrinStress(N, 2), 0.0000E+00 );Print #2, Format(PrinStress(N, 3), 0.0000E+00 )Next N- Reactions -Print #2, DOF# REACTIONFor I = 1 To NDN = NU(I)Print #2, Format(N, ); Format(React(I), 0.0000E+00)Next IClose #2picBox.Print Complete results are in file ; File2If IPL 1 ThenFile3 = InputBox(Plot Data File d:dirfileName, Name of File)Open File3 For Output As #3Print #3, Element Stress ValuesFor N = 1 To NEPrint #3, PltStress(N)Next NpicBox.Print Element Stess Data in ; File3picBox.Print Run BESTFIT and then CONTOURA or CO
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号