anto_772
Mechanical
- Jul 19, 2018
- 7
Hi guys, I'm trying to develop a USDFLD subroutine for a coupled thermal-electrical analysis. The goal of the subroutine is to determinate the decomposition grade as a function of the temperature of a composite. It seems to be easy but I am having some problems.
The grade of decomposition ''C''(DAMAGE) is calculate as follow:
D = (T-Ti)/(Tf-Ti), where Ti=573K and Tf=873K (Range of matrix decomposition temperature). T is the temperature at the current time increment
The thing is that it's the first time I develop a subroutine and I think I might be doing some mistakes, since abaqus cant compile it.
I'm just trying to set up a condition in which each node remains with the greater decomposition grade through the total step time.
I also want to plot the distribution of this grade of decomposition over my model.Please if someone is familiar to this type of subroutine and can check it out...
SUBROUTINE USDFLD(FIELD,STATEV,PNEWDT,DIRECT,T,CELENT,
1 TIME,DTIME,CMNAME,ORNAME,NFIELD,NSTATV,NOEL,NPT,LAYER,
2 KSPT,KSTEP,KINC,NDI,NSHR,COORD,JMAC,JMATYP,MATLAYO,LACCFLA)
C
INCLUDE 'ABA_PARAM.INC'
C
CHARACTER*80 CMNAME,ORNAME
CHARACTER*3 FLGRAY(15)
DIMENSION FIELD(NFIELD),STATEV(NSTATV),DIRECT(3,3),
1 T(3,3),TIME(2)
C
DIMENSION ARRAY(15),JARRAY(15),JMAC(*),JMATYP(*),COORD(*)
C
DAMAGE=STATEV(1)
C Get temperatures from previous increment
CALL GETVRM('TEMP',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP,
& MATLAYO,LACCFLA)
TEMP=ARRAY(1)
TEMP=TEMP(1)
C
REAL Ti,Tf
Ti=573
Tf=873
IF (TEMP.GT.Ti) THEN
IF (TEMP.LT.Tf) THEN
DAMAGE=((TEMP-Ti)/(Tf-Ti))
ELSE IF (TEMP.GT.Tf) THEN
DAMAGE=1.D0
ELSE IF (TEMP.LT.Ti) THEN
DAMAGE=0.D0
ENDIF
STATEV(1)=DAMAGE
ENDIF
FIELD(1)=DAMAGE
STATEV(1)=FIELD(1)
RETURN
END
Then I want to develop a HETVAL subroutine that simulate the exotermic flow generated after this decomposition with the Arrhenius equation as follow:
Flux = Hv*dC/dt where Hv(J/kg) is latent heat of phase change(value I have)
dC/dt= k(1-C)^n where C is the decomposition grade calculated in the USDFLD subroutine (passed to HETVAL in each increment)
k(T)=Aexp(-Ea/RT) where A=3x10^15 (1/s); Ea= 180(kJ/molK); n03.5; R=8,314(J/molK); C=grade of decomposition calculated in USFLD(DAMAGE)
SUBROUTINE HETVAL(CMNAME,TEMP,TIME,DTIME,STATEV,FLUX,
1 PREDEF,DPRED)
C
INCLUDE 'ABA_PARAM.INC'
C
CHARACTER*80 CMNAME
C
DIMENSION TEMP(2),STATEV(*),PREDEF(*),TIME(2),FLUX(2),
1 DPRED(*)
C Get temperatures from previous increment
CALL GETVRM('TEMP',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP,
& MATLAYO,LACCFLA)
TEMP=ARRAY(1)
TEMP=TEMP(1)
REAL Hv,A0,Ea,R,n
C=STATEV(1)
Hv=324.0
A0=3E15
Ea=130E3
R=8.314
n=3.5
Ti=573
Tf=873
IF (TEMP.GT.Ti) THEN
IF (TEMP.LT.Tf) THEN
k=A**(-Ea/R*TEMP)
dC=k*((1-STATVE(1)**n)
FLUX(1)=Htr*dC
ELSE
FLUX(1)=0.D0
ENDIF
ENDIF
RETURN
END
A question I have is if this flux summs to the heat flux generated by Joule effect??(I'm running a lightning strike simulation, the current flows through the material and it heated up because of Joule effect)
Any help is welcome. Thank you guys!!
The grade of decomposition ''C''(DAMAGE) is calculate as follow:
D = (T-Ti)/(Tf-Ti), where Ti=573K and Tf=873K (Range of matrix decomposition temperature). T is the temperature at the current time increment
The thing is that it's the first time I develop a subroutine and I think I might be doing some mistakes, since abaqus cant compile it.
I'm just trying to set up a condition in which each node remains with the greater decomposition grade through the total step time.
I also want to plot the distribution of this grade of decomposition over my model.Please if someone is familiar to this type of subroutine and can check it out...
SUBROUTINE USDFLD(FIELD,STATEV,PNEWDT,DIRECT,T,CELENT,
1 TIME,DTIME,CMNAME,ORNAME,NFIELD,NSTATV,NOEL,NPT,LAYER,
2 KSPT,KSTEP,KINC,NDI,NSHR,COORD,JMAC,JMATYP,MATLAYO,LACCFLA)
C
INCLUDE 'ABA_PARAM.INC'
C
CHARACTER*80 CMNAME,ORNAME
CHARACTER*3 FLGRAY(15)
DIMENSION FIELD(NFIELD),STATEV(NSTATV),DIRECT(3,3),
1 T(3,3),TIME(2)
C
DIMENSION ARRAY(15),JARRAY(15),JMAC(*),JMATYP(*),COORD(*)
C
DAMAGE=STATEV(1)
C Get temperatures from previous increment
CALL GETVRM('TEMP',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP,
& MATLAYO,LACCFLA)
TEMP=ARRAY(1)
TEMP=TEMP(1)
C
REAL Ti,Tf
Ti=573
Tf=873
IF (TEMP.GT.Ti) THEN
IF (TEMP.LT.Tf) THEN
DAMAGE=((TEMP-Ti)/(Tf-Ti))
ELSE IF (TEMP.GT.Tf) THEN
DAMAGE=1.D0
ELSE IF (TEMP.LT.Ti) THEN
DAMAGE=0.D0
ENDIF
STATEV(1)=DAMAGE
ENDIF
FIELD(1)=DAMAGE
STATEV(1)=FIELD(1)
RETURN
END
Then I want to develop a HETVAL subroutine that simulate the exotermic flow generated after this decomposition with the Arrhenius equation as follow:
Flux = Hv*dC/dt where Hv(J/kg) is latent heat of phase change(value I have)
dC/dt= k(1-C)^n where C is the decomposition grade calculated in the USDFLD subroutine (passed to HETVAL in each increment)
k(T)=Aexp(-Ea/RT) where A=3x10^15 (1/s); Ea= 180(kJ/molK); n03.5; R=8,314(J/molK); C=grade of decomposition calculated in USFLD(DAMAGE)
SUBROUTINE HETVAL(CMNAME,TEMP,TIME,DTIME,STATEV,FLUX,
1 PREDEF,DPRED)
C
INCLUDE 'ABA_PARAM.INC'
C
CHARACTER*80 CMNAME
C
DIMENSION TEMP(2),STATEV(*),PREDEF(*),TIME(2),FLUX(2),
1 DPRED(*)
C Get temperatures from previous increment
CALL GETVRM('TEMP',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP,
& MATLAYO,LACCFLA)
TEMP=ARRAY(1)
TEMP=TEMP(1)
REAL Hv,A0,Ea,R,n
C=STATEV(1)
Hv=324.0
A0=3E15
Ea=130E3
R=8.314
n=3.5
Ti=573
Tf=873
IF (TEMP.GT.Ti) THEN
IF (TEMP.LT.Tf) THEN
k=A**(-Ea/R*TEMP)
dC=k*((1-STATVE(1)**n)
FLUX(1)=Htr*dC
ELSE
FLUX(1)=0.D0
ENDIF
ENDIF
RETURN
END
A question I have is if this flux summs to the heat flux generated by Joule effect??(I'm running a lightning strike simulation, the current flows through the material and it heated up because of Joule effect)
Any help is welcome. Thank you guys!!