renaming to fit paper and/or disloUCLA

This commit is contained in:
Martin Diehl 2019-03-20 09:46:49 +01:00
parent 5f53147e96
commit facef25f8e
1 changed files with 214 additions and 214 deletions

View File

@ -28,15 +28,15 @@ module plastic_dislotwin
rho_dip_ID, & rho_dip_ID, &
gamma_dot_sl_ID, & gamma_dot_sl_ID, &
gamma_sl_ID, & gamma_sl_ID, &
mfp_slip_ID, & Lambda_sl_ID, &
resolved_stress_slip_ID, & resolved_stress_slip_ID, &
threshold_stress_slip_ID, & threshold_stress_slip_ID, &
edge_dipole_distance_ID, & edge_dipole_distance_ID, &
f_tw_ID, & f_tw_ID, &
mfp_twin_ID, & Lambda_tw_ID, &
resolved_stress_twin_ID, & resolved_stress_twin_ID, &
threshold_stress_twin_ID, & threshold_stress_twin_ID, &
strain_trans_fraction_ID f_tr_ID
end enum end enum
type, private :: tParameters type, private :: tParameters
@ -72,7 +72,7 @@ module plastic_dislotwin
rho_dip_0, & !< initial dipole dislocation density per slip system rho_dip_0, & !< initial dipole dislocation density per slip system
b_sl, & !< absolute length of burgers vector [m] for each slip system b_sl, & !< absolute length of burgers vector [m] for each slip system
b_tw, & !< absolute length of burgers vector [m] for each twin system b_tw, & !< absolute length of burgers vector [m] for each twin system
burgers_trans, & !< absolute length of burgers vector [m] for each transformation system b_tr, & !< absolute length of burgers vector [m] for each transformation system
Qedge,& !< activation energy for glide [J] for each slip system Qedge,& !< activation energy for glide [J] for each slip system
v0, & !< dislocation velocity prefactor [m/s] for each slip system v0, & !< dislocation velocity prefactor [m/s] for each slip system
tau_peierls,& !< Peierls stress [Pa] for each slip system tau_peierls,& !< Peierls stress [Pa] for each slip system
@ -106,9 +106,9 @@ module plastic_dislotwin
C66_twin, & C66_twin, &
C66_trans C66_trans
integer :: & integer :: &
totalNslip, & !< total number of active slip system sum_N_sl, & !< total number of active slip system
totalNtwin, & !< total number of active twin system sum_N_tw, & !< total number of active twin system
totalNtrans !< total number of active transformation system sum_N_tr !< total number of active transformation system
integer, dimension(:), allocatable :: & integer, dimension(:), allocatable :: &
N_sl, & !< number of active slip systems for each family N_sl, & !< number of active slip systems for each family
N_tw, & !< number of active twin systems for each family N_tw, & !< number of active twin systems for each family
@ -265,8 +265,8 @@ subroutine plastic_dislotwin_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! slip related parameters ! slip related parameters
prm%N_sl = config%getInts('nslip',defaultVal=emptyIntArray) prm%N_sl = config%getInts('nslip',defaultVal=emptyIntArray)
prm%totalNslip = sum(prm%N_sl) prm%sum_N_sl = sum(prm%N_sl)
slipActive: if (prm%totalNslip > 0) then slipActive: if (prm%sum_N_sl > 0) then
prm%Schmid_slip = lattice_SchmidMatrix_slip(prm%N_sl,config%getString('lattice_structure'),& prm%Schmid_slip = lattice_SchmidMatrix_slip(prm%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal)) config%getFloat('c/a',defaultVal=0.0_pReal))
prm%h_sl_sl = lattice_interaction_SlipBySlip(prm%N_sl, & prm%h_sl_sl = lattice_interaction_SlipBySlip(prm%N_sl, &
@ -332,8 +332,8 @@ subroutine plastic_dislotwin_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! twin related parameters ! twin related parameters
prm%N_tw = config%getInts('ntwin', defaultVal=emptyIntArray) prm%N_tw = config%getInts('ntwin', defaultVal=emptyIntArray)
prm%totalNtwin = sum(prm%N_tw) prm%sum_N_tw = sum(prm%N_tw)
if (prm%totalNtwin > 0) then if (prm%sum_N_tw > 0) then
prm%Schmid_twin = lattice_SchmidMatrix_twin(prm%N_tw,config%getString('lattice_structure'),& prm%Schmid_twin = lattice_SchmidMatrix_twin(prm%N_tw,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal)) config%getFloat('c/a',defaultVal=0.0_pReal))
prm%h_tw_tw = lattice_interaction_TwinByTwin(prm%N_tw,& prm%h_tw_tw = lattice_interaction_TwinByTwin(prm%N_tw,&
@ -373,10 +373,10 @@ subroutine plastic_dislotwin_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! transformation related parameters ! transformation related parameters
prm%N_tr = config%getInts('ntrans', defaultVal=emptyIntArray) prm%N_tr = config%getInts('ntrans', defaultVal=emptyIntArray)
prm%totalNtrans = sum(prm%N_tr) prm%sum_N_tr = sum(prm%N_tr)
if (prm%totalNtrans > 0) then if (prm%sum_N_tr > 0) then
prm%burgers_trans = config%getFloats('transburgers') prm%b_tr = config%getFloats('transburgers')
prm%burgers_trans = math_expand(prm%burgers_trans,prm%N_tr) prm%b_tr = math_expand(prm%b_tr,prm%N_tr)
prm%transStackHeight = config%getFloat('transstackheight', defaultVal=0.0_pReal) ! ToDo: How to handle that??? prm%transStackHeight = config%getFloat('transstackheight', defaultVal=0.0_pReal) ! ToDo: How to handle that???
prm%Cmfptrans = config%getFloat('cmfptrans', defaultVal=0.0_pReal) ! ToDo: How to handle that??? prm%Cmfptrans = config%getFloat('cmfptrans', defaultVal=0.0_pReal) ! ToDo: How to handle that???
@ -410,27 +410,27 @@ subroutine plastic_dislotwin_init
prm%s = math_expand(prm%s,prm%N_tr) prm%s = math_expand(prm%s,prm%N_tr)
else else
allocate(prm%lamellarsize(0)) allocate(prm%lamellarsize(0))
allocate(prm%burgers_trans(0)) allocate(prm%b_tr(0))
endif endif
if (sum(prm%N_tw) > 0 .or. prm%totalNtrans > 0) then if (sum(prm%N_tw) > 0 .or. prm%sum_N_tr > 0) then
prm%SFE_0K = config%getFloat('sfe_0k') prm%SFE_0K = config%getFloat('sfe_0k')
prm%dSFE_dT = config%getFloat('dsfe_dt') prm%dSFE_dT = config%getFloat('dsfe_dt')
prm%VcrossSlip = config%getFloat('vcrossslip') prm%VcrossSlip = config%getFloat('vcrossslip')
endif endif
if (prm%totalNslip > 0 .and. prm%totalNtwin > 0) then if (prm%sum_N_sl > 0 .and. prm%sum_N_tw > 0) then
prm%h_sl_tw = lattice_interaction_SlipByTwin(prm%N_sl,prm%N_tw,& prm%h_sl_tw = lattice_interaction_SlipByTwin(prm%N_sl,prm%N_tw,&
config%getFloats('interaction_sliptwin'), & config%getFloats('interaction_sliptwin'), &
config%getString('lattice_structure')) config%getString('lattice_structure'))
if (prm%fccTwinTransNucleation .and. prm%totalNtwin > 12) write(6,*) 'mist' ! ToDo: implement better test. The model will fail also if N_tw is [6,6] if (prm%fccTwinTransNucleation .and. prm%sum_N_tw > 12) write(6,*) 'mist' ! ToDo: implement better test. The model will fail also if N_tw is [6,6]
endif endif
if (prm%totalNslip > 0 .and. prm%totalNtrans > 0) then if (prm%sum_N_sl > 0 .and. prm%sum_N_tr > 0) then
prm%interaction_SlipTrans = lattice_interaction_SlipByTrans(prm%N_sl,prm%N_tr,& prm%interaction_SlipTrans = lattice_interaction_SlipByTrans(prm%N_sl,prm%N_tr,&
config%getFloats('interaction_sliptrans'), & config%getFloats('interaction_sliptrans'), &
config%getString('lattice_structure')) config%getString('lattice_structure'))
if (prm%fccTwinTransNucleation .and. prm%totalNtrans > 12) write(6,*) 'mist' ! ToDo: implement better test. The model will fail also if N_tr is [6,6] if (prm%fccTwinTransNucleation .and. prm%sum_N_tr > 12) write(6,*) 'mist' ! ToDo: implement better test. The model will fail also if N_tr is [6,6]
endif endif
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -463,13 +463,13 @@ subroutine plastic_dislotwin_init
if (any(prm%atomicVolume <= 0.0_pReal)) & if (any(prm%atomicVolume <= 0.0_pReal)) &
call IO_error(211,el=p,ext_msg='cAtomicVolume ('//PLASTICITY_DISLOTWIN_label//')') call IO_error(211,el=p,ext_msg='cAtomicVolume ('//PLASTICITY_DISLOTWIN_label//')')
if (prm%totalNtwin > 0) then if (prm%sum_N_tw > 0) then
if (prm%aTol_rho <= 0.0_pReal) & if (prm%aTol_rho <= 0.0_pReal) &
call IO_error(211,el=p,ext_msg='aTol_rho ('//PLASTICITY_DISLOTWIN_label//')') call IO_error(211,el=p,ext_msg='aTol_rho ('//PLASTICITY_DISLOTWIN_label//')')
if (prm%aTol_f_tw <= 0.0_pReal) & if (prm%aTol_f_tw <= 0.0_pReal) &
call IO_error(211,el=p,ext_msg='aTol_f_tw ('//PLASTICITY_DISLOTWIN_label//')') call IO_error(211,el=p,ext_msg='aTol_f_tw ('//PLASTICITY_DISLOTWIN_label//')')
endif endif
if (prm%totalNtrans > 0) then if (prm%sum_N_tr > 0) then
if (prm%aTol_f_tr <= 0.0_pReal) & if (prm%aTol_f_tr <= 0.0_pReal) &
call IO_error(211,el=p,ext_msg='aTol_f_tr ('//PLASTICITY_DISLOTWIN_label//')') call IO_error(211,el=p,ext_msg='aTol_f_tr ('//PLASTICITY_DISLOTWIN_label//')')
endif endif
@ -480,43 +480,43 @@ subroutine plastic_dislotwin_init
outputID = undefined_ID outputID = undefined_ID
select case(outputs(i)) select case(outputs(i))
case ('edge_density') case ('edge_density')
outputID = merge(rho_mob_ID,undefined_ID,prm%totalNslip > 0) outputID = merge(rho_mob_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%totalNslip outputSize = prm%sum_N_sl
case ('dipole_density') case ('dipole_density')
outputID = merge(rho_dip_ID,undefined_ID,prm%totalNslip > 0) outputID = merge(rho_dip_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%totalNslip outputSize = prm%sum_N_sl
case ('shear_rate_slip','shearrate_slip') case ('shear_rate_slip','shearrate_slip')
outputID = merge(gamma_dot_sl_ID,undefined_ID,prm%totalNslip > 0) outputID = merge(gamma_dot_sl_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%totalNslip outputSize = prm%sum_N_sl
case ('accumulated_shear_slip') case ('accumulated_shear_slip')
outputID = merge(gamma_sl_ID,undefined_ID,prm%totalNslip > 0) outputID = merge(gamma_sl_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%totalNslip outputSize = prm%sum_N_sl
case ('mfp_slip') case ('mfp_slip')
outputID = merge(mfp_slip_ID,undefined_ID,prm%totalNslip > 0) outputID = merge(Lambda_sl_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%totalNslip outputSize = prm%sum_N_sl
case ('resolved_stress_slip') case ('resolved_stress_slip')
outputID = merge(resolved_stress_slip_ID,undefined_ID,prm%totalNslip > 0) outputID = merge(resolved_stress_slip_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%totalNslip outputSize = prm%sum_N_sl
case ('threshold_stress_slip') case ('threshold_stress_slip')
outputID= merge(threshold_stress_slip_ID,undefined_ID,prm%totalNslip > 0) outputID= merge(threshold_stress_slip_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%totalNslip outputSize = prm%sum_N_sl
case ('twin_fraction') case ('twin_fraction')
outputID = merge(f_tw_ID,undefined_ID,prm%totalNtwin >0) outputID = merge(f_tw_ID,undefined_ID,prm%sum_N_tw >0)
outputSize = prm%totalNtwin outputSize = prm%sum_N_tw
case ('mfp_twin') case ('mfp_twin')
outputID = merge(mfp_twin_ID,undefined_ID,prm%totalNtwin >0) outputID = merge(Lambda_tw_ID,undefined_ID,prm%sum_N_tw >0)
outputSize = prm%totalNtwin outputSize = prm%sum_N_tw
case ('resolved_stress_twin') case ('resolved_stress_twin')
outputID = merge(resolved_stress_twin_ID,undefined_ID,prm%totalNtwin >0) outputID = merge(resolved_stress_twin_ID,undefined_ID,prm%sum_N_tw >0)
outputSize = prm%totalNtwin outputSize = prm%sum_N_tw
case ('threshold_stress_twin') case ('threshold_stress_twin')
outputID = merge(threshold_stress_twin_ID,undefined_ID,prm%totalNtwin >0) outputID = merge(threshold_stress_twin_ID,undefined_ID,prm%sum_N_tw >0)
outputSize = prm%totalNtwin outputSize = prm%sum_N_tw
case ('strain_trans_fraction') case ('strain_trans_fraction')
outputID = strain_trans_fraction_ID outputID = f_tr_ID
outputSize = prm%totalNtrans outputSize = prm%sum_N_tr
end select end select
@ -531,34 +531,34 @@ subroutine plastic_dislotwin_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NipcMyPhase = count(material_phase == p) NipcMyPhase = count(material_phase == p)
sizeDotState = size(['rho ','rhoDip ','accshearslip']) * prm%totalNslip & sizeDotState = size(['rho ','rhoDip ','accshearslip']) * prm%sum_N_sl &
+ size(['twinFraction']) * prm%totalNtwin & + size(['twinFraction']) * prm%sum_N_tw &
+ size(['strainTransFraction']) * prm%totalNtrans + size(['strainTransFraction']) * prm%sum_N_tr
sizeState = sizeDotState sizeState = sizeDotState
call material_allocatePlasticState(p,NipcMyPhase,sizeState,sizeDotState,0, & call material_allocatePlasticState(p,NipcMyPhase,sizeState,sizeDotState,0, &
prm%totalNslip,prm%totalNtwin,prm%totalNtrans) prm%sum_N_sl,prm%sum_N_tw,prm%sum_N_tr)
plasticState(p)%sizePostResults = sum(plastic_dislotwin_sizePostResult(:,phase_plasticityInstance(p))) plasticState(p)%sizePostResults = sum(plastic_dislotwin_sizePostResult(:,phase_plasticityInstance(p)))
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! locally defined state aliases and initialization of state0 and aTolState ! locally defined state aliases and initialization of state0 and aTolState
startIndex = 1 startIndex = 1
endIndex = prm%totalNslip endIndex = prm%sum_N_sl
stt%rhoEdge=>plasticState(p)%state(startIndex:endIndex,:) stt%rhoEdge=>plasticState(p)%state(startIndex:endIndex,:)
stt%rhoEdge= spread(prm%rho_mob_0,2,NipcMyPhase) stt%rhoEdge= spread(prm%rho_mob_0,2,NipcMyPhase)
dot%rhoEdge=>plasticState(p)%dotState(startIndex:endIndex,:) dot%rhoEdge=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%aTolState(startIndex:endIndex) = prm%aTol_rho plasticState(p)%aTolState(startIndex:endIndex) = prm%aTol_rho
startIndex = endIndex + 1 startIndex = endIndex + 1
endIndex = endIndex + prm%totalNslip endIndex = endIndex + prm%sum_N_sl
stt%rhoEdgeDip=>plasticState(p)%state(startIndex:endIndex,:) stt%rhoEdgeDip=>plasticState(p)%state(startIndex:endIndex,:)
stt%rhoEdgeDip= spread(prm%rho_dip_0,2,NipcMyPhase) stt%rhoEdgeDip= spread(prm%rho_dip_0,2,NipcMyPhase)
dot%rhoEdgeDip=>plasticState(p)%dotState(startIndex:endIndex,:) dot%rhoEdgeDip=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%aTolState(startIndex:endIndex) = prm%aTol_rho plasticState(p)%aTolState(startIndex:endIndex) = prm%aTol_rho
startIndex = endIndex + 1 startIndex = endIndex + 1
endIndex = endIndex + prm%totalNslip endIndex = endIndex + prm%sum_N_sl
stt%accshear_slip=>plasticState(p)%state(startIndex:endIndex,:) stt%accshear_slip=>plasticState(p)%state(startIndex:endIndex,:)
dot%accshear_slip=>plasticState(p)%dotState(startIndex:endIndex,:) dot%accshear_slip=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%aTolState(startIndex:endIndex) = 1.0e6_pReal !ToDo: better make optional parameter plasticState(p)%aTolState(startIndex:endIndex) = 1.0e6_pReal !ToDo: better make optional parameter
@ -567,29 +567,29 @@ subroutine plastic_dislotwin_init
plasticState(p)%accumulatedSlip => plasticState(p)%state(startIndex:endIndex,:) plasticState(p)%accumulatedSlip => plasticState(p)%state(startIndex:endIndex,:)
startIndex = endIndex + 1 startIndex = endIndex + 1
endIndex = endIndex + prm%totalNtwin endIndex = endIndex + prm%sum_N_tw
stt%twinFraction=>plasticState(p)%state(startIndex:endIndex,:) stt%twinFraction=>plasticState(p)%state(startIndex:endIndex,:)
dot%twinFraction=>plasticState(p)%dotState(startIndex:endIndex,:) dot%twinFraction=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%aTolState(startIndex:endIndex) = prm%aTol_f_tw plasticState(p)%aTolState(startIndex:endIndex) = prm%aTol_f_tw
startIndex = endIndex + 1 startIndex = endIndex + 1
endIndex = endIndex + prm%totalNtrans endIndex = endIndex + prm%sum_N_tr
stt%strainTransFraction=>plasticState(p)%state(startIndex:endIndex,:) stt%strainTransFraction=>plasticState(p)%state(startIndex:endIndex,:)
dot%strainTransFraction=>plasticState(p)%dotState(startIndex:endIndex,:) dot%strainTransFraction=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%aTolState(startIndex:endIndex) = prm%aTol_f_tr plasticState(p)%aTolState(startIndex:endIndex) = prm%aTol_f_tr
allocate(dst%Lambda_sl (prm%totalNslip, NipcMyPhase),source=0.0_pReal) allocate(dst%Lambda_sl (prm%sum_N_sl, NipcMyPhase),source=0.0_pReal)
allocate(dst%tau_pass (prm%totalNslip, NipcMyPhase),source=0.0_pReal) allocate(dst%tau_pass (prm%sum_N_sl, NipcMyPhase),source=0.0_pReal)
allocate(dst%Lambda_tw (prm%totalNtwin, NipcMyPhase),source=0.0_pReal) allocate(dst%Lambda_tw (prm%sum_N_tw, NipcMyPhase),source=0.0_pReal)
allocate(dst%threshold_stress_twin (prm%totalNtwin, NipcMyPhase),source=0.0_pReal) allocate(dst%threshold_stress_twin (prm%sum_N_tw, NipcMyPhase),source=0.0_pReal)
allocate(dst%tau_r_twin (prm%totalNtwin, NipcMyPhase),source=0.0_pReal) allocate(dst%tau_r_twin (prm%sum_N_tw, NipcMyPhase),source=0.0_pReal)
allocate(dst%twinVolume (prm%totalNtwin, NipcMyPhase),source=0.0_pReal) allocate(dst%twinVolume (prm%sum_N_tw, NipcMyPhase),source=0.0_pReal)
allocate(dst%Lambda_tr (prm%totalNtrans,NipcMyPhase),source=0.0_pReal) allocate(dst%Lambda_tr (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal)
allocate(dst%threshold_stress_trans(prm%totalNtrans,NipcMyPhase),source=0.0_pReal) allocate(dst%threshold_stress_trans(prm%sum_N_tr,NipcMyPhase),source=0.0_pReal)
allocate(dst%tau_r_trans (prm%totalNtrans,NipcMyPhase),source=0.0_pReal) allocate(dst%tau_r_trans (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal)
allocate(dst%martensiteVolume (prm%totalNtrans,NipcMyPhase),source=0.0_pReal) allocate(dst%martensiteVolume (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal)
plasticState(p)%state0 = plasticState(p)%state ! ToDo: this could be done centrally plasticState(p)%state0 = plasticState(p)%state ! ToDo: this could be done centrally
@ -627,15 +627,15 @@ function plastic_dislotwin_homogenizedC(ipc,ip,el) result(homogenizedC)
stt => state(phase_plasticityInstance(material_phase(ipc,ip,el)))) stt => state(phase_plasticityInstance(material_phase(ipc,ip,el))))
f_unrotated = 1.0_pReal & f_unrotated = 1.0_pReal &
- sum(stt%twinFraction(1:prm%totalNtwin,of)) & - sum(stt%twinFraction(1:prm%sum_N_tw,of)) &
- sum(stt%strainTransFraction(1:prm%totalNtrans,of)) - sum(stt%strainTransFraction(1:prm%sum_N_tr,of))
homogenizedC = f_unrotated * prm%C66 homogenizedC = f_unrotated * prm%C66
do i=1,prm%totalNtwin do i=1,prm%sum_N_tw
homogenizedC = homogenizedC & homogenizedC = homogenizedC &
+ stt%twinFraction(i,of)*prm%C66_twin(1:6,1:6,i) + stt%twinFraction(i,of)*prm%C66_twin(1:6,1:6,i)
enddo enddo
do i=1,prm%totalNtrans do i=1,prm%sum_N_tr
homogenizedC = homogenizedC & homogenizedC = homogenizedC &
+ stt%strainTransFraction(i,of)*prm%C66_trans(1:6,1:6,i) + stt%strainTransFraction(i,of)*prm%C66_trans(1:6,1:6,i)
enddo enddo
@ -669,15 +669,15 @@ subroutine plastic_dislotwin_LpAndItsTangent(Lp,dLp_dMp,Mp,Temperature,instance,
integer :: i,k,l,m,n integer :: i,k,l,m,n
real(pReal) :: f_unrotated,StressRatio_p,& real(pReal) :: f_unrotated,StressRatio_p,&
BoltzmannRatio, & BoltzmannRatio, &
dgdot_dtau, & dgamma_dtau, &
tau tau
real(pReal), dimension(param(instance)%totalNslip) :: & real(pReal), dimension(param(instance)%sum_N_sl) :: &
gdot_slip,dgdot_dtau_slip dot_gamma_sl,dgamma_dtau_slip
real(pReal), dimension(param(instance)%totalNtwin) :: & real(pReal), dimension(param(instance)%sum_N_tw) :: &
gdot_twin,dgdot_dtau_twin dot_gamma_twin,dgamma_dtau_twin
real(pReal), dimension(param(instance)%totalNtrans) :: & real(pReal), dimension(param(instance)%sum_N_tr) :: &
gdot_trans,dgdot_dtau_trans dot_gamma_trans,dgamma_dtau_trans
real(pReal):: gdot_sb real(pReal):: dot_gamma_sb
real(pReal), dimension(3,3) :: eigVectors, Schmid_shearBand real(pReal), dimension(3,3) :: eigVectors, Schmid_shearBand
real(pReal), dimension(3) :: eigValues real(pReal), dimension(3) :: eigValues
logical :: error logical :: error
@ -704,18 +704,18 @@ subroutine plastic_dislotwin_LpAndItsTangent(Lp,dLp_dMp,Mp,Temperature,instance,
associate(prm => param(instance), stt => state(instance)) associate(prm => param(instance), stt => state(instance))
f_unrotated = 1.0_pReal & f_unrotated = 1.0_pReal &
- sum(stt%twinFraction(1:prm%totalNtwin,of)) & - sum(stt%twinFraction(1:prm%sum_N_tw,of)) &
- sum(stt%strainTransFraction(1:prm%totalNtrans,of)) - sum(stt%strainTransFraction(1:prm%sum_N_tr,of))
Lp = 0.0_pReal Lp = 0.0_pReal
dLp_dMp = 0.0_pReal dLp_dMp = 0.0_pReal
call kinetics_slip(Mp,temperature,instance,of,gdot_slip,dgdot_dtau_slip) call kinetics_slip(Mp,temperature,instance,of,dot_gamma_sl,dgamma_dtau_slip)
slipContribution: do i = 1, prm%totalNslip slipContribution: do i = 1, prm%sum_N_sl
Lp = Lp + gdot_slip(i)*prm%Schmid_slip(1:3,1:3,i) Lp = Lp + dot_gamma_sl(i)*prm%Schmid_slip(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) &
+ dgdot_dtau_slip(i) * prm%Schmid_slip(k,l,i) * prm%Schmid_slip(m,n,i) + dgamma_dtau_slip(i) * prm%Schmid_slip(k,l,i) * prm%Schmid_slip(m,n,i)
enddo slipContribution enddo slipContribution
!ToDo: Why do this before shear banding? !ToDo: Why do this before shear banding?
@ -734,34 +734,34 @@ subroutine plastic_dislotwin_LpAndItsTangent(Lp,dLp_dMp,Mp,Temperature,instance,
significantShearBandStress: if (abs(tau) > tol_math_check) then significantShearBandStress: if (abs(tau) > tol_math_check) then
StressRatio_p = (abs(tau)/prm%sbResistance)**prm%pShearBand StressRatio_p = (abs(tau)/prm%sbResistance)**prm%pShearBand
gdot_sb = sign(prm%sbVelocity*exp(-BoltzmannRatio*(1-StressRatio_p)**prm%qShearBand), tau) dot_gamma_sb = sign(prm%sbVelocity*exp(-BoltzmannRatio*(1-StressRatio_p)**prm%qShearBand), tau)
dgdot_dtau = abs(gdot_sb)*BoltzmannRatio* prm%pShearBand*prm%qShearBand/ prm%sbResistance & dgamma_dtau = abs(dot_gamma_sb)*BoltzmannRatio* prm%pShearBand*prm%qShearBand/ prm%sbResistance &
* (abs(tau)/prm%sbResistance)**(prm%pShearBand-1.0_pReal) & * (abs(tau)/prm%sbResistance)**(prm%pShearBand-1.0_pReal) &
* (1.0_pReal-StressRatio_p)**(prm%qShearBand-1.0_pReal) * (1.0_pReal-StressRatio_p)**(prm%qShearBand-1.0_pReal)
Lp = Lp + gdot_sb * Schmid_shearBand Lp = Lp + dot_gamma_sb * Schmid_shearBand
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) &
+ dgdot_dtau * Schmid_shearBand(k,l) * Schmid_shearBand(m,n) + dgamma_dtau * Schmid_shearBand(k,l) * Schmid_shearBand(m,n)
endif significantShearBandStress endif significantShearBandStress
enddo enddo
endif shearBandingContribution endif shearBandingContribution
call kinetics_twin(Mp,temperature,gdot_slip,instance,of,gdot_twin,dgdot_dtau_twin) call kinetics_twin(Mp,temperature,dot_gamma_sl,instance,of,dot_gamma_twin,dgamma_dtau_twin)
twinContibution: do i = 1, prm%totalNtwin twinContibution: do i = 1, prm%sum_N_tw
Lp = Lp + gdot_twin(i)*prm%Schmid_twin(1:3,1:3,i) * f_unrotated Lp = Lp + dot_gamma_twin(i)*prm%Schmid_twin(1:3,1:3,i) * f_unrotated
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) &
+ dgdot_dtau_twin(i)* prm%Schmid_twin(k,l,i)*prm%Schmid_twin(m,n,i) * f_unrotated + dgamma_dtau_twin(i)* prm%Schmid_twin(k,l,i)*prm%Schmid_twin(m,n,i) * f_unrotated
enddo twinContibution enddo twinContibution
call kinetics_twin(Mp,temperature,gdot_slip,instance,of,gdot_trans,dgdot_dtau_trans) call kinetics_twin(Mp,temperature,dot_gamma_sl,instance,of,dot_gamma_trans,dgamma_dtau_trans)
transContibution: do i = 1, prm%totalNtrans transContibution: do i = 1, prm%sum_N_tr
Lp = Lp + gdot_trans(i)*prm%Schmid_trans(1:3,1:3,i) * f_unrotated Lp = Lp + dot_gamma_trans(i)*prm%Schmid_trans(1:3,1:3,i) * f_unrotated
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) &
+ dgdot_dtau_trans(i)* prm%Schmid_trans(k,l,i)*prm%Schmid_trans(m,n,i) * f_unrotated + dgamma_dtau_trans(i)* prm%Schmid_trans(k,l,i)*prm%Schmid_trans(m,n,i) * f_unrotated
enddo transContibution enddo transContibution
@ -799,30 +799,30 @@ subroutine plastic_dislotwin_dotState(Mp,Temperature,instance,of)
EdgeDipDistance, ClimbVelocity,DotRhoEdgeDipClimb,DotRhoEdgeDipAnnihilation, & EdgeDipDistance, ClimbVelocity,DotRhoEdgeDipClimb,DotRhoEdgeDipAnnihilation, &
DotRhoDipFormation,DotRhoEdgeEdgeAnnihilation, & DotRhoDipFormation,DotRhoEdgeEdgeAnnihilation, &
tau tau
real(pReal), dimension(param(instance)%totalNslip) :: & real(pReal), dimension(param(instance)%sum_N_sl) :: &
EdgeDipMinDistance, & EdgeDipMinDistance, &
DotRhoMultiplication, & DotRhoMultiplication, &
gdot_slip dot_gamma_sl
real(pReal), dimension(param(instance)%totalNtwin) :: & real(pReal), dimension(param(instance)%sum_N_tw) :: &
gdot_twin dot_gamma_twin
real(pReal), dimension(param(instance)%totalNtrans) :: & real(pReal), dimension(param(instance)%sum_N_tr) :: &
gdot_trans dot_gamma_trans
associate(prm => param(instance), stt => state(instance), & associate(prm => param(instance), stt => state(instance), &
dot => dotstate(instance), dst => microstructure(instance)) dot => dotstate(instance), dst => microstructure(instance))
f_unrotated = 1.0_pReal & f_unrotated = 1.0_pReal &
- sum(stt%twinFraction(1:prm%totalNtwin,of)) & - sum(stt%twinFraction(1:prm%sum_N_tw,of)) &
- sum(stt%strainTransFraction(1:prm%totalNtrans,of)) - sum(stt%strainTransFraction(1:prm%sum_N_tr,of))
VacancyDiffusion = prm%D0*exp(-prm%Qsd/(kB*Temperature)) VacancyDiffusion = prm%D0*exp(-prm%Qsd/(kB*Temperature))
call kinetics_slip(Mp,temperature,instance,of,gdot_slip) call kinetics_slip(Mp,temperature,instance,of,dot_gamma_sl)
dot%accshear_slip(:,of) = abs(gdot_slip) dot%accshear_slip(:,of) = abs(dot_gamma_sl)
DotRhoMultiplication = abs(gdot_slip)/(prm%b_sl*dst%Lambda_sl(:,of)) DotRhoMultiplication = abs(dot_gamma_sl)/(prm%b_sl*dst%Lambda_sl(:,of))
EdgeDipMinDistance = prm%CEdgeDipMinDistance*prm%b_sl EdgeDipMinDistance = prm%CEdgeDipMinDistance*prm%b_sl
slipState: do i = 1, prm%totalNslip slipState: do i = 1, prm%sum_N_sl
tau = math_mul33xx33(Mp,prm%Schmid_slip(1:3,1:3,i)) tau = math_mul33xx33(Mp,prm%Schmid_slip(1:3,1:3,i))
significantSlipStress: if (dEq0(tau)) then significantSlipStress: if (dEq0(tau)) then
@ -835,7 +835,7 @@ subroutine plastic_dislotwin_dotState(Mp,Temperature,instance,of)
if (prm%dipoleFormation) then if (prm%dipoleFormation) then
DotRhoDipFormation = 2.0_pReal*(EdgeDipDistance-EdgeDipMinDistance(i))/prm%b_sl(i) & DotRhoDipFormation = 2.0_pReal*(EdgeDipDistance-EdgeDipMinDistance(i))/prm%b_sl(i) &
* stt%rhoEdge(i,of)*abs(gdot_slip(i)) * stt%rhoEdge(i,of)*abs(dot_gamma_sl(i))
else else
DotRhoDipFormation = 0.0_pReal DotRhoDipFormation = 0.0_pReal
endif endif
@ -852,20 +852,20 @@ subroutine plastic_dislotwin_dotState(Mp,Temperature,instance,of)
!* Spontaneous annihilation of 2 single edge dislocations !* Spontaneous annihilation of 2 single edge dislocations
DotRhoEdgeEdgeAnnihilation = 2.0_pReal*EdgeDipMinDistance(i)/prm%b_sl(i) & DotRhoEdgeEdgeAnnihilation = 2.0_pReal*EdgeDipMinDistance(i)/prm%b_sl(i) &
* stt%rhoEdge(i,of)*abs(gdot_slip(i)) * stt%rhoEdge(i,of)*abs(dot_gamma_sl(i))
!* Spontaneous annihilation of a single edge dislocation with a dipole constituent !* Spontaneous annihilation of a single edge dislocation with a dipole constituent
DotRhoEdgeDipAnnihilation = 2.0_pReal*EdgeDipMinDistance(i)/prm%b_sl(i) & DotRhoEdgeDipAnnihilation = 2.0_pReal*EdgeDipMinDistance(i)/prm%b_sl(i) &
* stt%rhoEdgeDip(i,of)*abs(gdot_slip(i)) * stt%rhoEdgeDip(i,of)*abs(dot_gamma_sl(i))
dot%rhoEdge(i,of) = DotRhoMultiplication(i)-DotRhoDipFormation-DotRhoEdgeEdgeAnnihilation dot%rhoEdge(i,of) = DotRhoMultiplication(i)-DotRhoDipFormation-DotRhoEdgeEdgeAnnihilation
dot%rhoEdgeDip(i,of) = DotRhoDipFormation-DotRhoEdgeDipAnnihilation-DotRhoEdgeDipClimb dot%rhoEdgeDip(i,of) = DotRhoDipFormation-DotRhoEdgeDipAnnihilation-DotRhoEdgeDipClimb
enddo slipState enddo slipState
call kinetics_twin(Mp,temperature,gdot_slip,instance,of,gdot_twin) call kinetics_twin(Mp,temperature,dot_gamma_sl,instance,of,dot_gamma_twin)
dot%twinFraction(:,of) = f_unrotated*gdot_twin/prm%shear_twin dot%twinFraction(:,of) = f_unrotated*dot_gamma_twin/prm%shear_twin
call kinetics_trans(Mp,temperature,gdot_slip,instance,of,gdot_trans) call kinetics_trans(Mp,temperature,dot_gamma_sl,instance,of,dot_gamma_trans)
dot%twinFraction(:,of) = f_unrotated*gdot_trans dot%twinFraction(:,of) = f_unrotated*dot_gamma_trans
end associate end associate
@ -890,13 +890,13 @@ subroutine plastic_dislotwin_dependentState(temperature,instance,of)
i i
real(pReal) :: & real(pReal) :: &
sumf_twin,SFE,sumf_trans sumf_twin,SFE,sumf_trans
real(pReal), dimension(param(instance)%totalNslip) :: & real(pReal), dimension(param(instance)%sum_N_sl) :: &
lambda_sl_sl_inv, & !* 1/mean free distance between 2 forest dislocations seen by a moving dislocation lambda_sl_sl_inv, & !* 1/mean free distance between 2 forest dislocations seen by a moving dislocation
lambda_sl_tw_inv, & !* 1/mean free distance between 2 twin stacks from different systems seen by a moving dislocation lambda_sl_tw_inv, & !* 1/mean free distance between 2 twin stacks from different systems seen by a moving dislocation
lambda_sl_tr_inv !* 1/mean free distance between 2 martensite lamellar from different systems seen by a moving dislocation lambda_sl_tr_inv !* 1/mean free distance between 2 martensite lamellar from different systems seen by a moving dislocation
real(pReal), dimension(param(instance)%totalNtwin) :: & real(pReal), dimension(param(instance)%sum_N_tw) :: &
lambda_tw_tw_inv !* 1/mean free distance between 2 twin stacks from different systems seen by a growing twin lambda_tw_tw_inv !* 1/mean free distance between 2 twin stacks from different systems seen by a growing twin
real(pReal), dimension(param(instance)%totalNtrans) :: & real(pReal), dimension(param(instance)%sum_N_tr) :: &
lambda_tr_tr_inv !* 1/mean free distance between 2 martensite stacks from different systems seen by a growing martensite (1/lambda_trans) lambda_tr_tr_inv !* 1/mean free distance between 2 martensite stacks from different systems seen by a growing martensite (1/lambda_trans)
real(pReal), dimension(:), allocatable :: & real(pReal), dimension(:), allocatable :: &
@ -909,45 +909,45 @@ subroutine plastic_dislotwin_dependentState(temperature,instance,of)
stt => state(instance),& stt => state(instance),&
dst => microstructure(instance)) dst => microstructure(instance))
sumf_twin = sum(stt%twinFraction(1:prm%totalNtwin,of)) sumf_twin = sum(stt%twinFraction(1:prm%sum_N_tw,of))
sumf_trans = sum(stt%strainTransFraction(1:prm%totalNtrans,of)) sumf_trans = sum(stt%strainTransFraction(1:prm%sum_N_tr,of))
SFE = prm%SFE_0K + prm%dSFE_dT * Temperature SFE = prm%SFE_0K + prm%dSFE_dT * Temperature
!* rescaled volume fraction for topology !* rescaled volume fraction for topology
fOverStacksize = stt%twinFraction(1:prm%totalNtwin,of)/prm%twinsize !ToDo: this is per system fOverStacksize = stt%twinFraction(1:prm%sum_N_tw,of)/prm%twinsize !ToDo: this is per system
ftransOverLamellarSize = sumf_trans/prm%lamellarsize !ToDo: But this not ... ftransOverLamellarSize = sumf_trans/prm%lamellarsize !ToDo: But this not ...
!Todo: Physically ok, but naming could be adjusted !Todo: Physically ok, but naming could be adjusted
forall (i = 1:prm%totalNslip) & forall (i = 1:prm%sum_N_sl) &
lambda_sl_sl_inv(i) = & lambda_sl_sl_inv(i) = &
sqrt(dot_product((stt%rhoEdge(1:prm%totalNslip,of)+stt%rhoEdgeDip(1:prm%totalNslip,of)),& sqrt(dot_product((stt%rhoEdge(1:prm%sum_N_sl,of)+stt%rhoEdgeDip(1:prm%sum_N_sl,of)),&
prm%forestProjection(1:prm%totalNslip,i)))/prm%CLambdaSlip(i) ! change order and use matmul prm%forestProjection(1:prm%sum_N_sl,i)))/prm%CLambdaSlip(i) ! change order and use matmul
if (prm%totalNtwin > 0 .and. prm%totalNslip > 0) & if (prm%sum_N_tw > 0 .and. prm%sum_N_sl > 0) &
lambda_sl_tw_inv = & lambda_sl_tw_inv = &
matmul(transpose(prm%h_sl_tw),fOverStacksize)/(1.0_pReal-sumf_twin) ! ToDo: Change order/no transpose matmul(transpose(prm%h_sl_tw),fOverStacksize)/(1.0_pReal-sumf_twin) ! ToDo: Change order/no transpose
!ToDo: needed? if (prm%totalNtwin > 0) & !ToDo: needed? if (prm%sum_N_tw > 0) &
lambda_tw_tw_inv = matmul(prm%h_tw_tw,fOverStacksize)/(1.0_pReal-sumf_twin) lambda_tw_tw_inv = matmul(prm%h_tw_tw,fOverStacksize)/(1.0_pReal-sumf_twin)
if (prm%totalNtrans > 0 .and. prm%totalNslip > 0) & if (prm%sum_N_tr > 0 .and. prm%sum_N_sl > 0) &
lambda_sl_tr_inv = & ! ToDo: does not work if N_tr is not 12 lambda_sl_tr_inv = & ! ToDo: does not work if N_tr is not 12
matmul(transpose(prm%interaction_SlipTrans),ftransOverLamellarSize)/(1.0_pReal-sumf_trans) ! ToDo: remove transpose matmul(transpose(prm%interaction_SlipTrans),ftransOverLamellarSize)/(1.0_pReal-sumf_trans) ! ToDo: remove transpose
!ToDo: needed? if (prm%totalNtrans > 0) & !ToDo: needed? if (prm%sum_N_tr > 0) &
lambda_tr_tr_inv = matmul(prm%interaction_TransTrans,ftransOverLamellarSize)/(1.0_pReal-sumf_trans) lambda_tr_tr_inv = matmul(prm%interaction_TransTrans,ftransOverLamellarSize)/(1.0_pReal-sumf_trans)
if ((prm%totalNtwin > 0) .or. (prm%totalNtrans > 0)) then ! ToDo: Change order if ((prm%sum_N_tw > 0) .or. (prm%sum_N_tr > 0)) then ! ToDo: Change order
dst%Lambda_sl(:,of) = & dst%Lambda_sl(:,of) = &
prm%GrainSize/(1.0_pReal+prm%GrainSize*& prm%GrainSize/(1.0_pReal+prm%GrainSize*&
(lambda_sl_sl_inv + lambda_sl_tw_inv + lambda_sl_tr_inv)) (lambda_sl_sl_inv + lambda_sl_tw_inv + lambda_sl_tr_inv))
@ -962,19 +962,19 @@ subroutine plastic_dislotwin_dependentState(temperature,instance,of)
dst%Lambda_tr(:,of) = prm%Cmfptrans*prm%GrainSize/(1.0_pReal+prm%GrainSize*lambda_tr_tr_inv) dst%Lambda_tr(:,of) = prm%Cmfptrans*prm%GrainSize/(1.0_pReal+prm%GrainSize*lambda_tr_tr_inv)
!* threshold stress for dislocation motion !* threshold stress for dislocation motion
forall (i = 1:prm%totalNslip) dst%tau_pass(i,of) = & forall (i = 1:prm%sum_N_sl) dst%tau_pass(i,of) = &
prm%mu*prm%b_sl(i)*& prm%mu*prm%b_sl(i)*&
sqrt(dot_product(stt%rhoEdge(1:prm%totalNslip,of)+stt%rhoEdgeDip(1:prm%totalNslip,of),& sqrt(dot_product(stt%rhoEdge(1:prm%sum_N_sl,of)+stt%rhoEdgeDip(1:prm%sum_N_sl,of),&
prm%h_sl_sl(:,i))) prm%h_sl_sl(:,i)))
!* threshold stress for growing twin/martensite !* threshold stress for growing twin/martensite
if(prm%totalNtwin == prm%totalNslip) & if(prm%sum_N_tw == prm%sum_N_sl) &
dst%threshold_stress_twin(:,of) = & dst%threshold_stress_twin(:,of) = &
(SFE/(3.0_pReal*prm%b_tw)+ 3.0_pReal*prm%b_tw*prm%mu/(prm%L0_twin*prm%b_sl)) ! slip burgers here correct? (SFE/(3.0_pReal*prm%b_tw)+ 3.0_pReal*prm%b_tw*prm%mu/(prm%L0_twin*prm%b_sl)) ! slip burgers here correct?
if(prm%totalNtrans == prm%totalNslip) & if(prm%sum_N_tr == prm%sum_N_sl) &
dst%threshold_stress_trans(:,of) = & dst%threshold_stress_trans(:,of) = &
(SFE/(3.0_pReal*prm%burgers_trans) + 3.0_pReal*prm%burgers_trans*prm%mu/& (SFE/(3.0_pReal*prm%b_tr) + 3.0_pReal*prm%b_tr*prm%mu/&
(prm%L0_trans*prm%b_sl) + prm%transStackHeight*prm%deltaG/ (3.0_pReal*prm%burgers_trans) ) (prm%L0_trans*prm%b_sl) + prm%transStackHeight*prm%deltaG/ (3.0_pReal*prm%b_tr) )
dst%twinVolume(:,of) = (PI/4.0_pReal)*prm%twinsize*dst%Lambda_tw(:,of)**2.0_pReal dst%twinVolume(:,of) = (PI/4.0_pReal)*prm%twinsize*dst%Lambda_tw(:,of)**2.0_pReal
@ -984,8 +984,8 @@ subroutine plastic_dislotwin_dependentState(temperature,instance,of)
x0 = prm%mu*prm%b_tw**2.0_pReal/(SFE*8.0_pReal*PI)*(2.0_pReal+prm%nu)/(1.0_pReal-prm%nu) ! ToDo: In the paper, this is the burgers vector for slip x0 = prm%mu*prm%b_tw**2.0_pReal/(SFE*8.0_pReal*PI)*(2.0_pReal+prm%nu)/(1.0_pReal-prm%nu) ! ToDo: In the paper, this is the burgers vector for slip
dst%tau_r_twin(:,of) = prm%mu*prm%b_tw/(2.0_pReal*PI)*(1.0_pReal/(x0+prm%xc_twin)+cos(pi/3.0_pReal)/x0) dst%tau_r_twin(:,of) = prm%mu*prm%b_tw/(2.0_pReal*PI)*(1.0_pReal/(x0+prm%xc_twin)+cos(pi/3.0_pReal)/x0)
x0 = prm%mu*prm%burgers_trans**2.0_pReal/(SFE*8.0_pReal*PI)*(2.0_pReal+prm%nu)/(1.0_pReal-prm%nu) ! ToDo: In the paper, this is the burgers vector for slip x0 = prm%mu*prm%b_tr**2.0_pReal/(SFE*8.0_pReal*PI)*(2.0_pReal+prm%nu)/(1.0_pReal-prm%nu) ! ToDo: In the paper, this is the burgers vector for slip
dst%tau_r_trans(:,of) = prm%mu*prm%burgers_trans/(2.0_pReal*PI)*(1.0_pReal/(x0+prm%xc_trans)+cos(pi/3.0_pReal)/x0) dst%tau_r_trans(:,of) = prm%mu*prm%b_tr/(2.0_pReal*PI)*(1.0_pReal/(x0+prm%xc_trans)+cos(pi/3.0_pReal)/x0)
end associate end associate
@ -1026,47 +1026,47 @@ function plastic_dislotwin_postResults(Mp,Temperature,instance,of) result(postRe
select case(prm%outputID(o)) select case(prm%outputID(o))
case (rho_mob_ID) case (rho_mob_ID)
postResults(c+1:c+prm%totalNslip) = stt%rhoEdge(1:prm%totalNslip,of) postResults(c+1:c+prm%sum_N_sl) = stt%rhoEdge(1:prm%sum_N_sl,of)
c = c + prm%totalNslip c = c + prm%sum_N_sl
case (rho_dip_ID) case (rho_dip_ID)
postResults(c+1:c+prm%totalNslip) = stt%rhoEdgeDip(1:prm%totalNslip,of) postResults(c+1:c+prm%sum_N_sl) = stt%rhoEdgeDip(1:prm%sum_N_sl,of)
c = c + prm%totalNslip c = c + prm%sum_N_sl
case (gamma_dot_sl_ID) case (gamma_dot_sl_ID)
call kinetics_slip(Mp,temperature,instance,of,postResults(c+1:c+prm%totalNslip)) call kinetics_slip(Mp,temperature,instance,of,postResults(c+1:c+prm%sum_N_sl))
c = c + prm%totalNslip c = c + prm%sum_N_sl
case (gamma_sl_ID) case (gamma_sl_ID)
postResults(c+1:c+prm%totalNslip) = stt%accshear_slip(1:prm%totalNslip,of) postResults(c+1:c+prm%sum_N_sl) = stt%accshear_slip(1:prm%sum_N_sl,of)
c = c + prm%totalNslip c = c + prm%sum_N_sl
case (mfp_slip_ID) case (Lambda_sl_ID)
postResults(c+1:c+prm%totalNslip) = dst%Lambda_sl(1:prm%totalNslip,of) postResults(c+1:c+prm%sum_N_sl) = dst%Lambda_sl(1:prm%sum_N_sl,of)
c = c + prm%totalNslip c = c + prm%sum_N_sl
case (resolved_stress_slip_ID) case (resolved_stress_slip_ID)
do j = 1, prm%totalNslip do j = 1, prm%sum_N_sl
postResults(c+j) = math_mul33xx33(Mp,prm%Schmid_slip(1:3,1:3,j)) postResults(c+j) = math_mul33xx33(Mp,prm%Schmid_slip(1:3,1:3,j))
enddo enddo
c = c + prm%totalNslip c = c + prm%sum_N_sl
case (threshold_stress_slip_ID) case (threshold_stress_slip_ID)
postResults(c+1:c+prm%totalNslip) = dst%tau_pass(1:prm%totalNslip,of) postResults(c+1:c+prm%sum_N_sl) = dst%tau_pass(1:prm%sum_N_sl,of)
c = c + prm%totalNslip c = c + prm%sum_N_sl
case (f_tw_ID) case (f_tw_ID)
postResults(c+1:c+prm%totalNtwin) = stt%twinFraction(1:prm%totalNtwin,of) postResults(c+1:c+prm%sum_N_tw) = stt%twinFraction(1:prm%sum_N_tw,of)
c = c + prm%totalNtwin c = c + prm%sum_N_tw
case (mfp_twin_ID) case (Lambda_tw_ID)
postResults(c+1:c+prm%totalNtwin) = dst%Lambda_tw(1:prm%totalNtwin,of) postResults(c+1:c+prm%sum_N_tw) = dst%Lambda_tw(1:prm%sum_N_tw,of)
c = c + prm%totalNtwin c = c + prm%sum_N_tw
case (resolved_stress_twin_ID) case (resolved_stress_twin_ID)
do j = 1, prm%totalNtwin do j = 1, prm%sum_N_tw
postResults(c+j) = math_mul33xx33(Mp,prm%Schmid_twin(1:3,1:3,j)) postResults(c+j) = math_mul33xx33(Mp,prm%Schmid_twin(1:3,1:3,j))
enddo enddo
c = c + prm%totalNtwin c = c + prm%sum_N_tw
case (threshold_stress_twin_ID) case (threshold_stress_twin_ID)
postResults(c+1:c+prm%totalNtwin) = dst%threshold_stress_twin(1:prm%totalNtwin,of) postResults(c+1:c+prm%sum_N_tw) = dst%threshold_stress_twin(1:prm%sum_N_tw,of)
c = c + prm%totalNtwin c = c + prm%sum_N_tw
case (strain_trans_fraction_ID) case (f_tr_ID)
postResults(c+1:c+prm%totalNtrans) = stt%strainTransFraction(1:prm%totalNtrans,of) postResults(c+1:c+prm%sum_N_tr) = stt%strainTransFraction(1:prm%sum_N_tr,of)
c = c + prm%totalNtrans c = c + prm%sum_N_tr
end select end select
enddo enddo
@ -1109,7 +1109,7 @@ end subroutine plastic_dislotwin_results
! have the optional arguments at the end ! have the optional arguments at the end
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
pure subroutine kinetics_slip(Mp,Temperature,instance,of, & pure subroutine kinetics_slip(Mp,Temperature,instance,of, &
gdot_slip,dgdot_dtau_slip,tau_slip) dot_gamma_sl,dgamma_dtau_slip,tau_slip)
use prec, only: & use prec, only: &
tol_math_check, & tol_math_check, &
dNeq0 dNeq0
@ -1125,15 +1125,15 @@ pure subroutine kinetics_slip(Mp,Temperature,instance,of, &
instance, & instance, &
of of
real(pReal), dimension(param(instance)%totalNslip), intent(out) :: & real(pReal), dimension(param(instance)%sum_N_sl), intent(out) :: &
gdot_slip dot_gamma_sl
real(pReal), dimension(param(instance)%totalNslip), optional, intent(out) :: & real(pReal), dimension(param(instance)%sum_N_sl), optional, intent(out) :: &
dgdot_dtau_slip, & dgamma_dtau_slip, &
tau_slip tau_slip
real(pReal), dimension(param(instance)%totalNslip) :: & real(pReal), dimension(param(instance)%sum_N_sl) :: &
dgdot_dtau dgamma_dtau
real(pReal), dimension(param(instance)%totalNslip) :: & real(pReal), dimension(param(instance)%sum_N_sl) :: &
tau, & tau, &
stressRatio, & stressRatio, &
StressRatio_p, & StressRatio_p, &
@ -1148,7 +1148,7 @@ pure subroutine kinetics_slip(Mp,Temperature,instance,of, &
associate(prm => param(instance), stt => state(instance), dst => microstructure(instance)) associate(prm => param(instance), stt => state(instance), dst => microstructure(instance))
do i = 1, prm%totalNslip do i = 1, prm%sum_N_sl
tau(i) = math_mul33xx33(Mp,prm%Schmid_slip(1:3,1:3,i)) tau(i) = math_mul33xx33(Mp,prm%Schmid_slip(1:3,1:3,i))
enddo enddo
@ -1161,7 +1161,7 @@ pure subroutine kinetics_slip(Mp,Temperature,instance,of, &
v_wait_inverse = prm%v0**(-1.0_pReal) * exp(BoltzmannRatio*(1.0_pReal-StressRatio_p)** prm%q) v_wait_inverse = prm%v0**(-1.0_pReal) * exp(BoltzmannRatio*(1.0_pReal-StressRatio_p)** prm%q)
v_run_inverse = prm%B/(tau_eff*prm%b_sl) v_run_inverse = prm%B/(tau_eff*prm%b_sl)
gdot_slip = sign(stt%rhoEdge(:,of)*prm%b_sl/(v_wait_inverse+v_run_inverse),tau) dot_gamma_sl = sign(stt%rhoEdge(:,of)*prm%b_sl/(v_wait_inverse+v_run_inverse),tau)
dV_wait_inverse_dTau = v_wait_inverse * prm%p * prm%q * BoltzmannRatio & dV_wait_inverse_dTau = v_wait_inverse * prm%p * prm%q * BoltzmannRatio &
* (stressRatio**(prm%p-1.0_pReal)) & * (stressRatio**(prm%p-1.0_pReal)) &
@ -1170,15 +1170,15 @@ pure subroutine kinetics_slip(Mp,Temperature,instance,of, &
dV_run_inverse_dTau = v_run_inverse/tau_eff dV_run_inverse_dTau = v_run_inverse/tau_eff
dV_dTau = (dV_wait_inverse_dTau+dV_run_inverse_dTau) & dV_dTau = (dV_wait_inverse_dTau+dV_run_inverse_dTau) &
/ (v_wait_inverse+v_run_inverse)**2.0_pReal / (v_wait_inverse+v_run_inverse)**2.0_pReal
dgdot_dtau = dV_dTau*stt%rhoEdge(:,of)*prm%b_sl dgamma_dtau = dV_dTau*stt%rhoEdge(:,of)*prm%b_sl
else where significantStress else where significantStress
gdot_slip = 0.0_pReal dot_gamma_sl = 0.0_pReal
dgdot_dtau = 0.0_pReal dgamma_dtau = 0.0_pReal
end where significantStress end where significantStress
end associate end associate
if(present(dgdot_dtau_slip)) dgdot_dtau_slip = dgdot_dtau if(present(dgamma_dtau_slip)) dgamma_dtau_slip = dgamma_dtau
if(present(tau_slip)) tau_slip = tau if(present(tau_slip)) tau_slip = tau
end subroutine kinetics_slip end subroutine kinetics_slip
@ -1187,8 +1187,8 @@ end subroutine kinetics_slip
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief calculates shear rates on twin systems !> @brief calculates shear rates on twin systems
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
pure subroutine kinetics_twin(Mp,temperature,gdot_slip,instance,of,& pure subroutine kinetics_twin(Mp,temperature,dot_gamma_sl,instance,of,&
gdot_twin,dgdot_dtau_twin) dot_gamma_twin,dgamma_dtau_twin)
use prec, only: & use prec, only: &
tol_math_check, & tol_math_check, &
dNeq0 dNeq0
@ -1203,32 +1203,32 @@ pure subroutine kinetics_twin(Mp,temperature,gdot_slip,instance,of,&
integer, intent(in) :: & integer, intent(in) :: &
instance, & instance, &
of of
real(pReal), dimension(param(instance)%totalNslip), intent(in) :: & real(pReal), dimension(param(instance)%sum_N_sl), intent(in) :: &
gdot_slip dot_gamma_sl
real(pReal), dimension(param(instance)%totalNtwin), intent(out) :: & real(pReal), dimension(param(instance)%sum_N_tw), intent(out) :: &
gdot_twin dot_gamma_twin
real(pReal), dimension(param(instance)%totalNtwin), optional, intent(out) :: & real(pReal), dimension(param(instance)%sum_N_tw), optional, intent(out) :: &
dgdot_dtau_twin dgamma_dtau_twin
real, dimension(param(instance)%totalNtwin) :: & real, dimension(param(instance)%sum_N_tw) :: &
tau, & tau, &
Ndot0, & Ndot0, &
stressRatio_r, & stressRatio_r, &
dgdot_dtau dgamma_dtau
integer :: i,s1,s2 integer :: i,s1,s2
associate(prm => param(instance), stt => state(instance), dst => microstructure(instance)) associate(prm => param(instance), stt => state(instance), dst => microstructure(instance))
do i = 1, prm%totalNtwin do i = 1, prm%sum_N_tw
tau(i) = math_mul33xx33(Mp,prm%Schmid_twin(1:3,1:3,i)) tau(i) = math_mul33xx33(Mp,prm%Schmid_twin(1:3,1:3,i))
isFCC: if (prm%fccTwinTransNucleation) then isFCC: if (prm%fccTwinTransNucleation) then
s1=prm%fcc_twinNucleationSlipPair(1,i) s1=prm%fcc_twinNucleationSlipPair(1,i)
s2=prm%fcc_twinNucleationSlipPair(2,i) s2=prm%fcc_twinNucleationSlipPair(2,i)
if (tau(i) < dst%tau_r_twin(i,of)) then if (tau(i) < dst%tau_r_twin(i,of)) then
Ndot0=(abs(gdot_slip(s1))*(stt%rhoEdge(s2,of)+stt%rhoEdgeDip(s2,of))+& Ndot0=(abs(dot_gamma_sl(s1))*(stt%rhoEdge(s2,of)+stt%rhoEdgeDip(s2,of))+&
abs(gdot_slip(s2))*(stt%rhoEdge(s1,of)+stt%rhoEdgeDip(s1,of)))/& ! ToDo: MD: it would be more consistent to use shearrates from state abs(dot_gamma_sl(s2))*(stt%rhoEdge(s1,of)+stt%rhoEdgeDip(s1,of)))/& ! ToDo: MD: it would be more consistent to use shearrates from state
(prm%L0_twin*prm%b_sl(i))*& (prm%L0_twin*prm%b_sl(i))*&
(1.0_pReal-exp(-prm%VcrossSlip/(kB*Temperature)*& (1.0_pReal-exp(-prm%VcrossSlip/(kB*Temperature)*&
(dst%tau_r_twin(i,of)-tau))) (dst%tau_r_twin(i,of)-tau)))
@ -1242,16 +1242,16 @@ pure subroutine kinetics_twin(Mp,temperature,gdot_slip,instance,of,&
significantStress: where(tau > tol_math_check) significantStress: where(tau > tol_math_check)
StressRatio_r = (dst%threshold_stress_twin(:,of)/tau)**prm%r StressRatio_r = (dst%threshold_stress_twin(:,of)/tau)**prm%r
gdot_twin = prm%shear_twin * dst%twinVolume(:,of) * Ndot0*exp(-StressRatio_r) dot_gamma_twin = prm%shear_twin * dst%twinVolume(:,of) * Ndot0*exp(-StressRatio_r)
dgdot_dtau = (gdot_twin*prm%r/tau)*StressRatio_r dgamma_dtau = (dot_gamma_twin*prm%r/tau)*StressRatio_r
else where significantStress else where significantStress
gdot_twin = 0.0_pReal dot_gamma_twin = 0.0_pReal
dgdot_dtau = 0.0_pReal dgamma_dtau = 0.0_pReal
end where significantStress end where significantStress
end associate end associate
if(present(dgdot_dtau_twin)) dgdot_dtau_twin = dgdot_dtau if(present(dgamma_dtau_twin)) dgamma_dtau_twin = dgamma_dtau
end subroutine kinetics_twin end subroutine kinetics_twin
@ -1259,8 +1259,8 @@ end subroutine kinetics_twin
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief calculates shear rates on twin systems !> @brief calculates shear rates on twin systems
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
pure subroutine kinetics_trans(Mp,temperature,gdot_slip,instance,of,& pure subroutine kinetics_trans(Mp,temperature,dot_gamma_sl,instance,of,&
gdot_trans,dgdot_dtau_trans) dot_gamma_trans,dgamma_dtau_trans)
use prec, only: & use prec, only: &
tol_math_check, & tol_math_check, &
dNeq0 dNeq0
@ -1275,32 +1275,32 @@ pure subroutine kinetics_trans(Mp,temperature,gdot_slip,instance,of,&
integer, intent(in) :: & integer, intent(in) :: &
instance, & instance, &
of of
real(pReal), dimension(param(instance)%totalNslip), intent(in) :: & real(pReal), dimension(param(instance)%sum_N_sl), intent(in) :: &
gdot_slip dot_gamma_sl
real(pReal), dimension(param(instance)%totalNtrans), intent(out) :: & real(pReal), dimension(param(instance)%sum_N_tr), intent(out) :: &
gdot_trans dot_gamma_trans
real(pReal), dimension(param(instance)%totalNtrans), optional, intent(out) :: & real(pReal), dimension(param(instance)%sum_N_tr), optional, intent(out) :: &
dgdot_dtau_trans dgamma_dtau_trans
real, dimension(param(instance)%totalNtrans) :: & real, dimension(param(instance)%sum_N_tr) :: &
tau, & tau, &
Ndot0, & Ndot0, &
stressRatio_s, & stressRatio_s, &
dgdot_dtau dgamma_dtau
integer :: i,s1,s2 integer :: i,s1,s2
associate(prm => param(instance), stt => state(instance), dst => microstructure(instance)) associate(prm => param(instance), stt => state(instance), dst => microstructure(instance))
do i = 1, prm%totalNtrans do i = 1, prm%sum_N_tr
tau(i) = math_mul33xx33(Mp,prm%Schmid_trans(1:3,1:3,i)) tau(i) = math_mul33xx33(Mp,prm%Schmid_trans(1:3,1:3,i))
isFCC: if (prm%fccTwinTransNucleation) then isFCC: if (prm%fccTwinTransNucleation) then
s1=prm%fcc_twinNucleationSlipPair(1,i) s1=prm%fcc_twinNucleationSlipPair(1,i)
s2=prm%fcc_twinNucleationSlipPair(2,i) s2=prm%fcc_twinNucleationSlipPair(2,i)
if (tau(i) < dst%tau_r_trans(i,of)) then if (tau(i) < dst%tau_r_trans(i,of)) then
Ndot0=(abs(gdot_slip(s1))*(stt%rhoEdge(s2,of)+stt%rhoEdgeDip(s2,of))+& Ndot0=(abs(dot_gamma_sl(s1))*(stt%rhoEdge(s2,of)+stt%rhoEdgeDip(s2,of))+&
abs(gdot_slip(s2))*(stt%rhoEdge(s1,of)+stt%rhoEdgeDip(s1,of)))/& ! ToDo: MD: it would be more consistent to use shearrates from state abs(dot_gamma_sl(s2))*(stt%rhoEdge(s1,of)+stt%rhoEdgeDip(s1,of)))/& ! ToDo: MD: it would be more consistent to use shearrates from state
(prm%L0_trans*prm%b_sl(i))*& (prm%L0_trans*prm%b_sl(i))*&
(1.0_pReal-exp(-prm%VcrossSlip/(kB*Temperature)*& (1.0_pReal-exp(-prm%VcrossSlip/(kB*Temperature)*&
(dst%tau_r_trans(i,of)-tau))) (dst%tau_r_trans(i,of)-tau)))
@ -1314,16 +1314,16 @@ pure subroutine kinetics_trans(Mp,temperature,gdot_slip,instance,of,&
significantStress: where(tau > tol_math_check) significantStress: where(tau > tol_math_check)
StressRatio_s = (dst%threshold_stress_trans(:,of)/tau)**prm%s StressRatio_s = (dst%threshold_stress_trans(:,of)/tau)**prm%s
gdot_trans = dst%martensiteVolume(:,of) * Ndot0*exp(-StressRatio_s) dot_gamma_trans = dst%martensiteVolume(:,of) * Ndot0*exp(-StressRatio_s)
dgdot_dtau = (gdot_trans*prm%r/tau)*StressRatio_s dgamma_dtau = (dot_gamma_trans*prm%r/tau)*StressRatio_s
else where significantStress else where significantStress
gdot_trans = 0.0_pReal dot_gamma_trans = 0.0_pReal
dgdot_dtau = 0.0_pReal dgamma_dtau = 0.0_pReal
end where significantStress end where significantStress
end associate end associate
if(present(dgdot_dtau_trans)) dgdot_dtau_trans = dgdot_dtau if(present(dgamma_dtau_trans)) dgamma_dtau_trans = dgamma_dtau
end subroutine kinetics_trans end subroutine kinetics_trans