johniftekhar
Geotechnical
- Jul 30, 2012
- 1
Hi,
I am new here. I wrote a USDFLD subroutine to change young's modulus based on the mean stress. First, I tried to keep the E value constant with field(1) then I am tring to vary the E with mean stress. In usdfld file, I gave constant field(1)=60000, but when it is running input file, initially it taking E value less than 60000. Why it is taking different E value as I keep the field(1) value constant.
Input file:
*HEADING
Mohr-Coulomb, CAX4 element, Triaxial Compression
E=A(p)^N is used using usdfld fortran file
Inputs in USDFLD.for are C, P_ref,N, and minimum p
*NODE,NSET=ALLN
1, 0., 0.
2, 1., 0.
3, 1., 1.
4, 0., 1.
*ELEMENT,TYPE=CAX4,ELSET=ALLE
1,1,2,3,4
*SOLID SECTION,ELSET=ALLE,MATERIAL=ALLE
*MATERIAL,NAME=ALLE
*Density
1.77,
*ELASTIC, TYPE=ISOTROPIC, DEPENDENCIES=1
100.,0.3,0.,100.
300000.,0.3,0.,300000.
*USER DEFINED FIELD
*DEPVAR
5
***ELASTIC
**160000.,0.3
***Mohr Coulomb
**44.,16.
***Mohr Coulomb Hardening
** 0.5,0.
*BOUNDARY
1,PINNED
2,2
4,1
*INITIAL CONDITIONS,TYPE=STRESS
ALLE,-60.,-60.,-60.
*INITIAL CONDITIONS,TYPE=Field, VARIABLE=1
ALLN,70000.
*STEP,INC=1000
*GEOSTATIC
1.,1.
*DLOAD
1,P2,60.
1,P3,60.
*EL PRINT
S,
SINV,
E,
PE,
SDV,
FV
**EE,
*NODE PRINT, TOTALS=yes
U2, RF2
*EL FILE,FREQ=10
S,E,PE
*END STEP
*STEP,INC=20000
*Static
0.0001, 1, 1e-15, 1.
***STATIC,DIRECT
**1.,20.
*BOUNDARY
3,2,,-.2
4,2,,-.2
*Output, field, variable=PRESELECT
*Element Output, directions=YES
LE, PE, PEEQ, S, SDV, FV
*END STEP
usdfld file:
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,
3 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)
DIMENSION ARRAY(15),JARRAY(15),JMAC(*),JMATYP(*),
1 COORD(*)
C Get values of current stress:
CALL GETVRM('S',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP,
1 MATLAYO,LACCFLA)
C ARRAY(1)=S11, ARRAY(2)=S22, ARRAY(3)=S33,ARRAY(4)=S12,ARRAY(4)=S13,ARRAY(4)=S23
c write(*,*)array(1),array(2),array(3)
c if (time(1) .GE. 1.0)then
C MODULUS OF ELASTICITY DEFINED AS E=C*(P/P_REF)^AN
!INPUT
C=100000.0D0
P_REF=100.0D0
AN=0.5D0
P_min=1.0D0 !kPa, for numerical issue
P_max=1000.0D0 !kPa, for numerical issue
!END OF INPUT FOR ELASTICITY
P_current=(array(1)+array(2)+array(3))/(-3.0D0)
IF (P_current .LE. P_min)P_current=P_min
IF (P_current .GE. P_max)P_current=P_max
E_current = C*(P_current/P_REF)**AN
if (time(2) .ge. 1.0)then
write(6,*) time(1),time(2), field(1)
field(1) = 60000.*time(2) !E_current
else
field(1) = 60000.
endif
sig22= array(2)
c q=array(2)-array(3)
c statev(1)=p_current
c statev(2)= E_current
C Get value of current strain:
CALL GETVRM('E',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP,
1 MATLAYO,LACCFLA)
C ARRAY(1)=E11, ARRAY(2)=E22, ARRAY(3)=E33,ARRAY(4)=E12,ARRAY(4)=E13,ARRAY(4)=E23
strain22=array(2)
c write(6,*)'test',P_current, field(1)
c write(6,*)'test',vertical_strain, q, field(1)
C If error, write comment to .DAT file:
if (time(2) .ge. 0.1)then
E_modulus=(sig22-statev(1))/(strain22-statev(2))
print*,field(1),E_modulus,time(2)
endif
statev(1)=sig22
statev(2)=strain22
IF(JRCD.NE.0)THEN
WRITE(6,*) 'REQUEST ERROR IN USDFLD FOR ELEMENT NUMBER ',
1 NOEL,'INTEGRATION POINT NUMBER ',NPT
ENDIF
C
RETURN
END
I am new here. I wrote a USDFLD subroutine to change young's modulus based on the mean stress. First, I tried to keep the E value constant with field(1) then I am tring to vary the E with mean stress. In usdfld file, I gave constant field(1)=60000, but when it is running input file, initially it taking E value less than 60000. Why it is taking different E value as I keep the field(1) value constant.
Input file:
*HEADING
Mohr-Coulomb, CAX4 element, Triaxial Compression
E=A(p)^N is used using usdfld fortran file
Inputs in USDFLD.for are C, P_ref,N, and minimum p
*NODE,NSET=ALLN
1, 0., 0.
2, 1., 0.
3, 1., 1.
4, 0., 1.
*ELEMENT,TYPE=CAX4,ELSET=ALLE
1,1,2,3,4
*SOLID SECTION,ELSET=ALLE,MATERIAL=ALLE
*MATERIAL,NAME=ALLE
*Density
1.77,
*ELASTIC, TYPE=ISOTROPIC, DEPENDENCIES=1
100.,0.3,0.,100.
300000.,0.3,0.,300000.
*USER DEFINED FIELD
*DEPVAR
5
***ELASTIC
**160000.,0.3
***Mohr Coulomb
**44.,16.
***Mohr Coulomb Hardening
** 0.5,0.
*BOUNDARY
1,PINNED
2,2
4,1
*INITIAL CONDITIONS,TYPE=STRESS
ALLE,-60.,-60.,-60.
*INITIAL CONDITIONS,TYPE=Field, VARIABLE=1
ALLN,70000.
*STEP,INC=1000
*GEOSTATIC
1.,1.
*DLOAD
1,P2,60.
1,P3,60.
*EL PRINT
S,
SINV,
E,
PE,
SDV,
FV
**EE,
*NODE PRINT, TOTALS=yes
U2, RF2
*EL FILE,FREQ=10
S,E,PE
*END STEP
*STEP,INC=20000
*Static
0.0001, 1, 1e-15, 1.
***STATIC,DIRECT
**1.,20.
*BOUNDARY
3,2,,-.2
4,2,,-.2
*Output, field, variable=PRESELECT
*Element Output, directions=YES
LE, PE, PEEQ, S, SDV, FV
*END STEP
usdfld file:
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,
3 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)
DIMENSION ARRAY(15),JARRAY(15),JMAC(*),JMATYP(*),
1 COORD(*)
C Get values of current stress:
CALL GETVRM('S',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP,
1 MATLAYO,LACCFLA)
C ARRAY(1)=S11, ARRAY(2)=S22, ARRAY(3)=S33,ARRAY(4)=S12,ARRAY(4)=S13,ARRAY(4)=S23
c write(*,*)array(1),array(2),array(3)
c if (time(1) .GE. 1.0)then
C MODULUS OF ELASTICITY DEFINED AS E=C*(P/P_REF)^AN
!INPUT
C=100000.0D0
P_REF=100.0D0
AN=0.5D0
P_min=1.0D0 !kPa, for numerical issue
P_max=1000.0D0 !kPa, for numerical issue
!END OF INPUT FOR ELASTICITY
P_current=(array(1)+array(2)+array(3))/(-3.0D0)
IF (P_current .LE. P_min)P_current=P_min
IF (P_current .GE. P_max)P_current=P_max
E_current = C*(P_current/P_REF)**AN
if (time(2) .ge. 1.0)then
write(6,*) time(1),time(2), field(1)
field(1) = 60000.*time(2) !E_current
else
field(1) = 60000.
endif
sig22= array(2)
c q=array(2)-array(3)
c statev(1)=p_current
c statev(2)= E_current
C Get value of current strain:
CALL GETVRM('E',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP,
1 MATLAYO,LACCFLA)
C ARRAY(1)=E11, ARRAY(2)=E22, ARRAY(3)=E33,ARRAY(4)=E12,ARRAY(4)=E13,ARRAY(4)=E23
strain22=array(2)
c write(6,*)'test',P_current, field(1)
c write(6,*)'test',vertical_strain, q, field(1)
C If error, write comment to .DAT file:
if (time(2) .ge. 0.1)then
E_modulus=(sig22-statev(1))/(strain22-statev(2))
print*,field(1),E_modulus,time(2)
endif
statev(1)=sig22
statev(2)=strain22
IF(JRCD.NE.0)THEN
WRITE(6,*) 'REQUEST ERROR IN USDFLD FOR ELEMENT NUMBER ',
1 NOEL,'INTEGRATION POINT NUMBER ',NPT
ENDIF
C
RETURN
END