42
43
44
47
48
49
50#include "implicit_f.inc"
51
52
53
54#include "com04_c.inc"
55
56
57
58 INTEGER NEL,NUPARAM,NUVAR,JTHE,NUMTABL,ITABLE(NUMTABL),NVARTMP
59 INTEGER, DIMENSION(NEL), INTENT(IN) :: NGL
61 . time,timestep
62 INTEGER :: VARTMP(NEL,NVARTMP)
63 my_real,
DIMENSION(NUPARAM),
INTENT(IN) ::
64 . uparam
65 my_real,
DIMENSION(NEL),
INTENT(IN) ::
66 . rho,shf,
67 . depsxx,depsyy,depsxy,depsyz,depszx,
68 . sigoxx,sigoyy,sigoxy,sigoyz,sigozx
69
70 my_real ,
DIMENSION(NEL),
INTENT(OUT) ::
71 . soundsp,sigy,et,
72 . signxx,signyy,signxy,signyz,signzx
73
74 my_real ,
DIMENSION(NEL),
INTENT(INOUT) ::
75 . dpla,off
76 my_real ,
DIMENSION(NEL,6),
INTENT(INOUT) ::
77 . pla,epsd
78 my_real ,
DIMENSION(NEL,NUVAR),
INTENT(INOUT) ::
79 . uvar
80
81 TYPE(TTABLE), DIMENSION(NTABLE) :: TABLE
82
83
84
85 INTEGER I,K,II,NINDX,INDEX(NEL),ITAB,ISMOOTH,IPOS(NEL,2)
86
88 . young1,young2,nu12,nu21,g12,a11,a12,a21,a22,c1,
89 . xi1,xi2,k1
90 . cini1,s1,sigy2,cini2,s2,sigy1c,cini1c,s1c,
91 . sigy2c,cini2c,s2c,sigyt,cinit,st,g23,g31
93 . normsig,beta1,beta2,
94 . dpdt,dlam,ddep
96 . normxx,normyy,normxy,
97 . normpxx,normpyy,normpxy,
98 . dphi_dlam,dphi,dfdsig2,dphi_dpla,dpxx,dpyy,dpxy,
99 . dphi_dr1,dphi_dr2,dphi_dr1c,dphi_dr2c,dphi_drt
101 . xscale1,yscale1,xscale1c,yscale1c,xscale2,yscale2,xscale2c,yscale2c,
102 . xscalet,yscalet,xvec(nel,2),asrate
103
105 . alpha1,
alpha2,alpha3,alpha4,alpha5,r1,r2,r1c,r2c,rt,
106 . dsigxx,dsigyy,dsigxy,dsigyz,dsigzx,hardp,phi,phi0,eta1,eta2,
107 . dr1_dp,dr2_dp,dr1c_dp,dr2c_dp,drt_dp,hardr,dpla2,dpla3,dpla4,
108 . dpla5,dpla6
109
110
111
112
113
114
115 young1 = uparam(1)
116 young2 = uparam(2)
117 nu12 = uparam(4)
118 nu21 = uparam(5)
119 a11 = uparam(6)
120 a12 = uparam(7)
121 a21 = uparam(8)
122 a22 = uparam(9)
123 g12 = uparam(10)
124 g23 = uparam(11)
125 g31 = uparam(12)
126 itab = int(uparam(14))
127 xi1 = uparam(15)
128 xi2 = uparam(16)
129 k1 = uparam(17)
130 k2 = uparam(18)
131 k3 = uparam(19)
132 k4 = uparam(20)
133 k5 = uparam(21)
134 k6 = uparam(22)
135 g1c = uparam(23)
136 IF (itab == 0) THEN
137 d1 = uparam(24)
138 d2 = uparam(25)
139 sigy1 = uparam(26)
140 cini1 = uparam(27)
141 s1 = uparam(28)
142 sigy2 = uparam(29)
143 cini2 = uparam(30)
144 s2 = uparam(31)
145 sigy1c = uparam(32)
146 cini1c = uparam(33)
147 s1c = uparam(34)
148 sigy2c = uparam(35)
149 cini2c = uparam(36)
150 s2c = uparam(37)
151 sigyt = uparam(38)
152 cinit = uparam(39)
153 st = uparam(40)
154 ELSE
155 xscale1 = uparam(24)
156 yscale1 = uparam(25)
157 xscale2 = uparam(26)
158 yscale2 = uparam(27)
159 xscale1c= uparam(28)
160 yscale1c= uparam(29)
161 xscale2c= uparam(30)
162 yscale2c= uparam(31)
163 xscalet = uparam(32)
164 yscalet = uparam(33)
165 asrate = uparam(34)
166 asrate = (two*pi*asrate*timestep)/(two*pi*asrate*timestep + one)
167 ismooth = int(uparam(35))
168 ENDIF
169
170
171 DO i=1,nel
172
173 IF (off(i) < 0.1) off(i) = zero
174 IF (off(i) < one) off(i) = off(i)*four_over_5
175
176 phi0(i) = uvar(i,1)
177
178 dpla(i) = zero
179 dpla2(i) = zero
180 dpla3(i) = zero
181 dpla4(i) = zero
182 dpla5(i) = zero
183 dpla6(i) = zero
184 et(i) = one
185 hardp(i) = zero
186 ENDDO
187
188
189 IF (itab > 0) THEN
190
191 xvec(1:nel,1) = pla(1:nel,2)
192 xvec(1:nel,2) = epsd(1:nel,2) * xscale1
193 ipos(1:nel,1) = vartmp(1:nel,1)
194 ipos(1:nel,2) = 1
196 r1(1:nel) = r1(1:nel) * yscale1
197 dr1_dp(1:nel) = dr1_dp(1:nel) * yscale1
198 vartmp(1:nel,1) = ipos(1:nel,1)
199
200 xvec(1:nel,1) = pla(1:nel,3)
201 xvec(1:nel,2) = epsd(1:nel,3) * xscale2
202 ipos(1:nel,1) = vartmp(1:nel,2)
203 ipos(1:nel,2) = 1
205 r2(1:nel) = r2(1:nel) * yscale2
206 dr2_dp(1:nel) = dr2_dp(1:nel) * yscale2
207 vartmp(1:nel,2) = ipos(1:nel,1)
208
209 xvec(1:nel,1) = pla(1:nel,4)
210 xvec(1:nel,2) = epsd(1:nel,4) * xscale1c
211 ipos(1:nel,1) = vartmp(1:nel,3)
212 ipos(1:nel,2) = 1
214 r1c(1:nel) = r1c(1:nel) * yscale1c
215 dr1c_dp(1:nel)= dr1c_dp(1:nel) * yscale1c
216 vartmp(1:nel,3) = ipos(1:nel,1)
217
218 xvec(1:nel,1) = pla(1:nel,5)
219 xvec(1:nel,2) = epsd(1:nel,5) * xscale2c
220 ipos(1:nel,1) = vartmp(1:nel,4)
221 ipos(1:nel,2) = 1
223 r2c(1:nel) = r2c(1:nel) * yscale2c
224 dr2c_dp(1:nel)= dr2c_dp(1:nel) * yscale2c
225 vartmp(1:nel,4) = ipos(1:nel,1)
226
227 xvec(1:nel,1) = pla(1:nel,6)
228 xvec(1:nel,2) = epsd(1:nel,6) * xscalet
229 ipos(1:nel,1) = vartmp(1:nel,5)
230 ipos(1:nel,2) = 1
232 rt(1:nel) = rt(1:nel) * yscalet
233 drt_dp(1:nel) = drt_dp(1:nel) * yscalet
234 vartmp(1:nel,5) = ipos(1:nel,1)
235 ENDIF
236
237
238
239
240 DO i=1,nel
241
242
243 signxx(i) = sigoxx(i) + a11*depsxx(i) + a12*depsyy(i)
244 signyy(i) = sigoyy(i) + a21*depsxx(i) + a22*depsyy(i)
245 signxy(i) = sigoxy(i) + depsxy(i)*g12
246 signyz(i) = sigoyz(i) + depsyz(i)*g23*shf(i)
247 signzx(i) = sigozx(i) + depszx(i)*g31*shf(i)
248
249
250 alpha1(i) = zero
252 alpha3(i) = zero
253 alpha4(i) = zero
254 alpha5(i) = zero
255 IF ((signxx(i) - xi1*signyy(i)) > zero) alpha1(i) = one
256 IF ((signyy(i) - xi2*signxx(i)) > zero)
alpha2(i) = one
257 IF (-signxx(i) > zero) alpha3(i) = one
258 IF (-signyy(i) > zero) alpha4
259 IF (abs(signxy(i)) > zero) alpha5(i) = one
260
261 IF (itab == 0) THEN
262
263
264
265 r1(i) = sigy1 + (one/(cini1 + s1*pla(i,2)))*pla(i,2)
266
267 r2(i) = sigy2 + (one/(cini2 + s2*pla(i,3)))*pla(i,3)
268
269
270 r1c(i)
271 r1c(i) = r1c(i)/sqrt(one - g1c)
272
273 r2c(i) = sigy2c + (one/(cini2c + s2c*pla(i,5)))*pla(i,5)
274
275 eta1(i) = one + alpha3(i)*alpha4(i)*d1
276 eta2(i) = one + alpha3(i)*alpha4(i)*d2
277 rt(i) = eta1(i)*sigyt + eta2(i)*(one/(cinit + st*pla(i,6)))*pla(i,6)
278 ENDIF
279
280
281 phi(i) = alpha1(i)*((signxx(i) - xi1*signyy(i))/r1(i))**2 +
282 .
alpha2(i)*((signyy(i) - xi2*signxx(i))/r2(i))**2 +
283 . alpha3(i)*((- signxx(i))/r1c(i))**2 +
284 . alpha4(i)*((- signyy(i))/r2c(i))**2 +
285 . alpha5(i)*(abs(signxy(i))/rt(i))**2 - one
286 ENDDO
287
288
289
290
291
292
293 nindx = 0
294 DO i=1,nel
295 IF (phi(i) > zero .AND. off(i) == one) THEN
296 nindx=nindx+1
297 index(nindx)=i
298 ENDIF
299 ENDDO
300
301
302
303
304#include "vectorize.inc"
305 DO ii=1,nindx
306
307
308 i = index(ii)
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323 normxx = two*(alpha1(i)/(r1(i)**2))*(sigoxx(i)-xi1*sigoyy(i))
324 . - two*(
alpha2(i)*xi2/(r2(i)**2))*(sigoyy(i)-xi2*sigoxx(i))
325 . + two*(alpha3(i)/(r1c(i)**2))*sigoxx(i)
326 normyy = -two*(alpha1(i)*xi1/(r1(i)**2))*(sigoxx(i)-xi1*sigoyy(i))
327 . + two*(
alpha2(i)/(r2(i)**2))*(sigoyy(i)-xi2*sigoxx(i))
328 . + two*(alpha4(i)/(r2c(i)**2))*sigoyy(i)
329 normxy = (alpha5(i)/(rt(i)**2))*abs(sigoxy(i))*sign(one,sigoxy(i))
330
331
332
333
334 normsig = sqrt(sigoxx(i)*sigoxx(i) + sigoyy(i)*sigoyy(i) + two*sigoxy(i)*sigoxy(i))
335 normsig =
max(normsig,em20)
336 beta1 = zero
337 beta2 = zero
338 IF ((sigoxx(i)/normsig > em01).OR.(sigoyy(i)/normsig > em01)) beta1 = one
339 IF ((sigoxx(i)/normsig < -em01).OR.(sigoyy(i)/normsig < -em01)) beta2 = one
340 IF (((abs(sigoxx(i))/normsig)<em01).AND.((abs(sigoyy(i))/normsig)<em01)) THEN
341 beta1 = one
342 beta2 = one
343 ENDIF
344
345 normpxx = beta1*(two*sigoxx(i) + k2*sigoyy(i)) + beta2*(two*sigoxx(i) + k4*sigoyy(i))
346 normpyy = beta1*(two*k1*sigoyy(i) + k2*sigoxx(i)) + beta2*(two*k3*sigoyy(i) + k4*sigoxx(i))
347 normpxy = (beta1*k5 + beta2*k6)*sigoxy(i)
348
349 normsig = sqrt(normpxx*normpxx + normpyy*normpyy + two*normpxy*normpxy)
350 normsig =
max(normsig,em20)
351
352 normpxx = normpxx/normsig
353 normpyy = normpyy/normsig
354 normpxy = normpxy/normsig
355
356
357
358
359 ! a) derivative with respect stress increments tensor dsig
360
361 dfdsig2 = normxx * (a11*normpxx + a12*normpyy)
362 . + normyy * (a21*normpxx + a22*normpyy)
363 . + two*normxy * two*normpxy * g12
364
365
366
367
368
369 dphi_dr1 = -two*alpha1(i)*(((sigoxx(i)-xi1*sigoyy(i))**2)/(r1(i)**3))
370 dphi_dr2 = -two*
alpha2(i)*(((sigoyy(i)-xi2*sigoxx(i))**2)/(r2(i)**3))
371 dphi_dr1c = -two*alpha3(i)*(sigoxx(i)**2)/(r1c(i)**3)
372 dphi_dr2c = -two*alpha4(i)*(sigoyy(i)**2)/(r2c(i)**3)
373 dphi_drt = -two*alpha5(i)*(sigoxy(i)**2)/(rt(i)**3)
374
375 IF (itab == 0) THEN
376 dr1_dp(i)
377 dr2_dp(i) = (one/(cini2 + s2*pla(i,3))) * (one - (s2*pla(i,3) /(cini2 + s2*pla(i,3))))
378 dr1c_dp(i) = (one/(cini1c + s1c*pla(i,4))) * (one - (s1c*pla(i,4)/(cini1c + s1c*pla(i,4))))
379 dr1c_dp(i) = dr1c_dp(i)/sqrt(one - g1c)
380 dr2c_dp(i) = (one/(cini2c + s2c*pla(i,5))) * (one - (s2c*pla(i,5)/(cini2c + s2c
381 drt_dp(i) = eta2(i)*(one/(cinit + st*pla(i,6))) * (one - (st*pla(i,6) /(cinit + st*pla(i,6))))
382 ENDIF
383
384 hardp(i) = sqrt(alpha1(i)*dr1_dp(i)**2 +
alpha2(i)*dr2_dp(i)**2 + alpha3(i)*dr1c_dp(i)**2
385 . + alpha4(i)*dr2c_dp(i)**2 + two*alpha5(i)*drt_dp(i)**2)
386 dphi_dpla = dphi_dr1*dr1_dp(i)*alpha1(i) + dphi_dr2*dr2_dp(i)*
alpha2(i) +
387 . dphi_dr1c*dr1c_dp(i)*alpha3(i) + dphi_dr2c*dr2c_dp(i)*alpha4(i) +
388 . dphi_drt*drt_dp(i)*alpha5(i)
389
390
391 dphi_dlam = -dfdsig2 + dphi_dpla
392 dphi_dlam = sign(
max(abs(dphi_dlam),em20) ,dphi_dlam)
393
394
395
396
397
398 phi(i) = phi0(i)
399
400
401 dsigxx(i) = a11*depsxx(i) + a12*depsyy(i)
402 dsigyy(i) = a21*depsxx(i) + a22*depsyy(i)
403 dsigxy(i) = depsxy(i)*g12
404
405
406 dphi = normxx * dsigxx(i)
407 . + normyy * dsigyy(i)
408 . + two * normxy * dsigxy(i)
409
410
411 dlam = -(phi(i) + dphi) / dphi_dlam
412 dlam =
max(dlam, zero)
413
414
415 dpxx = dlam * normpxx
416 dpyy = dlam * normpyy
417 dpxy = two * dlam
418
419
420 signxx(i) = sigoxx(i) + dsigxx(i) - (a11*dpxx + a12*dpyy)
421 signyy(i) = sigoyy(i) + dsigyy(i) - (a21*dpxx + a22*dpyy)
422 signxy(i) = sigoxy(i) + dsigxy(i) - g12*dpxy
423
424
425 ddep = dlam
426 dpla(i) =
max(zero, dpla(i) + ddep)
427 dpla2(i) =
max(zero, dpla2(i) + alpha1(i)*ddep)
428 dpla3(i) =
max(zero, dpla3
429 dpla4(i) =
max(zero, dpla4(i) + alpha3(i)*ddep)
430 dpla5(i) =
max(zero, dpla5(i) + alpha4(i)*ddep)
431 dpla6(i) =
max(zero, dpla6(i) + alpha5(i)*ddep)
432 pla(i,1) = pla(i,1) + ddep
433 pla(i,2) = pla(i,2) + alpha1(i)*ddep
434 pla(i,3) = pla(i,3) +
alpha2(i)*ddep
435 pla(i,4) = pla(i,4) + alpha3(i)*ddep
436 pla(i,5) = pla(i,5) + alpha4(i)*ddep
437 pla(i,6) = pla(i,6) + alpha5(i)*ddep
438
439
440 alpha1(i) = zero
442 alpha3(i) = zero
443 alpha4(i) = zero
444 alpha5(i) = zero
445 IF ((signxx(i) - xi1*signyy(i)) > zero) alpha1(i) = one
446 IF ((signyy(i) - xi2*signxx(i)) > zero)
alpha2(i) = one
447 IF (-signxx(i) > zero) alpha3(i) = one
448 IF (-signyy(i) > zero) alpha4(i) = one
449 IF (abs(signxy(i)) > zero) alpha5(i) = one
450
451
452 IF (itab == 0) THEN
453
454
455 r1(i) = sigy1 + (one/(cini1 + s1*pla(i,2)))*pla(i,2)
456
457 r2(i) = sigy2 + (one/(cini2 + s2*pla(i,3)))*pla(i,3)
458
459
460 r1c(i) = sigy1c + (one/(cini1c + s1c*pla(i,4)))*pla(i,4)
461 r1c(i) = r1c(i)/sqrt(one - g1c)
462
463 r2c(i) = sigy2c + (one/(cini2c + s2c*pla(i,5)))*pla(i,5)
464
465 eta1(i) = one + alpha3(i)*alpha4(i)*d1
466 eta2(i) = one + alpha3(i)*alpha4(i)*d2
467 rt(i) = eta1(i)*sigyt + eta2(i)*(one/(cinit + st*pla(i,6)))*pla(i,6)
468
469
470 phi(i) = alpha1(i)*((signxx(i) - xi1*signyy(i))/r1(i))**2 +
471 .
alpha2(i)*((signyy(i) - xi2*signxx(i))/r2
472 . alpha3(i)*((- signxx(i))/r1c(i))**2 +
473 .
474 . alpha5
475 ENDIF
476
477 ENDDO
478
479
480
481
482
483 IF (itab > 0) THEN
484 IF (nindx > 0) THEN
485
486 xvec(1:nel,1) = pla(1:nel,2)
487 xvec(1:nel,2) = epsd(1:nel,2) * xscale1
488 ipos(1:nel,1) = vartmp(1:nel
489 ipos(1:nel,2) = 1
491 r1(1:nel) = r1(1:nel) * yscale1
492 dr1_dp(1:nel) = dr1_dp(1:nel) * yscale1
493 vartmp(1:nel,1) = ipos(1:nel,1)
494
495 xvec(1:nel,1) = pla(1:nel,3)
496 xvec(1:nel,2) = epsd(1:nel,3) * xscale2
497 ipos(1:nel,1) = vartmp(1:nel,2)
498 ipos(1:nel,2) = 1
500 r2(1:nel) = r2(1:nel) * yscale2
501
502 vartmp(1:nel,2) = ipos(1:nel,1)
503
504 xvec(1:nel,1) = pla(1:nel,4)
505 xvec(1:nel,2) = epsd(1:nel,4) * xscale1c
506 ipos(1:nel,1) = vartmp(1:nel,3)
507 ipos(1:nel,2) = 1
509 r1c(1:nel) = r1c(1:nel) * yscale1c
510 dr1c_dp(1:nel)= dr1c_dp(1:nel) * yscale1c
511 vartmp(1:nel,3) = ipos(1:nel,1)
512
513 xvec(1:nel,1) = pla(1:nel,5)
514 xvec(1:nel,2) = epsd(1:nel,5) * xscale2c
515 ipos(1:nel,1) = vartmp(1:nel,4)
516 ipos(1:nel,2) = 1
518 r2c(1:nel) = r2c(1:nel) * yscale2c
519 dr2c_dp(1:nel)= dr2c_dp(1:nel) * yscale2c
520 vartmp(1:nel,4) = ipos(1:nel,1)
521
522 xvec(1:nel,1) = pla(1:nel,6)
523 xvec(1:nel,2) = epsd(1:nel,6) * xscalet
524 ipos(1:nel,1) = vartmp(1:nel,5)
525 ipos(1:nel,2) = 1
527 rt(1:nel) = rt(1:nel) * yscalet
528 drt_dp(1:nel) = drt_dp(1:nel) * yscalet
529 vartmp(1:nel,5) = ipos(1:nel,1)
530
531 DO i = 1, nel
532 phi(i
533 .
alpha2(i)*((signyy(i) - xi2*signxx(i))/r2(i))**2 +
534 . alpha3(i)*((- signxx(i))/r1c(i))**2 +
535 . alpha4(i)*((- signyy
536 . alpha5(i)*(abs(signxy(i))/rt(i))**2 - one
537 ENDDO
538 ENDIF
539 ENDIF
540
541
542 DO i=1,nel
543
544 uvar(i,1) = phi(i)
545
546 IF (itab == 0) THEN
547 epsd(i,1) = dpla(i) /
max(em20,timestep)
548 epsd(i,2) = dpla2(i) /
max(em20,timestep)
549 epsd(i,3) = dpla3(i) /
max(em20,timestep)
550 epsd(i,4) = dpla4(i
551 epsd(i,5) = dpla5(i) /
max(em20,timestep)
552 epsd(i,6) = dpla6(i) /
max(em20,timestep)
553 ELSE
554 dpdt = dpla(i)/
max(em20,timestep)
555 epsd(i,1) = asrate * dpdt + (one - asrate) * epsd(i,1)
556 dpdt = dpla2(i)/
max(em20,timestep)
557 epsd(i,2) = asrate * dpdt + (one - asrate) * epsd(i,2)
558 dpdt = dpla3(i)/
max(em20,timestep)
559 epsd(i,3) = asrate * dpdt + (one - asrate) * epsd(i,3)
560 dpdt = dpla4(i)/
max(em20,timestep)
561 epsd(i,4) = asrate * dpdt + (one - asrate) * epsd(i,4)
562 dpdt = dpla5(i)/
max(em20,timestep)
563 epsd(i,5) = asrate * dpdt + (one - asrate) * epsd(i,5)
564 dpdt = dpla6(i)/
max(em20,timestep)
565 epsd(i,6) =
566 ENDIF
567
568 et(i) = hardp(i) / (hardp(i) +
max(young1,young2))
569
570 soundsp(i) = sqrt(
max(a11,a12,a21,a22,g12,g23,g31)/ rho(i))
571
572 sigy(i) = sqrt(r1(i)**2 + r2(i)**2 + r1c(i)**2 +
573 . r2c(i)**2 + two*rt(i)**2)
574 ENDDO
575