实用文档ANSYS应用——m法计算桩基时模拟桩与土作用的命令流!z1spring1.mac/PREP7WPCSYS,-1!工作平面恢复到默认状态CSYS,0dpile1=1.5!桩直径*****allsel,allcmsel,s,znsll,s,1NSEL,r,LOC,Z,-5-5-5.36,-6-5-5.36!建立泥面以下桩的节点集合CM,SPNODE1,NODEallsel,all,allcmsel,s,znsll,s,1NSEL,r,LOC,Z,-6-5-5.36,-20-5-5.36CM,SPNODE2,NODEallsel,all,allcmsel,s,znsll,s,1NSEL,r,LOC,Z,-20-5-5.36,-25-5-5.36CM,SPNODE3,NODEallsel,all,allcmsel,s,znsll,s,1NSEL,r,LOC,Z,-25-5-5.36,-27-5-5.36CM,SPNODE4,NODEallsel,all,allcmsel,s,znsll,s,1NSEL,r,LOC,Z,-27-5-5.36,-31-5-5.36CM,SPNODE5,NODEallsel,all,all!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!spring1/PREP7CMSEL,S,SPNODE1!选择泥面以下,桩的节点集合*GET,enum,ELEM,,COUNT,,,,*GET,NNUM,NODE,0,COUNT,*GET,nmin,NODE,0,num,min,实用文档*DiM,AA1,ARRAY,NNUM*DiM,AA2,ARRAY,NNUM*DiM,AA3,ARRAY,NNUMCMSEL,S,SPNODE1*do,i,1,nnumAA1(i)=NMINnmin=ndnext(nmin)*enddo!给集合AA1赋值*do,i,1,nnumNSEL,S,,,AA1(i)ESLN,S*GET,emin,ELEM,0,num,min!获取最小的单元编号n1=NELEM(emin,1)n2=NELEM(emin,2)Z12=NZ(N1)-NZ(N2)X12=NX(N1)-NX(N2)*IF,(Z12*X12),GE,0,THENSIG=1*ELSESIG=-1*ENDIFZ12=ABS(Z12)L12=DISTND(N1,N2)CLI=TAN(ACOS(Z12/L12))NGEN,2,100000,AA1(I),,,-1,,1*CLI*SIGNGEN,2,200000,AA1(I),,,,1AA2(i)=AA1(i)+100000AA3(i)=AA1(i)+200000TYPE,3!将单元赋为弹簧单元,为etsp单元类型,见begin!MAT,mpsp!mpsp为材料号,见beginESYS,0R,enum+i,8000*(-10-5.36-NZ(AA1(I)))*(L12)*dpile1,!根据M法给弹簧赋予刚度,其中zlsize为桩单元长!!REAL,enum+ie,AA1(I),AA2(I)实用文档e,AA1(I),AA3(I)*enddo/SOLALLSEL,ALL*do,i,1,NNUMD,AA2(i),allD,AA3(i),all*ENDDO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!spring1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!spring2/PREP7CMSEL,S,SPNODE2!选择泥面以下,桩的节点集合*GET,enum,ELEM,,COUNT,,,,*GET,NNUM,NODE,0,COUNT,*GET,nmin,NODE,0,num,min,*DiM,AA1,ARRAY,NNUM*DiM,AA2,ARRAY,NNUM*DiM,AA3,ARRAY,NNUMCMSEL,S,SPNODE2*do,i,1,nnumAA1(i)=NMINnmin=ndnext(nmin)*enddo!给集合AA1赋值*do,i,1,nnumNSEL,S,,,AA1(i)ESLN,S*GET,emin,ELEM,0,num,min!获取最小的单元编号n1=NELEM(emin,1)n2=NELEM(emin,2)Z12=NZ(N1)-NZ(N2)X12=NX(N1)-NX(N2)*IF,(Z12*X12),GE,0,THENSIG=1*ELSESIG=-1*ENDIFZ12=ABS(Z12)L12=DISTND(N1,N2)实用文档CLI=TAN(ACOS(Z12/L12))NGEN,2,100000,AA1(I),,,-1,,1*CLI*SIGNGEN,2,200000,AA1(I),,,,1AA2(i)=AA1(i)+100000AA3(i)=AA1(i)+200000TYPE,3!将单元赋为弹簧单元,为etsp单元类型,见begin!MAT,mpsp!mpsp为材料号,见beginESYS,0R,enum+i,4500*(-10-5.36-NZ(AA1(I)))*(L12)*dpile1,!根据M法给弹簧赋予刚度,其中zlsize为桩单元长!!REAL,enum+ie,AA1(I),AA2(I)e,AA1(I),AA3(I)*enddo/SOLALLSEL,ALL*do,i,1,NNUMD,AA2(i),allD,AA3(i),all*ENDDO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!spring2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!spring3/PREP7CMSEL,S,SPNODE3!选择泥面以下,桩的节点集合*GET,enum,ELEM,,COUNT,,,,*GET,NNUM,NODE,0,COUNT,*GET,nmin,NODE,0,num,min,*DiM,AA1,ARRAY,NNUM*DiM,AA2,ARRAY,NNUM*DiM,AA3,ARRAY,NNUMCMSEL,S,SPNODE3*do,i,1,nnumAA1(i)=NMINnmin=ndnext(nmin)*enddo!给集合AA1赋值实用文档*do,i,1,nnumNSEL,S,,,AA1(i)ESLN,S*GET,emin,ELEM,0,num,min!获取最小的单元编号n1=NELEM(emin,1)n2=NELEM(emin,2)Z12=NZ(N1)-NZ(N2)X12=NX(N1)-NX(N2)*IF,(Z12*X12),GE,0,THENSIG=1*ELSESIG=-1*ENDIFZ12=ABS(Z12)L12=DISTND(N1,N2)CLI=TAN(ACOS(Z12/L12))NGEN,2,100000,AA1(I),,,-1,,1*CLI*SIGNGEN,2,200000,AA1(I),,,,1AA2(i)=AA1(i)+100000AA3(i)=AA1(i)+200000TYPE,3!将单元赋为弹簧单元,为etsp单元类型,见begin!MAT,mpsp!mpsp为材料号,见beginESYS,0R,enum+i,10000*(-10-5.36-NZ(AA1(I)))*(L12)*dpile1,!根据M法给弹簧赋予刚度,其中zlsize为桩单元长!!REAL,enum+ie,AA1(I),AA2(I)e,AA1(I),AA3(I)*enddo/SOLALLSEL,ALL*do,i,1,NNUMD,AA2(i),allD,AA3(i),all*ENDDO实用文档!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!spring3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!spring4/PREP7CMSEL,S,SPNODE4!选择泥面以下,桩的节点集合*GET,enum,ELEM,,COUNT,,,,*GET,NNUM,NODE,0,COUNT,*GET,nmin,NODE,0,num,min,*DiM,AA1,ARRAY,NNUM*DiM,AA2,ARRAY,NNUM*DiM,AA3,ARRAY,NNUMCMSEL,S,SPNODE3*do,i,1,nnumAA1(i)=NMINnmin=ndnext(nmin)*enddo!给集合AA1赋值*do,i,1,nnumNSEL,S,,,AA1(i)ESLN,S*GET,emin,ELEM,0,num,min!获取最小的单元编号n1=NELEM(emin,1)n2=NELEM(emin,2)Z12=NZ(N1)-NZ(N2)X12=NX(N1)-NX(N2)*IF,(Z12*X12),GE,0,THENSIG=1*ELSESIG=-1*ENDIFZ12=ABS(Z12)L12=DISTND(N1,N2)CLI=TAN(ACOS(Z12/L12))NGEN,2,100000,AA1(I),,,-1,,1*CLI*SIGNGEN,2,200000,AA1(I),,,,1AA2(i)=AA1(i)+100000AA3(i)=AA1(i)+200000实用文档TYPE,3!将单元赋为弹簧单元,为etsp单元类型,见begin!MAT,mpsp!mpsp为材料号,见beginESYS,0R,enum+i,20000*(-10-5.36-NZ(AA1(I)))*(L12)*dpile1,!根据M法给弹簧赋予刚度,其中zlsize为桩单元长!!REAL,enum+ie,AA1(I),AA2(I)e,AA1(I),AA3(I)*enddo/SOLALLSEL,ALL*do,i,1,NNUMD,AA2(i),allD,AA3(i),all*ENDDO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!spring4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!spring5/PREP7CMSEL,S,SPNODE5!选择泥面以下,桩的节点集合*GET,enum,ELEM,,COUNT,,,,*GET,NNUM,NODE,0,COUNT,*GET,nmin,NODE,0,num,min,*DiM,AA1,ARRAY,NNUM*DiM,AA2,ARRAY,NNUM*DiM,AA3,ARRAY,NNUMCMSEL,S,SPNODE3*do,i,1,nnumAA1(i)=NMINnmin=ndnext(nmin)*enddo!给集合AA1赋值*do,i,1,nnumNSEL,S,,,AA1(i)ESLN,S*GET,emin,ELEM,0,num,min!获取最小的单元编号n1=NELEM(emin,1)n2=NELEM(emin,2)实用文档Z12=NZ(N1)-NZ(N2)X12=NX(N1)-NX(N2)*IF,(Z12*X12),GE,0,THENSIG=1*ELSESIG=-1*ENDIFZ12=ABS(Z12)L12=DISTND(N1,N2)CLI=TAN(ACOS(Z12/L12))NGEN,2,100000,AA1(I),,,-1,,1*CLI*SIGNGEN,2,200000,AA1(I),,,,1AA2(i)=AA1(i)+100000AA3(i)=AA1(i)+200000TYPE,3!将单元赋为弹簧单元,为etsp单元类型,见begin!MAT,mpsp!mpsp为材料号,见beginESYS,0R,enum+i,30000*(-10-5.36-NZ(AA1(I)))*(L12)*dpile1,!根据M法给弹簧赋予刚度,其中zlsize为桩单元长!!REAL,enum+ie,AA1(I),AA2(I)e,AA1(I),AA3(I)*enddo/SOLALLSEL,ALL*do,i,1,NNUMD,AA2(i),allD,AA3(i),al