DFLUX Subroutine - Change direction of my heat source during a specific step
| Newsgroups | gmane.comp.mathematics.abaqus.user |
|---|---|
| Message-ID | <[email protected]> |
Dear Abaqus Users,
I'm currently facing a problem with my subroutine program. I modelize the direct metal deposite process by using a goldak flux. My source need to go one way during an amount of step, then stop during one step and go back were it started. I was able to stop my source but the way back seems to don't work.. Can someone tell me how to fix it ?
This is my code :
X0a
Y0a
Z0a
welding torch updated position
X1a = X0a
Y1a = Y0a
Z1a = Z0a + V*TIME(2)
! node of interest
Xa = COORDS(1)-X1a
Ya = COORDS(2)-Y1a
Za = COORDS(3)-Z1a
initial position where the second path will start
X0r
Y0r
Z0r
! welding torch updated position (way back)
X1r = X0r
Y1r = Y0r
Z1r = Z0r - V*TIME(2)
! node of interest
Xr = COORDS(1)-X1r
Yr = COORDS(2)-Y1r
Zr = COORDS(3)-Z1r
squareDista = Xa**2 + Ya**2 + Za**2
squareDistr = Xr**2 + Yr**2 + Zr**2
if (KSTEP.LT.5) then
if (squareDista.LT.1e-4) then
Qbool = 1
if (Za.GE.0.) then
c = a
f = 0.6
else
c = 4.*a
f = 1.4
endif
Q1 = 6.*SQRT(3.)*Qw*eta*f/(a*b*c*PI*SQRT(PI))
Q2 = EXP(-(3.*Xa**2/a**2 + 3.*Ya**2/b**2 + 3.*Za**2/c**2))
Q = Q1*Q2
endif
FLUX(1) = Q*Qbool
elseif (KSTEP.EQ.5) then
FLUX(1) = 0
elseif (KSTEP.GT.5) then
if (squareDistr.LT.1.0) then
Qbool = 1
if (Zr.GE.0.) then
c = a
f = 0.6
else
c = 4.*a
f = 1.4
endif
Q1 = 6.*SQRT(3.)*Qw*eta*f/(a*b*c*PI*SQRT(PI))
Q2 = EXP(-(3.*Xr**2/a**2 + 3.*Yr**2/b**2 + 3.*Zr**2/c**2))
Q = Q1*Q2
endif
FLUX(1) = Q*Qbool
else
FLUX(1)=0
endif
RETURN
END