General Mechanical

General Mechanical

Do ANSYS MECHANICAL overwrites multiple command snippets and only execute the last one in hierarchy?

    • Abdullah2021
      Subscriber
      I am trying to simulate a welding process and I want multiple moving heat sources. I can successfully execute the single moving source but when i duplicate the same file for another moving source but with different parameters) I get a single source.n[Note that for second source I assigned the value of 60 seconds as time lag. (value of Tau in below code).]n!!n!  Commands inserted into this file will be executed just prior to the ANSYS SOLVE command.n!  These commands may supersede command settings set by Workbench.nn!  Active UNIT system in Workbench when this object was created: Metric (m, kg, N, s, V, A)n!  NOTE: Any data that requires units (such as mass) is assumed to be in the consistent solver unit system.n!        See Solving Units in the help system for more information.nCMSEL,ALLn*GET,EMAX,ELEM,,NUM,MAXn*GET,EMIN,ELEM,,NUM,MINnALLSELnAUTOTS,ONnTIME_WELD=60nDT=1 ! Time stepnA=0.002932nB=0.002nC1=0.00381nC2=0.07622 !A, B AND C ARE JUST THE HEAT SOURCE DIMENSIONSnTAU=0 !TIME DELAYnFF=0.6 !FRACTION OF HEAT ON THE FRONT PART OF THE HEAT SOURCEnFR=1.4 !FRACTION OF HEAT ON THE REAR PART OF THE HEAT SOURCEnQ=1080 !WELDING ENERGY J/S (W)nVEL=0.005 !WELDING SPEEDn!!EE=2.71 !I HAD TO DEFINE THE EULER NUMBER AS 2.71 INSTEAD OF USING exp() DUE TO UNSTABILITIES ON MY RESULTSnNPT=TIME_WELD/DTnNROPT, FULLn*DO,i,1,NPT,1 !TIME INCREMENTnWTIME=(i)nTIME,WTIMEnHCENTER=VEL*WTIME !HEAT SOURCE CENTERn*DO,jj,EMIN,EMAX,1 !SELECTS THE CENTROID OF EVERY ELEMENTnX=CENTRX(jj)nY=CENTRY(jj)nZ=CENTRZ(jj)nCSI=-Z+(VEL*(TAU-WTIME)) !MOVING COORDINATE (IT MOVES THROUGH Z AS TIME PASSESn*IF,Z,GT,HCENTER,THEN !DEFINES WHETHER IT'S THE FRONT PART OF THE HEAT SOURCE OR THE REAR PARTnC=C1nF=FFn*ELSEnC=C2nF=FRn*ENDIFnPART1=(6*(3**0.5)*Q*F)/(C*A*B*3.14*(3.14**0.5))nPART2=(Exp(-3*(X/A)**2))*(Exp(-3*(Y/B)**2))*(Exp(-3*((CSI/C)**2)))nQF=PART1*PART2 !HEAT SOURCE EQUATIONnBFE,jj,HGEN,,QFn*ENDDOnALLSELnSOLVEn*ENDDOnCMSEL,ALLnBFEDELE,ALL,ALLnn
    • Abdullah2021
      Subscriber

      I am trying to simulate a welding process and I want multiple moving heat sources. I can successfully execute the single moving source but when i duplicate the same file for another moving source but with different parameters) I get a single source.[Note that for second source I assigned the value of 60 seconds as time lag. (value of "Tau" in below code).]!!!  Commands inserted into this file will be executed just prior to the ANSYS SOLVE command.!  These commands may supersede command settings set by Workbench.!  Active UNIT system in Workbench when this object was created: Metric (m, kg, N, s, V, A)!  NOTE: Any data that requires units (such as mass) is assumed to be in the consistent solver unit system.!        See Solving Units in the help system for more information.CMSEL,ALL*GET,EMAX,ELEM,,NUM,MAX*GET,EMIN,ELEM,,NUM,MINALLSELAUTOTS,ONTIME_WELD=60DT=1 ! Time stepA=0.002932B=0.002C1=0.00381C2=0.07622 !A, B AND C ARE JUST THE HEAT SOURCE DIMENSIONSTAU=0 !TIME DELAYFF=0.6 !FRACTION OF HEAT ON THE FRONT PART OF THE HEAT SOURCEFR=1.4 !FRACTION OF HEAT ON THE REAR PART OF THE HEAT SOURCEQ=1080 !WELDING ENERGY J/S (W)VEL=0.005 !WELDING SPEED!!EE=2.71 !I HAD TO DEFINE THE EULER NUMBER AS 2.71 INSTEAD OF USING exp() DUE TO UNSTABILITIES ON MY RESULTSNPT=TIME_WELD/DTNROPT, FULL*DO,i,1,NPT,1 !TIME INCREMENTWTIME=(i)TIME,WTIMEHCENTER=VEL*WTIME !HEAT SOURCE CENTER*DO,jj,EMIN,EMAX,1 !SELECTS THE CENTROID OF EVERY ELEMENTX=CENTRX(jj)Y=CENTRY(jj)Z=CENTRZ(jj)CSI=-Z+(VEL*(TAU-WTIME)) !MOVING COORDINATE (IT MOVES THROUGH Z AS TIME PASSES*IF,Z,GT,HCENTER,THEN !DEFINES WHETHER IT'S THE FRONT PART OF THE HEAT SOURCE OR THE REAR PARTC=C1F=FF*ELSEC=C2F=FR*ENDIFPART1=(6*(3**0.5)*Q*F)/(C*A*B*3.14*(3.14**0.5))PART2=(Exp(-3*(X/A)**2))*(Exp(-3*(Y/**2))*(Exp(-3*((CSI/C)**2)))QF=PART1*PART2 !HEAT SOURCE EQUATIONBFE,jj,HGEN,,QF*ENDDOALLSELSOLVE*ENDDOCMSEL,ALLBFEDELE,ALL,ALLhttps://forum.ansys.com/discussion/25638/do-ansys-mechanical-overwrites-multiple-command-snippets-and-only-execute-the-last-one-in-hierarchy

      Edit: Value of Tau(time lag) in second snippet would be 30 s not 60 s.n
Viewing 1 reply thread
  • You must be logged in to reply to this topic.