General Mechanical

General Mechanical

Trying to create local cylindrical co-ordinate

    • mawdc
      Subscriber

      Hi,


      I am generating a model in a cylindrical co-ordinate where a LASER will be rotated along the circumference of a cylinder. I am using global cylindrical co-ordinate and later on, I am using local cylindrical co-ordinate by using 'CLOCAL' command. But the issue is after creating local cylindrical co-ordinate (in my code it's 1003), the local 'r' (which should be in the global x-axis direction), local 'theta' (which should be in the global y-axis direction) and local 'z' (which should be in the global z-axis direction) are not in the right direction. Can anyone help me how to get rid of this issue? I am also attaching my code here for your convenience. 

    • Keyur Kanade
      Ansys Employee

      As ANSYS Staff, we can not download attachments. Please insert images using insert image functionality. 

    • mawdc
      Subscriber

       I apologize. I didn't know that. Here I pasted my code. 


       


      /BATCH 


      /COM,ANSYS RELEASE Release 18.1      BUILD 18.1      UP20170403       16:01:53  


      /input,menust,tmp,''


      /GRA,POWER  


      /GST,ON 


      /PLO,INFO,3 


      /GRO,CURL,ON


      /CPLANE,1   


      /REPLOT,RESIZE  


      WPSTYLE,,,,,,,,0


      CSYS,1  


      /PREP7  


      !*  


      ET,1,SOLID70


      !*  


      !*  


      MPTEMP,,,,,,,,  


      MPTEMP,1,0  


      MPDATA,DENS,1,,3150 


      !*  


      MPTEMP,,,,,,,,  


      MPTEMP,1,314.87 


      MPTEMP,2,424.48 


      MPTEMP,3,523.14 


      MPTEMP,4,627.28 


      MPTEMP,5,747.87 


      MPTEMP,6,879.42 


      MPTEMP,7,1003.67


      MPTEMP,8,1133.41


      MPTEMP,9,1255.83


      MPTEMP,10,1380.09   


      MPTEMP,11,1508.01   


      MPTEMP,12,1690.74   


      MPDATA,KXX,1,,26.91 


      MPDATA,KXX,1,,25.28 


      MPDATA,KXX,1,,23.89 


      MPDATA,KXX,1,,22.49 


      MPDATA,KXX,1,,21.08 


      MPDATA,KXX,1,,19.45 


      MPDATA,KXX,1,,18.16 


      MPDATA,KXX,1,,16.99 


      MPDATA,KXX,1,,15.70 


      MPDATA,KXX,1,,14.65 


      MPDATA,KXX,1,,13.70 


      MPDATA,KXX,1,,12.18 


      !*  


      MPTEMP,,,,,,,,  


      MPTEMP,1,300


      MPTEMP,2,442.18 


      MPTEMP,3,697.75 


      MPTEMP,4,930.26 


      MPTEMP,5,1163.95


      MPTEMP,6,1426.92


      MPTEMP,7,1548.32


      MPDATA,C,1,,670 


      MPDATA,C,1,,892.68  


      MPDATA,C,1,,1064.41 


      MPDATA,C,1,,1169.25 


      MPDATA,C,1,,1250.13 


      MPDATA,C,1,,1324.81 


      MPDATA,C,1,,1347.84 


      !*  


      !*  


      !*  


      !*  


      CYL4,0,0,.002,0,.008,90,.0155   


      CYL4,0,0,.002,90,.008,180,.0155 


      CYL4,0,0,.002,180,.008,270,.0155


      CYL4,0,0,.002,270,.008,360,.0155


      *SET,R1,0.008   


      *SET,R2,0.002   


      *SET,L,0.0155   


      *SET,HF1,81023680.76


      *SET,HF2,99085009.86


      *SET,HF3,118625556.3


      *SET,HF4,89323956.93


      *SET,HF5,40533046.96


      *SET,HF6,12545214.05


      *SET,HF7,1  


      *SET,T20,0.00666


      *SET,FR,0.0001  


      FLST,2,4,6,ORDE,2   


      FITEM,2,1   


      FITEM,2,-4  


      VGLUE,P51X  


      /VIEW,1,1,1,1   


      /ANG,1  


      /REP,FAST   


      LPLOT   


      FLST,5,16,4,ORDE,6  


      FITEM,5,2   


      FITEM,5,4   


      FITEM,5,-5  


      FITEM,5,7   


      FITEM,5,49  


      FITEM,5,-60 


      CM,_Y,LINE  


      LSEL, , , ,P51X 


      CM,_Y1,LINE 


      CMSEL,,_Y   


      !*  


      LESIZE,_Y1, , ,9, , , , ,1 


      !*  


      FLST,5,8,4,ORDE,8   


      FITEM,5,1   


      FITEM,5,3   


      FITEM,5,6   


      FITEM,5,8   


      FITEM,5,15  


      FITEM,5,18  


      FITEM,5,27  


      FITEM,5,30  


      CM,_Y,LINE  


      LSEL, , , ,P51X 


      CM,_Y1,LINE 


      CMSEL,,_Y   


      !*  


      LESIZE,_Y1, , ,10, , , , ,1 


      !*  


      FLST,5,6,4,ORDE,4   


      FITEM,5,3   


      FITEM,5,9   


      FITEM,5,-12 


      FITEM,5,33  


      CM,_Y,LINE  


      LSEL, , , ,P51X 


      CM,_Y1,LINE 


      CMSEL,,_Y   


      !*  


      FLST,5,8,4,ORDE,6   


      FITEM,5,9   


      FITEM,5,-12 


      FITEM,5,21  


      FITEM,5,23  


      FITEM,5,33  


      FITEM,5,35  


      CM,_Y,LINE  


      LSEL, , , ,P51X 


      CM,_Y1,LINE 


      CMSEL,,_Y   


      !*  


      LESIZE,_Y1, , ,12, , , , ,1 


      !*  


      MSHAPE,0,3D 


      MSHKEY,1


      !*  


      FLST,5,4,6,ORDE,3   


      FITEM,5,1   


      FITEM,5,5   


      FITEM,5,-7  


      CM,_Y,VOLU  


      VSEL, , , ,P51X 


      CM,_Y1,VOLU 


      CHKMSH,'VOLU'   


      CMSEL,S,_Y  


      !*  


      VMESH,_Y1   


      !*  


      CMDELE,_Y   


      CMDELE,_Y1  


      CMDELE,_Y2  


      !*  


      FINISH  


      ! /EXIT,ALL 


       


       


      /SOL


      !*  


      ANTYPE,4                      


      !*  


      TRNOPT,FULL 


      LUMPM,0 


      !*  


      OUTRES,ERASE            


      OUTRES,ALL,NONE      


      OUTRES,NSOL,LAST,,


        


      TUNIF,298,  


        


       


      TIME_NOW=0    


      K=0    


      V=0


       


      FLST,5,2,5,ORDE,2   


      FITEM,5,3   


      FITEM,5,31  


      ASEL,S, , ,P51X 


      NSLA,S,1


       


       


       


       


      *DO,N,1,42,+1   


      *SET,M,1


      *DO,M,1,36,+1   


      *SET,I,(M-1)*20 


      NSEL,ALL


      NSEL,S,EXT  


      SF,ALL,CONV,30,298  


      NSEL,ALL


      NSEL,S,EXT  


      CSYS,1  


      NSEL,R,LOC,Y,I-40,I+60,1


      NSEL,U,LOC,X,0,0,-0.0079 


      CLOCAL,1003,CYLIN,.008,M*10,((V*FR)+0.0147),0,0,180 


      NSEL,R,LOC,X,0,0.000233 


      SFDELE,ALL,CONV 


      SF,ALL,HFLUX,HF1


       


       


      NSEL,ALL


      NSEL,S,EXT  


      CSYS,1   


      NSEL,R,LOC,Y,I-40,I+60,1


      NSEL,U,LOC,X,0,0,0.0079


      CLOCAL,1004,CYLIN,.008,M*20,((V*FR)+0.0147),0,0,180 


      NSEL,R,LOC,X,0.000233,0.000467  


      SFDELE,ALL,CONV 


      SF,ALL,HFLUX,HF2


       


       


      NSEL,ALL


      NSEL,S,EXT  


      CSYS,1   


      NSEL,R,LOC,Y,I-40,I+60,1


      NSEL,U,LOC,X,0,0,0.0079


      CLOCAL,1005,CYLIN,.008,M*30,((V*FR)+0.0147),0,0,180


      NSEL,R,LOC,X,0.000467,0.0007


      SFDELE,ALL,CONV 


      SF,ALL,HFLUX,HF3


       


       


      NSEL,ALL


      NSEL,S,EXT  


      CSYS,1  


      NSEL,R,LOC,Y,I-40,I+60,1


      NSEL,U,LOC,X,0,0,0.0079 


      CLOCAL,1006,CYLIN,.008,M*40,((V*FR)+0.0147),0,0,180


      NSEL,R,LOC,X,0.0007,0.000933


      SFDELE,ALL,CONV 


      SF,ALL,HFLUX,HF4


       


       


      NSEL,ALL


      NSEL,S,EXT  


      CSYS,1   


      NSEL,R,LOC,Y,I-40,I+60,1


      NSEL,U,LOC,X,0,0,0.0079 


      CLOCAL,1007,CYLIN,.008,M*50,((V*FR)+0.0147),0,0,180 


      NSEL,R,LOC,X,0.000933,0.001167  


      SFDELE,ALL,CONV 


      SF,ALL,HFLUX,HF5


       


       


      NSEL,ALL


      NSEL,S,EXT  


      CSYS,1   


      NSEL,R,LOC,Y,I-40,I+60,1


      NSEL,U,LOC,X,0,0,0.0079


      CLOCAL,1008,CYLIN,.008,M*60,((V*FR)+0.0147),0,0,180


      NSEL,R,LOC,X,0.001167,0.0014


      SFDELE,ALL,CONV 


      SF,ALL,HFLUX,HF6


       


       


      NSEL,ALL


      NSEL,S,EXT  


      CSYS,1   


      NSEL,R,LOC,Y,I-40,I+60,1


      NSEL,U,LOC,X,0,0,0.0079 


      CLOCAL,1009,CYLIN,.008,M*70,((V*FR)+0.0147),0,0,180


      NSEL,R,LOC,X,0.0014,0.00141 


      SFDELE,ALL,CONV 


      SF,ALL,HFLUX,HF7


       


       


      KBC,1   


      *SET,TIME_NOW,TIME_NOW+T20  


      TIME,TIME_NOW   


      AUTOTS,ON   


      DELTIM,T20/5, T20/10, T20/2, ON


       


       


      ALLSEL,ALL  


      SOLVE   


      SFDELE,ALL,ALL  


      ALLSEL,ALL  


      CSDELE,1003 


      CSDELE,1004 


      CSDELE,1005 


      CSDELE,1006 


      CSDELE,1007 


      CSDELE,1008 


      CSDELE,1009 


      !M=M+1  


      *ENDDO  


      *ENDDO 


       

Viewing 2 reply threads
  • You must be logged in to reply to this topic.