Do ANSYS MECHANICAL overwrites multiple command snippets and only execute the last one in hierarchy?
-
-
March 13, 2021 at 8:15 am
Abdullah2021
SubscriberI 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/**2))*(Exp(-3*((CSI/C)**2)))nQF=PART1*PART2 !HEAT SOURCE EQUATIONnBFE,jj,HGEN,,QFn*ENDDOnALLSELnSOLVEn*ENDDOnCMSEL,ALLnBFEDELE,ALL,ALLnn
-
March 13, 2021 at 9:17 am
Abdullah2021
SubscriberI 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
-
- You must be logged in to reply to this topic.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Saving & sharing of Working project files in .wbpz format
- An Unknown error occurred during solution. Check the Solver Output…..
- Understanding Force Convergence Solution Output
- Solver Pivot Warning in Beam Element Model
- Colors and Mesh Display
- How to calculate the residual stress on a coating by Vickers indentation?
- whether have the difference between using contact and target bodies
- What is the difference between bonded contact region and fixed joint
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- User manual
-
2630
-
2104
-
1327
-
1110
-
461
© 2023 Copyright ANSYS, Inc. All rights reserved.