General Mechanical

General Mechanical

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

    • Abdullah2021
      Subscriber
      Hi there!nHope Everyone is doing fine.nI am a student conducting arc welding simulation in ANSYS. The voltage: V = 24 volt, Current I = 75 Amp and efficiency = 0.6. Plate Dimensions are 300 x 300 x 2 mm****3 . I am implementing goldak heat source model(ref:
      " target='blank'>
      ). nThe code is as follows:nCommands inserted into this file will be executed just prior to the ANSYS SOLVE command.n! These commands may supersede command settings set by Workbench.n! Active UNIT system in Workbench when this object was created: Metric (mm, kg, N, s, mV, mA)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,MINnALLSELnTIME_WELD=60nDT=1nA=2.9315nB=2nC1=3.81nC2=7.622nTAU=0nFF=0.6nFR=1.4nQ=1080nVEL=5nNPT=TIME_WELD/DTnNROPT, FULLn*DO,i,1,NPT,1nWTIME=(i)nTIME,WTIMEnHCENTER=VEL*WTIMEn*DO,jj,EMIN,EMAX,1nX=CENTRX(jj)nY=CENTRY(jj)nZ=CENTRZ(jj)nCSI=-Z+VEL*(TAU-WTIME)n*IF,Z,GT,HCENTER,THENnC=C1nF=FFn*ELSEnC=C2nF=FRn*ENDIFnPART1=(6*(3**0.5)*F*Q)/(A*B*C*3.14*(3.14**0.5))nPART2=(exp(-3*(X/A)**2))*(exp(-3*(Y/B)**2))*(exp(-3*(CSI/C)**2))nQF=PART1*PART2nBFE,jj,HGEN,,QFn*ENDDOnALLSELnSOLVEn*ENDDOnCMSEL,ALLnBFEDELE,ALL,ALLnnSo, I have simulated moving welding source using the above code but now I want to have Trailing Heat Sink moving behind the welding source. For Starters, I duplicated the command snippet containing the above code and modified it by assigning time lag of 30s(value of Tau above) and ran the code. However, the results showed no second moving source and it seemed that all the command snippets in the hierarchy expect the last one were ignored. nPlease guide in this matter.nThanks.n
  • BenjaminStarling
    Subscriber
    Your command snippet has the solve command, and the loop inside it. Therefore if you create another command snippet, it won't be included in the loop, or in the solve. You need to integrate the two bits of code such that they exist together within the loop, and before the solve command.n
  • Abdullah2021
    Subscriber

    Your command snippet has the solve command, and the loop inside it. Therefore if you create another command snippet, it won't be included in the loop, or in the solve. You need to integrate the two bits of code such that they exist together within the loop, and before the solve command.https://forum.ansys.com/discussion/comment/110971#Comment_110971

    OK. I will try that. Thanks.n
  • Viewing 2 reply threads
    • You must be logged in to reply to this topic.