1 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_disloUCLA.f90"
4 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_disloUCLA.f90"
14 real(pReal),
parameter :: &
23 real(pReal),
allocatable,
dimension(:) :: &
24 b_sl, & !< magnitude of burgers vector [m]
26 i_sl, & !< Adj. parameter for distance between 2 forest dislocations
38 real(pReal),
allocatable,
dimension(:,:) :: &
39 h_sl_sl, & !< slip resistance from slip activity
41 real(pReal),
allocatable,
dimension(:,:,:) :: &
47 character(len=pStringLen),
allocatable,
dimension(:) :: &
53 type :: tdislouclastate
54 real(pReal),
dimension(:,:),
pointer :: &
58 end type tdislouclastate
60 type :: tdisloucladependentstate
61 real(pReal),
dimension(:,:),
allocatable :: &
64 end type tdisloucladependentstate
68 type(tParameters),
allocatable,
dimension(:) :: param
69 type(tDisloUCLAState),
allocatable,
dimension(:) :: &
72 type(tDisloUCLAdependentState),
allocatable,
dimension(:) :: dependentState
81 module subroutine plastic_disloucla_init
87 sizeState, sizeDotState, &
89 integer,
dimension(:),
allocatable :: &
91 real(pReal),
dimension(:),
allocatable :: &
92 rho_mob_0, & !< initial dislocation density
93 rho_dip_0, & !< initial dipole density
95 character(len=pStringLen) :: &
98 write(6,
'(/,a)')
' <<<+- plastic_'//plasticity_disloucla_label//
' init -+>>>';
flush(6)
100 write(6,
'(/,a)')
' Cereceda et al., International Journal of Plasticity 78:242–256, 2016'
101 write(6,
'(a)')
' https://dx.doi.org/10.1016/j.ijplas.2015.09.002'
103 ninstance = count(phase_plasticity == plasticity_disloucla_id)
104 if (iand(debug_level(debug_constitutive),debug_levelbasic) /= 0) &
105 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
107 allocate(param(ninstance))
108 allocate(state(ninstance))
109 allocate(dotstate(ninstance))
110 allocate(dependentstate(ninstance))
112 do p = 1,
size(phase_plasticity)
113 if (phase_plasticity(p) /= plasticity_disloucla_id) cycle
114 associate(prm => param(phase_plasticityinstance(p)), &
115 dot => dotstate(phase_plasticityinstance(p)), &
116 stt => state(phase_plasticityinstance(p)), &
117 dst => dependentstate(phase_plasticityinstance(p)), &
118 config => config_phase(p))
120 prm%output =
config%getStrings(
'(output)',defaultval=emptystringarray)
123 prm%mu = lattice_mu(p)
127 n_sl =
config%getInts(
'nslip',defaultval=emptyintarray)
128 prm%sum_N_sl = sum(abs(n_sl))
129 slipactive:
if (prm%sum_N_sl > 0)
then
130 prm%P_sl = lattice_schmidmatrix_slip(n_sl,
config%getString(
'lattice_structure'),&
131 config%getFloat(
'c/a',defaultval=0.0_preal))
133 if(trim(
config%getString(
'lattice_structure')) ==
'bcc')
then
134 a =
config%getFloats(
'nonschmid_coefficients',defaultval = emptyrealarray)
135 prm%nonSchmid_pos = lattice_nonschmidmatrix(n_sl,a,+1)
136 prm%nonSchmid_neg = lattice_nonschmidmatrix(n_sl,a,-1)
138 prm%nonSchmid_pos = prm%P_sl
139 prm%nonSchmid_neg = prm%P_sl
142 prm%h_sl_sl = lattice_interaction_slipbyslip(n_sl,
config%getFloats(
'interaction_slipslip'), &
143 config%getString(
'lattice_structure'))
144 prm%forestProjection = lattice_forestprojection_edge(n_sl,
config%getString(
'lattice_structure'),&
145 config%getFloat(
'c/a',defaultval=0.0_preal))
146 prm%forestProjection = transpose(prm%forestProjection)
148 rho_mob_0 =
config%getFloats(
'rhoedge0', requiredsize=
size(n_sl))
149 rho_dip_0 =
config%getFloats(
'rhoedgedip0', requiredsize=
size(n_sl))
150 prm%v0 =
config%getFloats(
'v0', requiredsize=
size(n_sl))
151 prm%b_sl =
config%getFloats(
'slipburgers', requiredsize=
size(n_sl))
152 prm%delta_F =
config%getFloats(
'qedge', requiredsize=
size(n_sl))
154 prm%i_sl =
config%getFloats(
'clambdaslip', requiredsize=
size(n_sl))
155 prm%tau_0 =
config%getFloats(
'tau_peierls', requiredsize=
size(n_sl))
156 prm%p =
config%getFloats(
'p_slip', requiredsize=
size(n_sl), &
157 defaultval=[(1.0_preal,i=1,
size(n_sl))])
158 prm%q =
config%getFloats(
'q_slip', requiredsize=
size(n_sl), &
159 defaultval=[(1.0_preal,i=1,
size(n_sl))])
160 prm%kink_height =
config%getFloats(
'kink_height', requiredsize=
size(n_sl))
161 prm%w =
config%getFloats(
'kink_width', requiredsize=
size(n_sl))
162 prm%omega =
config%getFloats(
'omega', requiredsize=
size(n_sl))
163 prm%B =
config%getFloats(
'friction_coeff', requiredsize=
size(n_sl))
165 prm%D =
config%getFloat(
'grainsize')
166 prm%D_0 =
config%getFloat(
'd0')
167 prm%Q_cl =
config%getFloat(
'qsd')
168 prm%atomicVolume =
config%getFloat(
'catomicvolume') * prm%b_sl**3.0_preal
169 prm%D_a =
config%getFloat(
'cedgedipmindistance') * prm%b_sl
170 prm%dipoleformation =
config%getFloat(
'dipoleformationfactor') > 0.0_preal
173 rho_mob_0 = math_expand(rho_mob_0, n_sl)
174 rho_dip_0 = math_expand(rho_dip_0, n_sl)
175 prm%q = math_expand(prm%q, n_sl)
176 prm%p = math_expand(prm%p, n_sl)
177 prm%delta_F = math_expand(prm%delta_F, n_sl)
178 prm%b_sl = math_expand(prm%b_sl, n_sl)
179 prm%kink_height = math_expand(prm%kink_height, n_sl)
180 prm%w = math_expand(prm%w, n_sl)
181 prm%omega = math_expand(prm%omega, n_sl)
182 prm%tau_0 = math_expand(prm%tau_0, n_sl)
183 prm%v0 = math_expand(prm%v0, n_sl)
184 prm%B = math_expand(prm%B, n_sl)
185 prm%i_sl = math_expand(prm%i_sl, n_sl)
186 prm%atomicVolume = math_expand(prm%atomicVolume, n_sl)
187 prm%D_a = math_expand(prm%D_a, n_sl)
190 if ( prm%D_0 <= 0.0_preal) extmsg = trim(extmsg)//
' D_0'
191 if ( prm%Q_cl <= 0.0_preal) extmsg = trim(extmsg)//
' Q_cl'
192 if (any(rho_mob_0 < 0.0_preal)) extmsg = trim(extmsg)//
' rhoedge0'
193 if (any(rho_dip_0 < 0.0_preal)) extmsg = trim(extmsg)//
' rhoedgedip0'
194 if (any(prm%v0 < 0.0_preal)) extmsg = trim(extmsg)//
' v0'
195 if (any(prm%b_sl <= 0.0_preal)) extmsg = trim(extmsg)//
' b_sl'
196 if (any(prm%delta_F <= 0.0_preal)) extmsg = trim(extmsg)//
' qedge'
197 if (any(prm%tau_0 < 0.0_preal)) extmsg = trim(extmsg)//
' tau_0'
198 if (any(prm%D_a <= 0.0_preal)) extmsg = trim(extmsg)//
' cedgedipmindistance or b_sl'
199 if (any(prm%atomicVolume <= 0.0_preal)) extmsg = trim(extmsg)//
' catomicvolume or b_sl'
202 rho_mob_0= emptyrealarray; rho_dip_0 = emptyrealarray
203 allocate(prm%b_sl,prm%D_a,prm%i_sl,prm%atomicVolume,prm%tau_0, &
204 prm%delta_F,prm%v0,prm%p,prm%q,prm%B,prm%kink_height,prm%w,prm%omega, &
205 source = emptyrealarray)
206 allocate(prm%forestProjection(0,0))
207 allocate(prm%h_sl_sl (0,0))
212 nipcmyphase = count(material_phaseat == p) * discretization_nip
213 sizedotstate =
size([
'rho_mob ',
'rho_dip ',
'gamma_sl']) * prm%sum_N_sl
214 sizestate = sizedotstate
216 call material_allocateplasticstate(p,nipcmyphase,sizestate,sizedotstate,0)
221 endindex = prm%sum_N_sl
222 stt%rho_mob => plasticstate(p)%state(startindex:endindex,:)
223 stt%rho_mob = spread(rho_mob_0,2,nipcmyphase)
224 dot%rho_mob => plasticstate(p)%dotState(startindex:endindex,:)
225 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_rho',defaultval=1.0_preal)
226 if (any(plasticstate(p)%atol(startindex:endindex) < 0.0_preal)) extmsg = trim(extmsg)//
' atol_rho'
228 startindex = endindex + 1
229 endindex = endindex + prm%sum_N_sl
230 stt%rho_dip => plasticstate(p)%state(startindex:endindex,:)
231 stt%rho_dip = spread(rho_dip_0,2,nipcmyphase)
232 dot%rho_dip => plasticstate(p)%dotState(startindex:endindex,:)
233 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_rho',defaultval=1.0_preal)
235 startindex = endindex + 1
236 endindex = endindex + prm%sum_N_sl
237 stt%gamma_sl => plasticstate(p)%state(startindex:endindex,:)
238 dot%gamma_sl => plasticstate(p)%dotState(startindex:endindex,:)
239 plasticstate(p)%atol(startindex:endindex) = 1.0e-2_preal
241 plasticstate(p)%slipRate => plasticstate(p)%dotState(startindex:endindex,:)
243 allocate(dst%Lambda_sl(prm%sum_N_sl,nipcmyphase), source=0.0_preal)
244 allocate(dst%threshold_stress(prm%sum_N_sl,nipcmyphase), source=0.0_preal)
246 plasticstate(p)%state0 = plasticstate(p)%state
252 if (extmsg /=
'')
call io_error(211,ext_msg=trim(extmsg)//
'('//plasticity_disloucla_label//
')')
256 end subroutine plastic_disloucla_init
262 pure module subroutine plastic_disloucla_lpanditstangent(lp,dlp_dmp, &
264 real(pReal),
dimension(3,3),
intent(out) :: &
266 real(pReal),
dimension(3,3,3,3),
intent(out) :: &
269 real(pReal),
dimension(3,3),
intent(in) :: &
271 real(pReal),
intent(in) :: &
273 integer,
intent(in) :: &
279 real(pReal),
dimension(param(instance)%sum_N_sl) :: &
280 dot_gamma_pos,dot_gamma_neg, &
281 ddot_gamma_dtau_pos,ddot_gamma_dtau_neg
286 associate(prm => param(instance))
288 call kinetics(mp,t,instance,of,dot_gamma_pos,dot_gamma_neg,ddot_gamma_dtau_pos,ddot_gamma_dtau_neg)
289 do i = 1, prm%sum_N_sl
290 lp = lp + (dot_gamma_pos(i)+dot_gamma_neg(i))*prm%P_sl(1:3,1:3,i)
291 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
292 dlp_dmp(k,l,m,n) = dlp_dmp(k,l,m,n) &
293 + ddot_gamma_dtau_pos(i) * prm%P_sl(k,l,i) * prm%nonSchmid_pos(m,n,i) &
294 + ddot_gamma_dtau_neg(i) * prm%P_sl(k,l,i) * prm%nonSchmid_neg(m,n,i)
299 end subroutine plastic_disloucla_lpanditstangent
305 module subroutine plastic_disloucla_dotstate(mp,t,instance,of)
307 real(pReal),
dimension(3,3),
intent(in) :: &
309 real(pReal),
intent(in) :: &
311 integer,
intent(in) :: &
317 real(pReal),
dimension(param(instance)%sum_N_sl) :: &
322 dot_rho_dip_formation, &
326 associate(prm => param(instance), stt => state(instance),dot => dotstate(instance), dst => dependentstate(instance))
328 call kinetics(mp,t,instance,of,&
330 tau_pos_out = tau_pos,tau_neg_out = tau_neg)
332 dot%gamma_sl(:,of) = (gdot_pos+gdot_neg)
333 vacancydiffusion = prm%D_0*exp(-prm%Q_cl/(kb*t))
336 dot_rho_dip_formation = 0.0_preal
337 dot_rho_dip_climb = 0.0_preal
339 dip_distance = math_clip(3.0_preal*prm%mu*prm%b_sl/(16.0_preal*pi*abs(tau_pos)), &
342 dot_rho_dip_formation = merge(2.0_preal*dip_distance* stt%rho_mob(:,of)*abs(dot%gamma_sl(:,of))/prm%b_sl, &
345 v_cl = (3.0_preal*prm%mu*vacancydiffusion*prm%atomicVolume/(2.0_preal*pi*kb*t)) &
346 * (1.0_preal/(dip_distance+prm%D_a))
347 dot_rho_dip_climb = (4.0_preal*v_cl*stt%rho_dip(:,of))/(dip_distance-prm%D_a)
350 dot%rho_mob(:,of) = abs(dot%gamma_sl(:,of))/(prm%b_sl*dst%Lambda_sl(:,of)) &
351 - dot_rho_dip_formation &
352 - (2.0_preal*prm%D_a)/prm%b_sl*stt%rho_mob(:,of)*abs(dot%gamma_sl(:,of))
353 dot%rho_dip(:,of) = dot_rho_dip_formation &
354 - (2.0_preal*prm%D_a)/prm%b_sl*stt%rho_dip(:,of)*abs(dot%gamma_sl(:,of)) &
359 end subroutine plastic_disloucla_dotstate
365 module subroutine plastic_disloucla_dependentstate(instance,of)
367 integer,
intent(in) :: &
371 real(pReal),
dimension(param(instance)%sum_N_sl) :: &
374 associate(prm => param(instance), stt => state(instance),dst => dependentstate(instance))
376 dislocationspacing = sqrt(matmul(prm%forestProjection,stt%rho_mob(:,of)+stt%rho_dip(:,of)))
377 dst%threshold_stress(:,of) = prm%mu*prm%b_sl &
378 * sqrt(matmul(prm%h_sl_sl,stt%rho_mob(:,of)+stt%rho_dip(:,of)))
380 dst%Lambda_sl(:,of) = prm%D/(1.0_preal+prm%D*dislocationspacing/prm%i_sl)
384 end subroutine plastic_disloucla_dependentstate
390 module subroutine plastic_disloucla_results(instance,group)
392 integer,
intent(in) :: instance
393 character(len=*),
intent(in) :: group
397 associate(prm => param(instance), stt => state(instance), dst => dependentstate(instance))
398 outputsloop:
do o = 1,
size(prm%output)
399 select case(trim(prm%output(o)))
401 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_mob,
'rho_mob',&
402 'mobile dislocation density',
'1/m²')
403 case(
'dipole_density')
404 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_dip,
'rho_dip',&
405 'dislocation dipole density''1/m²')
406 case(
'shear_rate_slip')
407 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%gamma_sl,
'dot_gamma_sl',&
410 if(prm%sum_N_sl>0)
call results_writedataset(group,dst%Lambda_sl,
'Lambda_sl',&
411 'mean free path for slip',
'm')
412 case(
'threshold_stress_slip')
413 if(prm%sum_N_sl>0)
call results_writedataset(group,dst%threshold_stress,
'tau_pass',&
414 'threshold stress for slip',
'Pa')
419 end subroutine plastic_disloucla_results
429 pure subroutine kinetics(Mp,T,instance,of, &
430 dot_gamma_pos,dot_gamma_neg,ddot_gamma_dtau_pos,ddot_gamma_dtau_neg,tau_pos_out,tau_neg_out)
432 real(pReal),
dimension(3,3),
intent(in) :: &
434 real(pReal),
intent(in) :: &
436 integer,
intent(in) :: &
440 real(pReal),
intent(out),
dimension(param(instance)%sum_N_sl) :: &
443 real(pReal),
intent(out),
optional,
dimension(param(instance)%sum_N_sl) :: &
444 ddot_gamma_dtau_pos, &
445 ddot_gamma_dtau_neg, &
448 real(pReal),
dimension(param(instance)%sum_N_sl) :: &
450 StressRatio_p,StressRatio_pminus1, &
457 associate(prm => param(instance), stt => state(instance), dst => dependentstate(instance))
459 do j = 1, prm%sum_N_sl
460 tau_pos(j) = math_tensordot(mp,prm%nonSchmid_pos(1:3,1:3,j))
461 tau_neg(j) = math_tensordot(mp,prm%nonSchmid_neg(1:3,1:3,j))
465 if (
present(tau_pos_out)) tau_pos_out = tau_pos
466 if (
present(tau_neg_out)) tau_neg_out = tau_neg
468 associate(boltzmannratio => prm%delta_F/(kb*t), &
469 dot_gamma_0 => stt%rho_mob(:,of)*prm%b_sl*prm%v0, &
470 effectivelength => dst%Lambda_sl(:,of) - prm%w)
472 significantpositivetau:
where(abs(tau_pos)-dst%threshold_stress(:,of) > tol_math_check)
473 stressratio = (abs(tau_pos)-dst%threshold_stress(:,of))/prm%tau_0
474 stressratio_p = stressratio** prm%p
475 stressratio_pminus1 = stressratio**(prm%p-1.0_preal)
476 needsgoodname = exp(-boltzmannratio*(1-stressratio_p) ** prm%q)
478 t_n = prm%b_sl/(needsgoodname*prm%omega*effectivelength)
479 t_k = effectivelength * prm%B /(2.0_preal*prm%b_sl*tau_pos)
481 vel = prm%kink_height/(t_n + t_k)
483 dot_gamma_pos = dot_gamma_0 * sign(vel,tau_pos) * 0.5_preal
484 else where significantpositivetau
485 dot_gamma_pos = 0.0_preal
486 end where significantpositivetau
488 if (
present(ddot_gamma_dtau_pos))
then
489 significantpositivetau2:
where(abs(tau_pos)-dst%threshold_stress(:,of) > tol_math_check)
490 dtn = -1.0_preal * t_n * boltzmannratio * prm%p * prm%q * (1.0_preal-stressratio_p)**(prm%q - 1.0_preal) &
491 * (stressratio)**(prm%p - 1.0_preal) / prm%tau_0
492 dtk = -1.0_preal * t_k / tau_pos
494 dvel = -1.0_preal * prm%kink_height * (dtk + dtn) / (t_n + t_k)**2.0_preal
496 ddot_gamma_dtau_pos = dot_gamma_0 * dvel* 0.5_preal
497 else where significantpositivetau2
498 ddot_gamma_dtau_pos = 0.0_preal
499 end where significantpositivetau2
502 significantnegativetau:
where(abs(tau_neg)-dst%threshold_stress(:,of) > tol_math_check)
503 stressratio = (abs(tau_neg)-dst%threshold_stress(:,of))/prm%tau_0
504 stressratio_p = stressratio** prm%p
505 stressratio_pminus1 = stressratio**(prm%p-1.0_preal)
506 needsgoodname = exp(-boltzmannratio*(1-stressratio_p) ** prm%q)
508 t_n = prm%b_sl/(needsgoodname*prm%omega*effectivelength)
509 t_k = effectivelength * prm%B /(2.0_preal*prm%b_sl*tau_pos)
511 vel = prm%kink_height/(t_n + t_k)
513 dot_gamma_neg = dot_gamma_0 * sign(vel,tau_neg) * 0.5_preal
514 else where significantnegativetau
515 dot_gamma_neg = 0.0_preal
516 end where significantnegativetau
518 if (
present(ddot_gamma_dtau_neg))
then
519 significantnegativetau2:
where(abs(tau_neg)-dst%threshold_stress(:,of) > tol_math_check)
520 dtn = -1.0_preal * t_n * boltzmannratio * prm%p * prm%q * (1.0_preal-stressratio_p)**(prm%q - 1.0_preal) &
521 * (stressratio)**(prm%p - 1.0_preal) / prm%tau_0
522 dtk = -1.0_preal * t_k / tau_neg
524 dvel = -1.0_preal * prm%kink_height * (dtk + dtn) / (t_n + t_k)**2.0_preal
526 ddot_gamma_dtau_neg = dot_gamma_0 * dvel * 0.5_preal
527 else where significantnegativetau2
528 ddot_gamma_dtau_neg = 0.0_preal
529 end where significantnegativetau2
535 end subroutine kinetics
537 end submodule plastic_disloucla