*create,IRCTRANS,MAC fini /SOLU ANTYPE,TRANS,NEW tweld=0 timeinc=((s_width/2/(NINT(s_width/2/ES)+1))/27)/(1/30)*NINT(1e-3/((s_width/2/(NINT(s_width/2/ES)+1))/27)) ! time increment depends on mesh size and weld size Weld_time=0.5 ! 3.12 sample width (0.1m) divided by Welding speed (1/30 m/s) + a little *DIM,valq,array,1 ! necessary to prevent Ansys from overwriting q FINI /FILNAME,THERMAL PHYSICS,READ,THERMAL,THERMAL,ph1 /SOLU *DO,q,1,NINT(Weld_time/timeinc) *CFOPEN,justq,txt ! save loop counter *VWRITE,q (F4.0) *CFCLOS ALLS tweld=q*timeinc ! calculate current time BFEDELE,ALL,HGEN ! delete all previous BFEs POWERSUPEL2,0,-s_width/2,h1+s_height/2,0,1/30,0,tweld-timeinc,1e-3 ! POWERSUPEL2 is a macro to apply HGEN to elements ! x_start,y_start,z_start,v_x,v_y,v_z,scaling factor ALLS TIME,tweld ! set time KBC,1 ! stepped HGEN BFEs SOLVE ! solve fini PHYSICS,READ,STRUCTURAL,STRUCTURAL,ph1 /FILNAME,STRUCTURAL /solu *if,q,GT,1,THEN ! restart analysis, if this not the first loop ANTYPE,,REST *ELSE *ENDIF *VREAD,valq,justq,txt ! get loop counter value (F5.0) q=valq(1) tweld=q*timeinc ! calculate weld time ESEL,ALL $ NSEL,ALL LDREAD,TEMP,LAST,,,,THERMAL,rth ! read THERMAL Model solutions NSEL,S,LOC,X,0,5e-3 $ NSEL,R,LOC,Y,-s_width/2+1/30*(tweld-timeinc)-15e-3,-s_width/2+1/30*(tweld-timeinc)+10e-3 LOWERTEMP,1500 ! cut off temperature is 1500°C ALLS KBC,0 ! ramp loads TIME,tweld ! assign time SOLVE ! solve model FINI *IF,q,LT,NINT(Weld_time/timeinc),THEN ! restart analysis if this is not the last time step /FILNAME,THERMAL PHYSICS,READ,THERMAL,THERMAL,ph1 /SOLU ANTYPE,,REST *VREAD,valq,justq,txt (F5.0) q=valq(1) *ENDIF *ENDDO *END