skadi1
Mechanical
- Jun 4, 2011
- 5
hi
at first excuse me for my poor english
I want to use subroutine to model a simple moving heat source
But there is some problem in this fortran code,
please help me to find out why it's not working and what is my problem
*USER SUBROUTINE
SUBROUTINE DFLUX(FLUX,SOL,KSTEP,KINC,TIME,NOEL,NPT,COORDS,
1 JLTYP,TEMP,PRESS,SNAME)
include 'ABA_PARAM.INC'
DIMENSION FLUX(2),TIME(2),COORDS(3)
CHARACTER*80 SNAME
REAL t,x,y,z,Q,a,b,c
Real x1,y1,z1,x2,y2,z2
REAL FLUX1,FLUX2
t = time(1)
! coordinate
x = coords(1)
y = coords(2)
z = coords(3)
! welding arc
a = 0.0033
b = 0.0033
c = 0.0033
! speed of welding in y direction is 0.0076
x1 = 0
y1 = 0+0.0076*t
z1 = 0
x2=x-x1
y2=y-y1
z2=z-z1
! Q=n*V*i
Q=9900
! a welding simulation in the midle of a plate 0.03*0.2*0.3
if(jltyp.eq.1) then
if(KSTEP.EQ.3) then
IF(y2.GE.0) then
! Goldak’s volumetric heat source model
FLUX(1)=1.86632*Q/(a*b*c)*exp(-3*(x**2/a**2+y**2/b**2+z**2/c**2))
ELSE
IF(y2.LE.0) then
FLUX(1)=1.86632*Q/(a*b*c)*exp(-3*(x**2/a**2+y**2/b**2+z**2/c**2))
end if
FLUX(1)=0
FLUX(2)=0.0
Else
FLUX1=0
FLUX(1)=FLUX1
FLUX(2)=0
end if
else
FLUX(1)=0
FLUX(2)=0
end if
return
end
at first excuse me for my poor english
I want to use subroutine to model a simple moving heat source
But there is some problem in this fortran code,
please help me to find out why it's not working and what is my problem
*USER SUBROUTINE
SUBROUTINE DFLUX(FLUX,SOL,KSTEP,KINC,TIME,NOEL,NPT,COORDS,
1 JLTYP,TEMP,PRESS,SNAME)
include 'ABA_PARAM.INC'
DIMENSION FLUX(2),TIME(2),COORDS(3)
CHARACTER*80 SNAME
REAL t,x,y,z,Q,a,b,c
Real x1,y1,z1,x2,y2,z2
REAL FLUX1,FLUX2
t = time(1)
! coordinate
x = coords(1)
y = coords(2)
z = coords(3)
! welding arc
a = 0.0033
b = 0.0033
c = 0.0033
! speed of welding in y direction is 0.0076
x1 = 0
y1 = 0+0.0076*t
z1 = 0
x2=x-x1
y2=y-y1
z2=z-z1
! Q=n*V*i
Q=9900
! a welding simulation in the midle of a plate 0.03*0.2*0.3
if(jltyp.eq.1) then
if(KSTEP.EQ.3) then
IF(y2.GE.0) then
! Goldak’s volumetric heat source model
FLUX(1)=1.86632*Q/(a*b*c)*exp(-3*(x**2/a**2+y**2/b**2+z**2/c**2))
ELSE
IF(y2.LE.0) then
FLUX(1)=1.86632*Q/(a*b*c)*exp(-3*(x**2/a**2+y**2/b**2+z**2/c**2))
end if
FLUX(1)=0
FLUX(2)=0.0
Else
FLUX1=0
FLUX(1)=FLUX1
FLUX(2)=0
end if
else
FLUX(1)=0
FLUX(2)=0
end if
return
end