adapted kinehardening
This commit is contained in:
parent
2a88285088
commit
7ac552ee49
|
@ -29,8 +29,6 @@ submodule(phase:plastic) kinehardening
|
||||||
P_nS_neg
|
P_nS_neg
|
||||||
integer :: &
|
integer :: &
|
||||||
sum_N_sl
|
sum_N_sl
|
||||||
logical :: &
|
|
||||||
nonSchmidActive = .false.
|
|
||||||
character(len=pSTRLEN), allocatable, dimension(:) :: &
|
character(len=pSTRLEN), allocatable, dimension(:) :: &
|
||||||
output
|
output
|
||||||
character(len=:), allocatable, dimension(:) :: &
|
character(len=:), allocatable, dimension(:) :: &
|
||||||
|
@ -83,9 +81,10 @@ module function plastic_kinehardening_init() result(myPlasticity)
|
||||||
integer, dimension(:), allocatable :: &
|
integer, dimension(:), allocatable :: &
|
||||||
N_sl
|
N_sl
|
||||||
real(pREAL), dimension(:), allocatable :: &
|
real(pREAL), dimension(:), allocatable :: &
|
||||||
xi_0, & !< initial forest stress
|
xi_0 !< initial forest stress
|
||||||
!! τ_for,0
|
!! τ_for,0
|
||||||
a !< non-Schmid coefficients
|
real(pREAL), dimension(:,:), allocatable :: &
|
||||||
|
a_nS !< non-Schmid coefficients
|
||||||
character(len=:), allocatable :: &
|
character(len=:), allocatable :: &
|
||||||
refs, &
|
refs, &
|
||||||
extmsg
|
extmsg
|
||||||
|
@ -144,13 +143,13 @@ module function plastic_kinehardening_init() result(myPlasticity)
|
||||||
prm%P = crystal_SchmidMatrix_slip(N_sl,phase_lattice(ph),phase_cOverA(ph))
|
prm%P = crystal_SchmidMatrix_slip(N_sl,phase_lattice(ph),phase_cOverA(ph))
|
||||||
|
|
||||||
if (phase_lattice(ph) == 'cI') then
|
if (phase_lattice(ph) == 'cI') then
|
||||||
a = pl%get_as1dReal('a_nonSchmid_110',defaultVal=emptyRealArray)
|
allocate(a_nS(3,size(pl%get_as1dReal('a_nonSchmid_110',defaultVal=emptyRealArray))),source=0.0_pREAL)
|
||||||
prm%nonSchmidActive = size(a) > 0
|
a_nS(1,:) = pl%get_as1dReal('a_nonSchmid_110',defaultVal=emptyRealArray)
|
||||||
prm%P_nS_pos = crystal_nonSchmidMatrix(N_sl,a,+1)
|
prm%P_nS_pos = crystal_SchmidMatrix_slip(N_sl,phase_lattice(ph),phase_cOverA(ph),nonSchmidCoefficients=a_nS,sense=+1)
|
||||||
prm%P_nS_neg = crystal_nonSchmidMatrix(N_sl,a,-1)
|
prm%P_nS_neg = crystal_SchmidMatrix_slip(N_sl,phase_lattice(ph),phase_cOverA(ph),nonSchmidCoefficients=a_nS,sense=-1)
|
||||||
else
|
else
|
||||||
prm%P_nS_pos = prm%P
|
prm%P_nS_pos = +prm%P
|
||||||
prm%P_nS_neg = prm%P
|
prm%P_nS_neg = -prm%P
|
||||||
end if
|
end if
|
||||||
|
|
||||||
prm%h_sl_sl = crystal_interaction_SlipBySlip(N_sl,pl%get_as1dReal('h_sl-sl'), &
|
prm%h_sl_sl = crystal_interaction_SlipBySlip(N_sl,pl%get_as1dReal('h_sl-sl'), &
|
||||||
|
@ -256,38 +255,37 @@ end function plastic_kinehardening_init
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief Calculate plastic velocity gradient and its tangent.
|
!> @brief Calculate plastic velocity gradient and its tangent.
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
pure module subroutine kinehardening_LpAndItsTangent(Lp,dLp_dMp,Mp,ph,en)
|
pure module subroutine kinehardening_LpAndItsTangent(Lp,dLp_dMp, Mp,ph,en)
|
||||||
|
|
||||||
real(pREAL), dimension(3,3), intent(out) :: &
|
real(pREAL), dimension(3,3), intent(out) :: &
|
||||||
Lp !< plastic velocity gradient
|
Lp !< plastic velocity gradient
|
||||||
real(pREAL), dimension(3,3,3,3), intent(out) :: &
|
real(pREAL), dimension(3,3,3,3), intent(out) :: &
|
||||||
dLp_dMp !< derivative of Lp with respect to the Mandel stress
|
dLp_dMp !< derivative of Lp with respect to the Mandel stress
|
||||||
|
|
||||||
real(pREAL), dimension(3,3), intent(in) :: &
|
real(pREAL), dimension(3,3), intent(in) :: &
|
||||||
Mp !< Mandel stress
|
Mp !< Mandel stress
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: &
|
||||||
ph, &
|
ph, &
|
||||||
en
|
en
|
||||||
|
|
||||||
integer :: &
|
integer :: &
|
||||||
i,k,l,m,n
|
i,k,l,m,n
|
||||||
real(pREAL), dimension(param(ph)%sum_N_sl) :: &
|
real(pREAL), dimension(param(ph)%sum_N_sl) :: &
|
||||||
dot_gamma_pos,dot_gamma_neg, &
|
dot_gamma, ddot_gamma_dtau
|
||||||
ddot_gamma_dtau_pos,ddot_gamma_dtau_neg
|
|
||||||
|
|
||||||
Lp = 0.0_pREAL
|
Lp = 0.0_pREAL
|
||||||
dLp_dMp = 0.0_pREAL
|
dLp_dMp = 0.0_pREAL
|
||||||
|
|
||||||
associate(prm => param(ph))
|
associate(prm => param(ph))
|
||||||
|
|
||||||
call kinetics(Mp,ph,en, dot_gamma_pos,dot_gamma_neg,ddot_gamma_dtau_pos,ddot_gamma_dtau_neg)
|
call kinetics(Mp,ph,en, dot_gamma,ddot_gamma_dtau)
|
||||||
|
|
||||||
do i = 1, prm%sum_N_sl
|
do i = 1, prm%sum_N_sl
|
||||||
Lp = Lp + (dot_gamma_pos(i)+dot_gamma_neg(i))*prm%P(1:3,1:3,i)
|
Lp = Lp + dot_gamma(i)*prm%P(1:3,1:3,i)
|
||||||
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
|
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
|
||||||
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
|
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
|
||||||
+ ddot_gamma_dtau_pos(i) * prm%P(k,l,i) * prm%P_nS_pos(m,n,i) &
|
+ ddot_gamma_dtau(i) * prm%P(k,l,i) &
|
||||||
+ ddot_gamma_dtau_neg(i) * prm%P(k,l,i) * prm%P_nS_neg(m,n,i)
|
* merge(prm%P_nS_pos(m,n,i), &
|
||||||
|
prm%P_nS_neg(m,n,i), dot_gamma(i)>0.0_pREAL)
|
||||||
end do
|
end do
|
||||||
|
|
||||||
end associate
|
end associate
|
||||||
|
@ -311,7 +309,7 @@ module function plastic_kinehardening_dotState(Mp,ph,en) result(dotState)
|
||||||
real(pREAL) :: &
|
real(pREAL) :: &
|
||||||
sumGamma
|
sumGamma
|
||||||
real(pREAL), dimension(param(ph)%sum_N_sl) :: &
|
real(pREAL), dimension(param(ph)%sum_N_sl) :: &
|
||||||
dot_gamma_pos,dot_gamma_neg
|
dot_gamma
|
||||||
|
|
||||||
|
|
||||||
associate(prm => param(ph), stt => state(ph), &
|
associate(prm => param(ph), stt => state(ph), &
|
||||||
|
@ -319,9 +317,9 @@ module function plastic_kinehardening_dotState(Mp,ph,en) result(dotState)
|
||||||
dot_chi => dotState(IndexDotState(ph)%chi(1):IndexDotState(ph)%chi(2)),&
|
dot_chi => dotState(IndexDotState(ph)%chi(1):IndexDotState(ph)%chi(2)),&
|
||||||
dot_gamma => dotState(IndexDotState(ph)%gamma(1):IndexDotState(ph)%gamma(2)))
|
dot_gamma => dotState(IndexDotState(ph)%gamma(1):IndexDotState(ph)%gamma(2)))
|
||||||
|
|
||||||
call kinetics(Mp,ph,en, dot_gamma_pos,dot_gamma_neg)
|
call kinetics(Mp,ph,en, dot_gamma)
|
||||||
dot_gamma = abs(dot_gamma_pos+dot_gamma_neg)
|
|
||||||
sumGamma = sum(stt%gamma(:,en))
|
sumGamma = sum(stt%gamma(:,en))
|
||||||
|
dot_gamma = abs(dot_gamma)
|
||||||
|
|
||||||
|
|
||||||
dot_xi = matmul(prm%h_sl_sl,dot_gamma) &
|
dot_xi = matmul(prm%h_sl_sl,dot_gamma) &
|
||||||
|
@ -338,6 +336,7 @@ module function plastic_kinehardening_dotState(Mp,ph,en) result(dotState)
|
||||||
* exp(-(stt%gamma(:,en)-stt%gamma_flip(:,en))*prm%h_0_chi/(prm%chi_inf+stt%chi_flip(:,en))) &
|
* exp(-(stt%gamma(:,en)-stt%gamma_flip(:,en))*prm%h_0_chi/(prm%chi_inf+stt%chi_flip(:,en))) &
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
end associate
|
end associate
|
||||||
|
|
||||||
end function plastic_kinehardening_dotState
|
end function plastic_kinehardening_dotState
|
||||||
|
@ -355,16 +354,16 @@ module subroutine plastic_kinehardening_deltaState(Mp,ph,en)
|
||||||
en
|
en
|
||||||
|
|
||||||
real(pREAL), dimension(param(ph)%sum_N_sl) :: &
|
real(pREAL), dimension(param(ph)%sum_N_sl) :: &
|
||||||
dot_gamma_pos,dot_gamma_neg, &
|
dot_gamma, &
|
||||||
sgn_gamma
|
sgn_gamma
|
||||||
|
|
||||||
|
|
||||||
associate(prm => param(ph), stt => state(ph), dlt => deltaState(ph))
|
associate(prm => param(ph), stt => state(ph), dlt => deltaState(ph))
|
||||||
|
|
||||||
call kinetics(Mp,ph,en, dot_gamma_pos,dot_gamma_neg)
|
call kinetics(Mp,ph,en, dot_gamma)
|
||||||
sgn_gamma = merge(state(ph)%sgn_gamma(:,en), &
|
sgn_gamma = merge(state(ph)%sgn_gamma(:,en), &
|
||||||
sign(1.0_pREAL,dot_gamma_pos+dot_gamma_neg), &
|
sign(1.0_pREAL,dot_gamma), &
|
||||||
dEq0(dot_gamma_pos+dot_gamma_neg,1e-10_pREAL))
|
dEq0(dot_gamma,1e-10_pREAL))
|
||||||
|
|
||||||
where(dNeq(sgn_gamma,stt%sgn_gamma(:,en),0.1_pREAL)) ! ToDo sgn_gamma*stt%sgn_gamma(:,en)<0
|
where(dNeq(sgn_gamma,stt%sgn_gamma(:,en),0.1_pREAL)) ! ToDo sgn_gamma*stt%sgn_gamma(:,en)<0
|
||||||
dlt%sgn_gamma (:,en) = sgn_gamma - stt%sgn_gamma (:,en)
|
dlt%sgn_gamma (:,en) = sgn_gamma - stt%sgn_gamma (:,en)
|
||||||
|
@ -433,61 +432,38 @@ end subroutine plastic_kinehardening_result
|
||||||
! at the end since some of them are optional.
|
! at the end since some of them are optional.
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
pure subroutine kinetics(Mp,ph,en, &
|
pure subroutine kinetics(Mp,ph,en, &
|
||||||
dot_gamma_pos,dot_gamma_neg,ddot_gamma_dtau_pos,ddot_gamma_dtau_neg)
|
dot_gamma,ddot_gamma_dtau)
|
||||||
|
|
||||||
real(pREAL), dimension(3,3), intent(in) :: &
|
real(pREAL), dimension(3,3), intent(in) :: &
|
||||||
Mp !< Mandel stress
|
Mp !< Mandel stress
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: &
|
||||||
ph, &
|
ph, &
|
||||||
en
|
en
|
||||||
|
|
||||||
real(pREAL), intent(out), dimension(param(ph)%sum_N_sl) :: &
|
real(pREAL), dimension(param(ph)%sum_N_sl), intent(out) :: &
|
||||||
dot_gamma_pos, &
|
dot_gamma
|
||||||
dot_gamma_neg
|
real(pREAL), dimension(param(ph)%sum_N_sl), optional, intent(out) :: &
|
||||||
real(pREAL), intent(out), dimension(param(ph)%sum_N_sl), optional :: &
|
ddot_gamma_dtau
|
||||||
ddot_gamma_dtau_pos, &
|
|
||||||
ddot_gamma_dtau_neg
|
|
||||||
|
|
||||||
real(pREAL), dimension(param(ph)%sum_N_sl) :: &
|
real(pREAL), dimension(param(ph)%sum_N_sl) :: &
|
||||||
tau_pos, &
|
tau_pos, &
|
||||||
tau_neg
|
tau_neg
|
||||||
integer :: i
|
integer :: i
|
||||||
|
|
||||||
|
|
||||||
associate(prm => param(ph), stt => state(ph))
|
associate(prm => param(ph), stt => state(ph))
|
||||||
|
|
||||||
do i = 1, prm%sum_N_sl
|
tau_pos = [(math_tensordot(Mp,prm%P_nS_pos(1:3,1:3,i)) - stt%chi(i,en),i=1,prm%sum_N_sl)]
|
||||||
tau_pos(i) = math_tensordot(Mp,prm%P_nS_pos(1:3,1:3,i)) - stt%chi(i,en)
|
tau_neg = [(math_tensordot(Mp,prm%P_nS_neg(1:3,1:3,i)) + stt%chi(i,en),i=1,prm%sum_N_sl)]
|
||||||
tau_neg(i) = merge(math_tensordot(Mp,prm%P_nS_neg(1:3,1:3,i)) - stt%chi(i,en), &
|
|
||||||
0.0_pREAL, prm%nonSchmidActive)
|
|
||||||
end do
|
|
||||||
|
|
||||||
where(dNeq0(tau_pos))
|
dot_gamma = merge(+1.0_pREAL,-1.0_pREAL, tau_pos>tau_neg) &
|
||||||
dot_gamma_pos = prm%dot_gamma_0 * merge(0.5_pREAL,1.0_pREAL, prm%nonSchmidActive) & ! 1/2 if non-Schmid active
|
* prm%dot_gamma_0 &
|
||||||
* sign(abs(tau_pos/stt%xi(:,en))**prm%n, tau_pos)
|
* (merge(tau_pos,tau_neg, tau_pos>tau_neg)/stt%xi(:,en))**prm%n
|
||||||
else where
|
|
||||||
dot_gamma_pos = 0.0_pREAL
|
|
||||||
end where
|
|
||||||
|
|
||||||
where(dNeq0(tau_neg))
|
if (present(ddot_gamma_dtau)) then
|
||||||
dot_gamma_neg = prm%dot_gamma_0 * 0.5_pREAL & ! only used if non-Schmid active, always 1/2
|
where(dNeq0(dot_gamma))
|
||||||
* sign(abs(tau_neg/stt%xi(:,en))**prm%n, tau_neg)
|
ddot_gamma_dtau = dot_gamma*prm%n/merge(tau_pos,tau_neg, tau_pos>tau_neg)
|
||||||
else where
|
|
||||||
dot_gamma_neg = 0.0_pREAL
|
|
||||||
end where
|
|
||||||
|
|
||||||
if (present(ddot_gamma_dtau_pos)) then
|
|
||||||
where(dNeq0(dot_gamma_pos))
|
|
||||||
ddot_gamma_dtau_pos = dot_gamma_pos*prm%n/tau_pos
|
|
||||||
else where
|
else where
|
||||||
ddot_gamma_dtau_pos = 0.0_pREAL
|
ddot_gamma_dtau = 0.0_pREAL
|
||||||
end where
|
|
||||||
end if
|
|
||||||
if (present(ddot_gamma_dtau_neg)) then
|
|
||||||
where(dNeq0(dot_gamma_neg))
|
|
||||||
ddot_gamma_dtau_neg = dot_gamma_neg*prm%n/tau_neg
|
|
||||||
else where
|
|
||||||
ddot_gamma_dtau_neg = 0.0_pREAL
|
|
||||||
end where
|
end where
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ module function plastic_phenopowerlaw_init() result(myPlasticity)
|
||||||
if (count(myPlasticity) == 0) return
|
if (count(myPlasticity) == 0) return
|
||||||
|
|
||||||
print'(/,1x,a)', '<<<+- phase:mechanical:plastic:phenopowerlaw init -+>>>'
|
print'(/,1x,a)', '<<<+- phase:mechanical:plastic:phenopowerlaw init -+>>>'
|
||||||
print'(/,a,i0)', ' # phases: ',count(myPlasticity); flush(IO_STDOUT)
|
print'(/,1x,a,1x,i0)', '# phases:',count(myPlasticity); flush(IO_STDOUT)
|
||||||
|
|
||||||
|
|
||||||
phases => config_material%get_dict('phase')
|
phases => config_material%get_dict('phase')
|
||||||
|
@ -123,7 +123,7 @@ module function plastic_phenopowerlaw_init() result(myPlasticity)
|
||||||
mech => phase%get_dict('mechanical')
|
mech => phase%get_dict('mechanical')
|
||||||
pl => mech%get_dict('plastic')
|
pl => mech%get_dict('plastic')
|
||||||
|
|
||||||
print'(/,1x,a,i0,a)', 'phase ',ph,': '//phases%key(ph)
|
print'(/,1x,a,1x,i0,a)', 'phase',ph,': '//phases%key(ph)
|
||||||
refs = config_listReferences(pl,indent=3)
|
refs = config_listReferences(pl,indent=3)
|
||||||
if (len(refs) > 0) print'(/,1x,a)', refs
|
if (len(refs) > 0) print'(/,1x,a)', refs
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue