Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *deck,usercreep parallel user gal
- SUBROUTINE usercreep (impflg, ldstep, isubst, matId , elemId,
- & kDInPt, kLayer, kSecPt, nstatv, nprop,
- & prop , time , dtime , temp , dtemp ,
- & toffst, Ustatev, creqv , pres , seqv ,
- & delcr , dcrda)
- c*************************************************************************
- c
- c *** Implementation of API-579 Project Omega Creep Strain Formulas
- c Written by Benjamin Turner, P.E.
- c Revision: 7/18/2017
- c To-do: Add error checking for material parameter input
- c
- c
- c input arguments
- c ===============
- c impflg (in ,sc ,i) Explicit/implicit integration
- c flag (currently not used)
- c ldstep (in ,sc ,i) Current load step
- c isubst (in ,sc ,i) Current sub step
- c matId (in ,sc ,i) number of material index
- c elemId (in ,sc ,i) Element number
- c kDInPt (in ,sc ,i) Material integration point
- c kLayer (in ,sc ,i) Layer number
- c kSecPt (in ,sc ,i) Section point
- c nstatv (in ,sc ,i) Number of state variables
- c nprop (in ,sc ,i) size of mat properties array
- c prop (dp ,ar(*),i) mat properties array
- c time Current time
- c dtime Current time increment
- c temp Current temperature
- c dtemp Current temperature increment
- c toffst (dp, sc, i) temperature offset from absolute zero
- c seqv (dp ,sc , i) equivalent effective stress
- c creqv (dp ,sc , i) equivalent effective creep strain
- c pres (dp ,sc , i) hydrostatic pressure stress, -(Sxx+Syy+Szz)/3
- c
- c Material Constants for Input -- from API-579
- c prop(1) A0
- c prop(2) A1
- c prop(3) A2
- c prop(4) A3
- c prop(5) A4
- c prop(6) B0
- c prop(7) B1
- c prop(8) B2
- c prop(9) B3
- c prop(10) B4
- c
- c Constants -- from API-579
- c prop(11) beta_omega: Prager factor = 0.33
- c prop(12) d_cd: Creep ductility adjustment factor = 0
- c prop(13) d_sr: Creep strain adjustment factor = 0
- c Convergence criteria
- c prop(14) ds_inc: Stres increment
- c prop(15) de_inc: Creep increment
- c Logging information
- c prop(16) dolog: For dumping output: x>0 is on
- c Minimum Temp/Stress
- c prop(17) minT: The minimum temp to calc creep
- c prop(18) minS: The minimum stress to calc creep
- c
- c input output arguments input desc / output desc
- c ====================== ========== ===========
- c Ustatev (dp,ar(*), i/o) user defined iinternal state variables at
- c time 't' / 't+dt'.
- c This array will be passed in containing the
- c values of these variables at start of the
- c time increment. They must be updated in this
- c subroutine to their values at the end of
- c time increment, if any of these internal
- c state variables are associated with the
- c creep behavior.
- c
- c Ustatev(1) D_c : damage factor: initialize to 0
- c Ustatev(2) Ddot_c : damage factor rate: initialize to 0
- c Ustatev(3) e_c : creep strain: initialize to 0
- c Ustatev(4) edot_c : creep strain: rate initialize to 0
- c
- c output arguments
- c ================
- c delcr (dp ,sc , o) incremental creep strain
- c dcrda (dp,ar(*), o) output array
- c dcrda(1) - derivative of incremental creep
- c strain to effective stress
- c dcrda(2) - derivative of incremental creep
- c strain to creep strain
- c
- c
- c local variables
- c ===============
- c A0,A1,A2,A3,A4 (dp, sc, l) Material Constants
- c B0,B1,B2,B3,B4 (dp, sc, l) Material Constants
- c beta (dp, sc, l) Prager constant
- c d_cd,d_sr (dp, sc, l) Adjustment factors
- c omega (dp, sc, l) Omega uniaxial damage parameter
- c lomega (dp, sc, l) Log of omega uniaxial damage parameter
- c omega_m (dp, sc, l) Omega multiaxial damage parameter
- c omega_n (dp, sc, l) Minimum Omega uniaxial damage parameter
- c S_l (dp, sc, l) Stress parameter
- c S_l2, S_l3 (dp, sc, l) Stress parameter (exponentiated)
- c s_1, s_2, s_3 (dp, sc, l) Principal stresses
- c s_e (dp, sc, l) Effective stresses
- c D_c (dp, sc, l) Cumulative damage
- c Ddot_c (dp, sc, l) Cumulative damage rate
- c e_c (dp, sc, l) Creep strain
- c edot_c (dp, sc, l) Creep strain rate
- c edot_oc (dp, sc, l) Creep strain parameter
- c ledot_oc (dp, sc, l) Log of creep strain parameter
- c n (dp, sc, l) Intermediate value
- c delta (dp, sc, l) Intermediate stress value
- c T (dp, sc, l) Temperature including offset
- c de_inc (dp, sc, l) Strain increment for differentiation
- c ds_inc (dp, sc, l) Stress increment for differentiation
- c s_vec (dp, sc, l) Stress vector from element
- c ncomp (dp, sc, l) Number of stress components
- c delcr_e (dp, sc, l) Creep strain wrt strain
- c delcr_s (dp, sc, l) Creep strain wrt stress
- c dolog (dp, sc, l) Any integer > 0 turns on logging output
- c minT (dp, sc, l) Minimum temp (F) to calc creep
- c minS (dp, sc, l) Min triaxial stress (ksi) to calc creep
- c
- c*************************************************************************
- c
- c --- parameters
- c
- #include "impcom.inc"
- #include "ansysdef.inc"
- EXTERNAL get_ElmInfo,
- & get_ElmData,
- & prinst,
- & wrinqr
- DOUBLE PRECISION ZERO
- PARAMETER (ZERO = 0.0d0)
- c
- c --- argument list
- c
- INTEGER ldstep, isubst, matId , elemId,
- & kDInPt, kLayer, kSecPt, nstatv,
- & impflg, nprop
- DOUBLE PRECISION dtime , time , temp , dtemp , toffst,
- & creqv , seqv , pres, delcr
- DOUBLE PRECISION prop(*), dcrda(*), Ustatev(nstatv)
- c -- for debug output
- INTEGER wrinqr, iott, ntrg
- c
- c --- local variables
- c
- DOUBLE PRECISION A0 , A1 , A2 , A3 , A4 ,
- & B0 , B1 , B2 , B3 , B4 ,
- & beta ,
- & d_cd , d_sr ,
- & omega , omega_m, omega_n,
- & lomega,
- & edot_c, edot_oc,
- & ledot_oc,
- & S_l ,
- & S_l2 , S_l3,
- & s_1 , s_2 , s_3 ,
- & s_e ,
- & D_c , Ddot_c,
- & e_c ,
- & n , delta ,
- & T ,
- & de_inc, ds_inc,
- & delcr_e, delcr_s,
- & minT, minS
- INTEGER ncomp , dolog
- c --- for the stress vector
- INTEGER MSVAR
- parameter (MSVAR = 11)
- DOUBLE PRECISION s_vec(MSVAR)
- c
- c*************************************************************************
- c
- c *** skip when stress and creep strain are all zero
- if (seqv .le. ZERO .and. creqv .le. ZERO) go to 990
- c *** API-579 Material Constants
- A0 = prop(1)
- A1 = prop(2)
- A2 = prop(3)
- A3 = prop(4)
- A4 = prop(5)
- B0 = prop(6)
- B1 = prop(7)
- B2 = prop(8)
- B3 = prop(9)
- B4 = prop(10)
- c prop(11) beta_omega: Prager factor = 0.33
- c prop(12) d_cd: Creep ductility adjustment factor = 0
- c prop(13) d_sr: Creep strain adjustment factor = 0
- beta = prop(11)
- d_cd = prop(12)
- d_sr = prop(13)
- c *** Numerical differentiation (may need to adjust)
- c ds_inc is delta(stress) while de_inc is delta(strain)
- c ds_inc = 2.0d0**(-5.0d0)
- c de_inc = 2.0d0**(-15.0d0)
- ds_inc = prop(14)
- de_inc = prop(15)
- c *** Is logging turned on?
- dolog = prop(16)
- c *** Min temp and min stress
- minT = prop(17)
- minS = prop(18)
- c *** Absolute temperature
- T = temp + toffst
- if(T .le. ZERO) go to 990
- c *** Min temp
- if(temp .le. minT) go to 2000
- c *** Get number of stress components
- call get_ElmInfo ('NCOMP',ncomp)
- c *** Get stress vector
- call get_ElmData ('SIG ',elemId, kDInPt, ncomp, s_vec)
- c *** Get principal stresses -- Maybe need to put in storage var first??
- call prinst(s_vec(1))
- c primary function: computes principal stresses and stress intensity
- c secondary functions: none
- c *** Notice - This file contains ANSYS Confidential information ***
- c input arguments:
- c variable (typ,siz,intent) description
- c s (dp,ar(11),inout) - stress vector
- c s(1)=sx
- c s(2)=sy
- c s(3)=sz
- c s(4)=sigxy
- c s(5)=sigyz
- c s(6)=sigzx
- c
- c output arguments:
- c variable (typ,siz,intent) description
- c s (dp,ar(11),inout) - stress vector
- c s(7)=sig1
- c s(8)=sig2
- c s(9)=sig3
- c s(10)=s.i.
- c s(11)=sige
- c ********* note: all changes to this routine must be made in
- c post1 (paprst)
- c
- c *** Save principal stresses and equivalent
- c *** Make sure they're in KSI! KSI!
- s_1 = s_vec(7) / 1000
- s_2 = s_vec(8) / 1000
- s_3 = s_vec(9) / 1000
- s_e = seqv / 1000
- c *** Min triaxial stress
- if(s_1+s_2+s_3 .le. minS) go to 2000
- c *** Compute intermediate values
- delta = beta * (((s_1+s_2+s_3)/s_e) - 1)
- S_l = LOG10 (s_e)
- S_l2 = S_l**2
- S_l3 = S_l**3
- c *** Compute omega axial damage parameters
- lomega = ((B0+d_cd) + ((B1 + B2*S_l + B3*S_l2 + B4*S_l3)/T))
- omega = 10**lomega
- n = -1 * (A2 + 2*A3*S_l + 3*A4*S_l2)/T
- omega_n = omega - n
- if ( omega_n .le. 3 ) omega_n = 3
- omega_m = omega_n ** (delta + 1)
- c *** Compute intermediate creep strain rate parameters
- ledot_oc = -1* ((A0+d_sr) + ((A1 + A2*S_l + A3*S_l2 + A4*S_l3)/T))
- edot_oc = 10**ledot_oc
- c *** Compute creep strain rate
- e_c = creqv
- c if(e_c .le. TINY) e_c = sqrt(TINY)
- edot_c = edot_oc*exp(omega_m*e_c)
- c *** Compute incremental creep strain
- delcr = edot_c * dtime
- c *** Compute damage factors
- D_c = Ustatev(1)
- Ddot_c = omega_m * edot_oc
- c *** Update damage factors
- Ustatev(1) = D_c + Ddot_c*dtime
- Ustatev(2) = Ddot_c
- Ustatev(3) = creqv
- Ustatev(4) = edot_c
- c *** DONE DONE DONE DONE DONE WITH FIRST PASS
- c *** NOW CALCULATE NUMERICAL DERIVATIVES
- c *** DONE DONE DONE DONE DONE WITH FIRST PASS
- c *** Compute relative to effective strain
- c *** Compute creep strain rate (dstrain)
- e_c = creqv+de_inc
- c if(e_c .le. TINY) e_c = sqrt(TINY)
- edot_c = edot_oc*exp(omega_m*e_c)
- c *** Compute incremental creep strain (dstrain)
- delcr_e = edot_c * dtime
- c *** DONE DONE DONE DONE DONE WITH SECOND PASS
- c *** DONE DONE DONE DONE DONE WITH SECOND PASS
- c *** Compute relative to effective stress
- s_e = (seqv+ds_inc)/1000
- c *** Compute intermediate values (dstress)
- delta = beta * (((s_1+s_2+s_3)/s_e) - 1)
- S_l = LOG10 (s_e)
- S_l2 = S_l**2
- S_l3 = S_l**3
- c *** Compute omega axial damage parameters (dstress)
- lomega = ((B0+d_cd) + ((B1 + B2*S_l + B3*S_l2 + B4*S_l3)/T))
- omega = 10**lomega
- n = -1 * (A2 + 2*A3*S_l + 3*A4*S_l2)/T
- omega_n = omega - n
- if ( omega_n .le. 3 ) omega_n = 3
- omega_m = omega_n ** (delta + 1)
- c *** Compute intermediate creep strain rate parameters (dstress)
- ledot_oc = -1* ((A0+d_sr) + ((A1 + A2*S_l + A3*S_l2 + A4*S_l3)/T))
- edot_oc = 10**ledot_oc
- c *** Compute creep strain rate (dstress)
- e_c = creqv
- c if(e_c .le. TINY) e_c = sqrt(TINY)
- edot_c = edot_oc*exp(omega_m*e_c)
- c *** Compute incremental creep strain (dstress)
- delcr_s = edot_c * dtime
- c *** Derivative of incremental creep strain to effective stress
- dcrda(1) = (delcr_s - delcr) / ds_inc
- c *** derivative of incremental creep strain to effective creep strain
- dcrda(2) = (delcr_e - delcr) / de_inc
- c *** save incremental creep strain as variable 2
- Ustatev(4) = delcr
- c *** trigger if we find the nodes
- ntrg = 0
- if (elemId .eq. 1337) then
- ntrg = 1
- elseif (elemId .eq. 1336) then
- ntrg = 1
- elseif (elemId .eq. 3797) then
- ntrg = 1
- else
- ntrg = 0
- end if
- c *** debug output because of failing node Convergence
- if (dolog .gt. 0 .and. ntrg .gt. 0) then
- iott = wrinqr(WR_OUTPUT)
- write(iott, 1000) 'ElemID: ', elemId, ' MatID: ', matId,
- & ' Temp: ', T
- 1000 format(A,I,A,I,A,F)
- write(iott, 1010), 'A0: ', A0, ' A1: ', A1, ' A2: ', A2,
- & ' A3: ', A3, ' A4: ', A4, ' B0: ', B0, ' B1: ', B1, ' B2: ',
- & B2, ' B3: ', B3, ' B4: ', B4
- 1010 format(10(A, F))
- write(iott, 1020), 'Beta: ', beta, ' d_cd: ', d_cd, ' d_sr: ',
- & d_sr, ' omega: ', omega, ' omega_m: ', omega_m, ' omega_n: ',
- & omega_n, ' n: ', n, ' lomega: ', lomega
- 1020 format(8(A, F))
- write(iott, 1030), 'S_l: ', S_l, ' S_l2: ', S_l2, ' S_l3: ',
- & S_l3, ' s_1: ', s_1, ' s_2: ', s_2, ' s_3: ', s_3, ' s_e: ',
- & s_e, ' D_c: ', D_c, ' Ddot_c: ', Ddot_c, ' delta: ', delta
- 1030 format(10(A, F))
- write(iott, 1040), 'edot_c: ', edot_c, ' edot_oc: ', edot_oc,
- & ' ledot_oc: ', ledot_oc, ' e_c: ', e_c, ' de_inc: ', de_inc,
- & ' ds_inc: ', ds_inc, ' delcr_e: ', delcr_e, ' delcr_s: ',
- & delcr_s, ' dcrda(1): ', dcrda(1), ' dcrda(2) ', dcrda(2)
- 1040 format(10(A, F))
- end if
- 990 continue
- return
- c *** Set all the creep and such to zero because we don't need to calculate it
- c *** Set incremental creep strain to zero
- 2000 delcr = 0
- c *** Set derivatives to zero
- dcrda(1) = 0
- dcrda(2) = 0
- continue
- return
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement