-
Notifications
You must be signed in to change notification settings - Fork 2
/
UMAT_Nor_Sand_Zamb.for
2184 lines (1891 loc) · 80 KB
/
UMAT_Nor_Sand_Zamb.for
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
!XXXXX Created by Luis E. Zambrano-Cruzatty XXXX
! Copyright (c) 2021 Luis Zambrano-Cruzatty
!Permission is hereby granted, free of charge, to any person obtaining a copy
!of this software and associated documentation files (the "Software"), to deal
!in the Software without restriction, including without limitation the rights
!to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
!copies of the Software, and to permit persons to whom the Software is
!furnished to do so, subject to the following conditions:
!
!The above copyright notice and this permission notice shall be included in all
!copies or substantial portions of the Software.
!
!THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
!IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
!FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
!AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
!LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
!OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
!SOFTWARE.
!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
subroutine UMAT(strss,statev,ddsdde,sse,spd,scd, &
rpl,ddsddt,drplde,drpldt, &
stran,dstran,time,dtime,temp,dtemp,predef,dpred,cmname, &
ndir,nshr,ntens,nstatv,props,nprops,coords,drot,pnewdt, &
celent,dfgrd0,dfgrd1,noel,npt,layer,kspt,kstep,kinc)
!implicit none
include 'aba_param.inc'
!implicit real*8(a-h,o-z)
character*80 cmname
integer, intent (inout):: ntens, ndir, nshr, nstatv, nprops, noel, npt, &
layer, kspt, kstep, kinc
double precision, intent(inout):: strss(ntens), statev(nstatv), &
ddsdde(ntens,ntens), ddsddt(ntens), drplde(ntens), &
stran(ntens), dstran(ntens), time(2), predef(1), dpred(1), &
props(nprops), coords(3), drot(3,3), dfgrd0(3,3), dfgrd1(3,3)
double precision, intent(inout):: sse, spd, scd, rpl, drpldt, dtime, temp, &
dtemp, pnewdt, celent
!Parameters:
!ELASTIC PARAMETERS:
!G: Reference shear modulus
!p_ref: reference mean stress
!nG: Shear modulus exponent
!nu= Poisson ratio
!alpha_g: Strain rate factor for shear modulus (Xu&Zhang 2015 and Yamamuro et al 2011)
!alpha_K: Strain rate factor for bulk modulus (Xu&Zhang 2015)
!RefRate= Reference strain rate (2.77e-5 s-1: 1%/min)
!CRITICAL STATE LINE: e_c=\Gamma-\lambda ln(p'_c)
!Gamma: Altitude of CSL, defined at 1 kPa
!lambda_c: Slope of CSL defined on natural logarithm scale
!YIELD FUNCTION PARAMTERS (Jefferies et al 2015)
!M_tc: !critical friction ratio for triaxial compression
!p_i: Image mean effective stress (state variable)
!HARDENING SOFTENING PARAMETERS
!CHI: Dilatancy coefficient (Jefferies&Shuttle 2002) [-]
!N: Volumetric coupling coefficient
!H_0: Hardening modulus parameter [-]
!H_y: Hardening slope [-]
!alpha_p=Strain rate factor for computing p_i (Isotache approach Mesri et al 1995)
!alpha_chi= Strain rate factor for dilatancy coefficient
!NUMERICAL PARAMTERS
!switch_smooth: switch to activate the strain rate smoothening algorithm
!N_s: Moving average degree
!MAXSUBS: Max sub-stepping steps
!STATE VARIABLES AND NEEDED DATA
!M_i= Image stress ratio
!p_i: Image mean effective stress [kPa]
!eps_rate: Strain rate [-/s]
!e_i: current void ratio [-]
!N_soft_i: Current number of strain rate values added
!SUM_rate: Cumulative strain rates
double precision :: G_0, p_ref, nG, nu, alpha_g !Elastic variables
double precision :: e_o, Gamma, lambda_c !CSL parameters
double precision :: M_tc, N !yield function parameters
double precision :: CHI_tc, CHIi, H_0, H_y, alpha_M, alpha_pi !Hardening parameters
double precision :: RefRate !reference strain rate
double precision :: bK, bk_0, G
double precision :: M_i, M_tce,p_i, e, psi, SUM_rate, eps_rate, YSFt
integer :: MAXSUBS, N_S, N_soft_i, i
double precision :: DE(6,6)
double precision :: p,q,eta, s1_double
double precision, dimension(6) :: dsig, stress, sig, dEpsP, EpsP,Erate, &
Erate0
logical:: switch_smooth, switch_yield, Dashpot_method
! get model parameters
G_0= props(1) !Reference shear modulus [kPa]
p_ref= -props(2) !reference mean effective stress [kPa]
nG = props(3) !Shear modulus exponent [-]
nu = props(4) !Poisson ration [-]
!Critical state line parameters
e_o= props(5) !Initial void ratio (defines initial state parameter) [-]
Gamma= props(6) !Altitude of CSL [-]
lambda_c= props(7) !CSL slope in ln space [-]
R= props(8) !OCR [-]
!Yield surface and hardening parameters
M_tc= props(9) ! critical friction ratio [-]
N= props(10) ! volumetric coupling coefficient [-]
!Hardening parameters
CHI_tc= props(11) ! Dilatancy coefficient [-]
H_0= props(12) ! Hardening modulus parameter [-]
H_y= props(13) ! Hardening modulus parameter slope [-]
!Strain rate parameters
alpha_G= props(14) !Strain rate factor for shear modulus [-]
alpha_chi= props(15) !Strain rate factor for dilatancy parameter [-]
alpha_pi= props(16) !Strain rate factor for the image mean effective stress [-]
RefRate= props(17) !reference strain rate [1/s]
!numerical parameters
call dbltobool(props(18), switch_smooth) ! switch for activating strain rate smoothening
N_S= props(19) ! Degree of smoothening
S= props(20) ! S=1 for undrained softening, 0 drained, in between partial drainage?
call dbltobool(props(21),Dashpot_method) ! If 0 use dashpot method, otherwise use original consistency
! State variables
G= statev(1) !current shear modulus
bK= statev(2) !current bulk modulus
e= statev(3) !current void ratio
psi= statev(4) !current state parameter
CHI_tce= statev(5) !current dilatancy coefficient
p_i = statev(6) !image pressure
pi_0= statev(23) !Initial image stress
M_i = statev(7) !image critical friction ratio
call dbltobool(statev(8),switch_yield) ! Point is plasticizing
do i=1,6
Erate0(i)= statev(8+i) !previous strain rate
Epsp(I)= statev(14+i) !current plastic strain
end do
SUM_rate= statev(21) !Sum of strain rates for smoothing algorithm
N_soft_i= statev(22) !Current degree of smoothening
!________________________________________________________________________________________________!
!____ Error tracking state variables !
! !
Rel_error_max=0.0d0
Drift_yield_max=0.0d0
!________________________________________________________________________________________________!
X=1/DTIME
if (DTIME==0.0d0) then
ERate= 0.0d0 ! Current strain rate
else
ERate= X*DSTRAN ! Current strain rate
end if
!Call sub-stepping procedure
Call Nor_Sand_Rate(noel, G, g_0, bk, nu, p_ref, nG, e_o, Gamma, lambda_c, M_tc, N, CHI_tc, H_0, H_y, &
alpha_g, alpha_chi, alpha_pi, RefRate, Erate0, Erate, R, &
switch_smooth, N_S, S, e, psi, CHI_tce, p_i, pi_0, M_i, SUM_rate, N_soft_i, switch_yield, &
dstran, dtime, strss, Sig, EpsP, DE, Rel_error_max, Drift_yield_max, Dashpot_method)
!*
!*... stress state parameters update
!*
Do i=1,ntens
strss(i) = Sig(i)
End Do
!Return state variables
statev(1)= G
statev(2)= bK
statev(3)= e
statev(4)= psi
statev(5)= CHI_tce
statev(6)= p_i
statev(7)= M_i
statev(8)= logic2dbl(switch_yield)
do i=1,6
statev(8+i)= Erate(I)
statev(14+i)= Epsp(I)
end do
statev(21)= Sum_rate
statev(22)= N_soft_i
statev(23)= pi_0
statev(24)= Rel_error_max
statev(25)=Drift_yield_max
DDSDDE=DE
!End UMAT routine
Return
end subroutine UMAT
!_________________________________________________________________________________________________________
!*********************************************************************************************************
!******************************************* Main subroutine *********************************************
!*********************************************************************************************************
!_________________________________________________________________________________________________________
Subroutine Nor_Sand_Rate(noel, G, G_0, K, nu, p_ref, nG, e_o, Gamma, lambda_c, M_tc, N, CHI_tc, H_0, H_y, &
alpha_g, alpha_Chi, alpha_pi, RefRate, Erate0, Erate, R, &
switch_smooth, N_S, S, e, psi, CHI_tce, p_i, pi_0, M_i, SUM_rate, N_soft_i, switch_yield, &
dEps, dtime, Sig0, Sig, EpsP, DDSDDE,Rel_error_max, Drift_yield_max, Dashpot_method)
!_________________________________________________________________________________
!Sub-stepping algorithm procedure based in Sloan et al (2001).
!Elastic portion is recovered using the a Newton-Raphson procedure
!_________________________________________________________________________________
Implicit none
!Variable declaration
!input variables
!Logical
logical, intent(in):: switch_smooth , Dashpot_method
!integers
integer, intent(in):: noel, N_S
!double precision
double precision, intent(in):: G_0, nu, p_ref, nG, e_o, R, Gamma, lambda_c, M_tc, N, CHI_tc, H_0, H_y
double precision, intent(in):: alpha_g, alpha_chi, alpha_pi, RefRate, Erate0(6)
double precision, intent(in):: S !Softening multiplier for undrained test
double precision, intent(in):: dEps(6), dtime, Sig0(6)
!Output variables
!logical
logical, intent(inout):: switch_yield
!integers
integer, intent(inout):: N_soft_i
!double precision
double precision, intent(inout):: G, K, e, psi, CHI_tce, p_i, pi_0, M_i
double precision, intent(inout):: Erate(6), SUM_rate
double precision, intent(inout):: Sig(6), EpsP(6), DDSDDE(6,6)
double precision, intent(inout):: Rel_error_max, Drift_yield_max
!____________________________________________________________________________________
!Local variables
!Logical
logical:: ApplyStrainRateUpdates, Locus, IsElasticUnloading, failed
!integer
integer:: icount, ITER
!double precision
double precision:: SSTOL, FTOL, SPTOL, LTOL, DTmin
double precision:: IErateI, IErate0I, Erate_dev, Erate_vol, Erate_dev0, Erate_vol0, &
dErate(6), dErateS(6), DErateSS(6), ErateYield(6), dErate_eff
doubleprecision:: p,q,eta, p_i0, CHIi, ptrial, qtrial, etatrial
double precision:: DE(6,6), D1, D2, dSig(6), SigTrial(6)
double precision:: dEpsvol, dEpsq, dEpsS(6), dEpsSS(6), dEpspS(6), dEpsp(6), Epspv, Epspq, dEpsTrial(6)
double precision:: alpha, kappa, dummyArg(2)
double precision:: T, DT, FT, F0
double precision:: M_i1, M_i2, p_i1, p_i2, e_1, e_2, psi_1, psi_2, CHIi_1, CHIi_2, CHI_tce1, CHI_tce2,&
G_1, G_2, K_1, K_2, e_c, dSP1(2), dSP2(2), Gu, Ku, chi_tcu, p_iu,p_i01, M_tcu, M_iu
double precision:: dEpsP1(6), dEpsP2(6), Sig1(6), dSig1(6), dSig2(6), EpsP1(6)
double precision:: RT_Dt, qq, nSigma
double precision:: Theta, J3, J2, cos3Theta, Mtheta, M_itc
!______________________________________________________________________________________________________
!| Initialization of variables |
!|_____________________________________________________________________________________________________|
SSTOL = 0.001d0 !Tolerance Relative Error (10-3 to 10-5)
FTOL = 0.000000001d0 !Tolerance Error on the Yield surface (10-6 to 10-9)
SPTOL = 0.001d0 !Tolerance Softening Parameters (0.0001d0)
LTOL= 0.01d0 !Tolerance for elastic unloading
ITER=10 ! Number of iterations for stress correction
DTmin=0.0000000001d0
!Mi_switch=.false. !use to correctly initialize Mi due to Lode's angle
!Assemble Elastic Matrix
D1 = K+(4*G/3)
D2 = K-(2*G/3)
DE = 0.0
DE(1:3,1:3) = D2
DE(1,1) = D1
DE(2,2) = D1
DE(3,3) = D1
DE(4,4) = G
DE(5,5) = G
DE(6,6) = G
! Elastic stress increment
call MatVec(DE, 6, dEps, 6, dsig)
call getPandQ (Sig0,p,q,eta)
if (G==0.0d0) G=G_0*(p/p_ref)**nG
if (K==0.0d0) K=2*G*(1+nu)/(3*(1-2*nu))
if (e==0.0d0) e=e_o
if ((M_i==0.0d0).or.(p_i==0.0d0)) then
! Need to compute increment of elastic stress to avoid non-defined Lode's angle at begging
call getP_M_Image(SPTOL, Sig0, dsig, M_tc, CHI_tc, R, e, lambda_c, Gamma, N, M_i, &
p_i, CHIi, psi, FTOL)
pi_0=p_i
endif
call TwoNormTensor(Erate,6,IErateI)
call getDevVolStrain(Erate, Erate_vol, Erate_dev)
call TwoNormTensor(Erate0,6,IErate0I)
call getDevVolStrain(Erate0, Erate_vol0, Erate_dev0)
if (CHI_tce==0.0d0) CHI_tce=CHI_tc
CHIi=CHI_tce/ (1.0d0- lambda_c * CHI_tce/M_tc)
psi_1=e-Gamma+lambda_c*log(-p)
call getYieldFunctionNorSand (p,q,CHI_tce, CHIi, N, psi, M_tc, p_i,M_i,F0, FTOL, locus) !Evaluate yield function on initial stress
!_______________________________________________________________________________________________________
!______________________________________________________________________________________________________
!| Strain rate smoothening algorithm |
!|_____________________________________________________________________________________________________|
if (switch_smooth) then
N_soft_i=N_soft_i+1
if (N_soft_i<N_S) then !Not enough values
SUM_rate=SUM_rate+IErateI !Cumulate the strain rate
IErateI=SUM_rate/N_soft_i !Takes the average
else !Enough values
SUM_rate=SUM_rate*(1.0-1.0/N_S) !Approximate sum without one term
SUM_rate=SUM_rate+IErateI
IErateI=SUM_rate/N_S !Averaged strain rate
endif
call TwoNormTensor(Erate,6,IErate0I)! Norm of the uncorrected strain rate
Erate=(IErateI/IErate0I)*Erate !Corrected strain rate tensor
call TwoNormTensor(Erate0,6,IErate0I)
endif
!_______________________________________________________________________________________________________
!______________________________________________________________________________________________________
!| Update elastic and state parameters due to strain rate |
!|_____________________________________________________________________________________________________|
dErate=Erate-Erate0
dErate_eff=Erate_dev-Erate_dev0 !Increment of effective strain rate
! Store state variables
Gu=G
Ku=K
CHI_tcu=chi_tce
p_iu=p_i
M_iu=M_i
call check4crossing(Erate_dev0, Erate_dev, dErate_eff,RefRate, ApplyStrainRateUpdates)
if (ApplyStrainRateUpdates.and.(.not.switch_yield)) then ! Update the parameters depending on the dev strain rate
Gu=G_0*((p/p_ref)**nG)*(1.0d0+alpha_G*log10(Erate_dev/RefRate))
Ku=G_0*((p/p_ref)**nG)*2*(1+nu)/(3*(1-2*nu))
CHI_tcu=CHI_tc*(1.0d0+alpha_CHI*log10(Erate_dev/RefRate))
call UpdateMandpidue2Erate(Sig0, dsig, M_tc, N, alpha_pi, alpha_CHI, RefRate, lambda_c, &
Gamma, e, Erate_dev, dErate_eff, p_iu, pi_0, M_iu, &
psi, CHI_tcu, CHIi)
!else
! Gu=G_0*((p/p_ref)**nG)
! Ku=G_0*((p/p_ref)**nG)*2*(1+nu)/(3*(1-2*nu))
endif
!_________________________________________________________________________________________________________
!_________________________________________________________________________________________________________
!|Elastic predictor |
!|________________________________________________________________________________________________________|
!Assemble Elastic Matrix
D1 = Ku+(4*Gu/3)
D2 = Ku-(2*Gu/3)
DE = 0.0
DE(1:3,1:3) = D2
DE(1,1) = D1
DE(2,2) = D1
DE(3,3) = D1
DE(4,4) = Gu
DE(5,5) = Gu
DE(6,6) = Gu
! Elastic stress increment
call MatVec(DE, 6, dEps, 6, dsig)
! total Elastic stress
call AddVec(Sig0, dSig, 1d0, 1d0, 6, SigTrial)
call getPandQ (SigTrial,pTrial,qTrial,etaTrial)
call getYieldFunctionNorSand (pTrial,qTrial,CHI_tcu, CHIi, N, psi, M_tc, p_iu,M_iu,FT, FTOL, Locus) !Evaluate yield function on trial stress
!Check Plasticity
!Drift_yield_max=FT
if ((FT < FTOL)) then !Elastic
!DDSDDE is DE
DDSDDE = DE
call getDevVolStrain(dEps,dEpsvol,dEpsq)
Sig=SigTrial
!Update state parameters due to change in Lode's angle
e = e + dEpsvol * ( 1. + e) !Update void ratio
!restore state variables
G=Gu
K=Ku
chi_tce=chi_tcu
p_i=p_iu
call getMlode (Sig, M_tc,theta,J3,J2,cos3Theta,Mtheta)
call getPandQ(Sig, p,q,eta)
e_c=Gamma-lambda_c*log(-p_i)
psi=e-e_c
call GetMiwithPsi(Mtheta, M_tc, CHIi, N, psi, M_i)
if (switch_yield) pi_0=p_i/(1.0+alpha_pi*log10(Erate_dev/RefRate)) !In case of unloading
switch_yield=.false.
return
!********************************************************************************************************
!________________________________________________________________________________________________________
!| Plastic strain. Have to integrate model using the elasto-plasticity framework |
!| The integration is based on Sloan et al 2001 |
!|______________________________________________________________________________________________________|
!*********************************************************************************************************
!________________________________________________________________________________________________________
!| Retrieve alpha |
!|______________________________________________________________________________________________________|
else ! Plastic
!call getYieldFunctionNorSand (km,p,q,CHI_tce, CHIi, N, psi, M_tc, p_i,M_i,F0) !Evaluate yield function on initial stress
!Check for elasto plastic transition
if (F0 < -FTOL) then !Elasto-plastic transition
call getElasticPartNewton(FTOL, Sig0, dEps, dErate, Erate0, IErate0I, IErateI, Erate_dev, &
Erate_dev0, Erate_vol, Erate_vol0, dErate_eff, RefRate, G_0, nu,&
p_ref, nG, G, K, alpha_G, alpha_chi, alpha_pi, Gamma, lambda_c,&
CHI_tce, Chi_tc, CHIi, e, psi, M_tc, N, p_i, pi_0, M_i,alpha, SigTrial, dEpsS)
else !Check elastic unloading
if (F0 <= FTOL) then
!Check direction of stress path with respect to actual yield surface
call CheckElasticUnloading(LTOL, Sig0, dSig, p_i, M_i, M_tc, CHIi, CHI_tce, &
N, psi, IsElasticUnloading, Locus)
if (IsElasticUnloading) then ! Must find intersections
pi_0=p_i
call getElasticPartNewton( FTOL, Sig0, dEps, dErate, Erate0, IErate0I, IErateI, Erate_dev, &
Erate_dev0, Erate_vol, Erate_vol0, dErate_eff, RefRate, G_0, nu,&
p_ref, nG, G, K, alpha_G, alpha_chi, alpha_pi, Gamma, lambda_c,&
CHI_tce, Chi_tc, CHIi, e, psi, M_tc, N, p_i, pi_0, M_i,alpha, SigTrial, dEpsS)
else !Pure plasticity
alpha=0.0d0
dEpsS=dEps
SigTrial=Sig0
end if
else! Invalid stress state
! Assume alpha=0 and solve for pure plasticity (for robustness)
alpha=0.0d0
dEpsS=dEps
SigTrial=Sig0
end if
end if
!________________________________________________________________________________________________________
!_________________________________________________________________________________________________________
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!! Sub-stepping Algorithm !!!!!!!!!
!!!!!! !!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! initiation of sub-stepping
ErateYield=Erate0
T = 0.
dT = 1. !start with the whole step, reduce it if the relative error is larger than tolerance
iCount = 0
call TwoNormTensor(dErate, 6, dummyArg(1))
call TwoNormTensor(dEps, 6, dummyArg(2))
kappa= dummyArg(1)/ dummyArg(2)
!sub-stepping
do while (T < 1.0 )
iCount = iCount + 1
if ( T+ dT > 1. ) dT = 1. - T
dEpsSS=dT*DEpsS
DErateSS= dT* dErate
call TwoNormTensor(ErateYield, 6, IErate0I)
call getDevVolStrain(ErateYield, Erate_vol0, Erate_dev0)
!________________________________________________________________________________________________________
!| Compute first increment of stress |
!|______________________________________________________________________________________________________|
!Store initial state parameters
M_i1=M_i
p_i1=p_i
e_1=e
psi_1=psi
CHIi_1=CHIi
CHI_tce1=CHI_tce
G_1=G
K_1=K
p_i01=pi_0
!First estimate of associated stress
call GetdSiganddSP (Locus, SigTrial, Epsp, dEpsSS, p_i1, p_i01, S, M_i1, psi_1, CHI_tce1, CHI_tc, M_tc, CHIi_1&
, N, e_o, e_1 ,Gamma, lambda_c, G_0, nG, p_ref, nu, alpha_G, alpha_pi, alpha_chi, ErateYield, &
IErate0I, IErateI, Erate_dev0, Erate_vol, Erate_vol0, RefRate, H_0, &
H_y, G_1, K_1, dEpsP1, dSig1, dSP1, Dashpot_method, dT, dtime, DErateSS)
!Update for dSig1 and dSP1
Epsp1=Epsp+dEpsp1
Sig1=SigTrial+dSig1
ErateYield=ErateYield+DErateSS
call TwoNormTensor(ErateYield, 6, IErateI)
call getDevVolStrain(ErateYield, Erate_vol, Erate_dev)
!call getPandQ(SigTrial+dSig1, p,q,eta)
!call getYieldFunctionNorSand_drift (p,q,CHI_tce1, CHIi_1, N, psi_1, M_tce1, p_i1,M_i1,F0, FTOL, Locus)
!if (abs(F0)>Drift_yield_max) Drift_yield_max=abs(F0) !Stores max stress drift
!_________________________________________________________________________________________________________
!________________________________________________________________________________________________________
!| Compute second increment of stress |
!|______________________________________________________________________________________________________|
!Store initial state parameters
M_i2=M_i1
p_i2=p_i1
e_2=e_1
psi_2=psi_1
CHIi_2=CHIi_1
CHI_tce2=CHI_tce1
p_i01=p_i01
G_2=G
K_2=K
!Find second approximation evaluated at sig+dSig1 and SP+dSP1
call GetdSiganddSP (Locus, Sig1, Epsp1, dEpsSS, p_i2, p_i01, S, M_i2, psi_2, CHI_tce2, CHI_tc,M_tc, CHIi_2&
, N, e_o, e_2 ,Gamma, lambda_c, G_0, nG, p_ref, nu, alpha_G, alpha_pi, alpha_chi,ErateYield, &
IErate0I, IErateI, Erate_dev, Erate_vol, Erate_vol0,&
RefRate, H_0, H_y, G_2, K_2, dEpsP2, dSig2, dSP2, Dashpot_method, dT, dtime, DErateSS)
! call getPandQ(SigTrial+dSig2, p,q,eta)
!call getYieldFunctionNorSand_drift (p,q,CHI_tce2, CHIi_2, N, psi_2, M_tce2, p_i2,M_i2,F0, FTOL, Locus)
!Drift_yield_max=abs(F0) !Stores max stress drift
!__________________________________________________________________________________________
!________________________________________________________________________________________________________
!________________________________________________________________________________________________________
!| Compute second average increment and Error |
!|______________________________________________________________________________________________________|
!Compute average stress and SP
Sig=SigTrial+0.5*(dSig1+dSig2)
!Determine relative error
call TwoNormTensor2((dSig1-dSig2), 6, RT_dT)
call TwoNormTensor2(Sig, 6, nSigma)
RT_dT=RT_dT/(2.0d0*nSigma)
if (RT_dT>Rel_error_max) Rel_error_max=RT_dT !Stores max relative error
!Check relative error
if ((RT_dT>SSTOL).and.(iCount<1001)) then !failed > sub-stepping
!iCount=iCount+1
qq=0.9d0*sqrt(SSTOL/RT_dT)
qq=max(qq,0.1)
dT=max(qq*dT,dTmin)
failed=.true.
ErateYield=ErateYield-DErateSS
else !Succeeded
!_______________________________________________________________________________________________________
!________________________________________________________________________________________________________
!| Update parameters and correct stress drift |
!|______________________________________________________________________________________________________|
!Update state parameters and stress
dEpspS=0.5d0*(dEpsp1+dEpsp2)
Epsp=Epsp+dEpspS
e=e_1
p_i=p_i+0.5d0*(dSP1(1)+dSP2(1))
!___update quasistatic state parameter
dErate_eff=Erate_dev-Erate_dev0
call check4crossing(Erate_dev0, Erate_dev, dErate_eff,RefRate, ApplyStrainRateUpdates)
Erate_dev=0.5*(Erate_dev+Erate_dev0)
if (ApplyStrainRateUpdates) then
pi_0=p_i/(1.0d0+alpha_pi*log10(Erate_dev/refrate))
else
pi_0=p_i
endif
!______________________________________
e_c=Gamma-lambda_c*log(-p_i)
psi=e-e_c
CHI_tce=CHI_tce+0.5d0*(dSP1(2)+dSP2(2)) !update CHI_tce
CHIi=CHI_tce/(1-lambda_c*CHI_tce/M_tc)
call getMlode(Sig, M_tc, Theta, J3, J2, cos3Theta, Mtheta)
call GetMiwithPsi(Mtheta, M_tc,CHIi, N, psi, M_i)
G=0.5*(G_1+G_2)
K=0.5*(K_1+K_2)
!______________________________________________________________________________________________
!test yield function in new stresses
call getPandQ(Sig, p,q,eta)
call getYieldFunctionNorSand_drift (p,q,CHI_tce, CHIi, N, psi, M_tc, p_i,M_i,F0, FTOL, Locus)
if (abs(F0)>Drift_yield_max) Drift_yield_max=abs(F0) !Stores max stress drift
if (abs(F0)>FTOL) then !stress back to yield surface
call stressCorrection(ITER, FTOL, F0, dEpsSS, Sig, G_0, nu, p_ref, nG, p_i, pi_0, &
S, M_i,M_tc, N, psi, CHIi, CHI_tce, H_0, H_y, e_o, e, Gamma, Lambda_c, &
Erate_dev0, Erate_dev, RefRate, K, G, Locus, Epsp, alpha_pi, &
alpha_G, Dashpot_method, ErateYield, Chi_tc, alpha_chi, &
DErateSS, DT, dtime)
end if
call getPandQ(Sig, p,q,eta)
!______________________________________________________________________________________________
qq=min((0.9d0*sqrt(SSTOL/RT_dT)),1.1d0)
!call getYieldFunctionNorSand_drift (p,q,CHI_tce, CHIi, N, psi, M_tce, p_i,M_i,F0, FTOL, Locus)
!Drift_yield_max=F0 !Stores max stress drift
if (failed) then
qq= min(qq , 1.0d0)
failed=.false.
end if
T=T+dT
dT=qq*dT
dT=max(dT,dTmin)
dT=min(dT,(1.0d0-T))
end if
end do
!
D1 = K+(4*G/3)
D2 = K-(2*G/3)
DE = 0.0
DE(1:3,1:3) = D2
DE(1,1) = D1
DE(2,2) = D1
DE(3,3) = D1
DE(4,4) = G
DE(5,5) = G
DE(6,6) = G
DDSDDE=DE
!call GetStiffnessMatrix(Locus, Sig, Epsp, dEps, p_i, pi_0, S, M_i, psi, CHI_tce, M_tce, CHI_tc, M_tc, &
! CHIi, N, e_o, e ,Gamma, lambda_c, alpha_pi, alpha_chi, alpha_M, Erate, Erate0,&
! RefRate, H_0, H_y, G, K, kappa, Dashpot_method, DT, Dtime, DDSDDE)
switch_yield=.true.
!Update stresses
end if
end subroutine Nor_Sand_Rate
!/////////////////////////////////////////////////////////////////////////////////////////////////////////////
!_________________________________________________________________________________________________________
!*********************************************************************************************************
!******************************************* Internal subroutines*****************************************
!*********************************************************************************************************
!_________________________________________________________________________________________________________
subroutine GetdSiganddSP(Locus, Sig, Epsp, dEps, p_i, pi_0, S, M_i, psi, CHI_tce, CHI_tc, M_tc,CHIi, N, e_o, e &
,Gamma, lambda_e, G_0, nG, p_ref, nu, alpha_G, alpha_pi, alpha_chi, Erate,&
IErate0I, IErateI, Erate_dev, Erate_vol, Erate_vol0, RefRate, H_0, &
H_y, G, K, dEpsP, dSig, dSP, Int_method, DT, Dtime, DErate)
!_____________________________________________________________________________________
!Subroutine for correcting the stress to the yield surface
!_____________________________________________________________________________________
implicit none
!input variables
double precision, dimension(6), intent(in):: dEps, Sig, Epsp, Erate, DErate
double precision, intent(in):: G_0, nu, p_ref, nG, alpha_G, S
double precision, intent(in):: M_tc, N, CHI_tc, H_0, H_y
double precision, intent(in):: e_o, Gamma, lambda_e
double precision, intent(in):: IErate0I, IErateI, RefRate, Erate_dev, Erate_vol, Erate_vol0
double precision, intent(in):: alpha_CHI, alpha_pi, DT, Dtime
!output variables
double precision, dimension(6), intent(out)::dSig, dEpsP
double precision, intent(inout):: p_i, M_i, psi, CHI_tce, CHIi, e, G, K, dSP(2), pi_0
logical, intent(in):: Int_Method
logical, intent(inout):: Locus
!local variables
double precision, dimension(6,6):: DE
double precision, dimension(2):: DSPErate
double precision, dimension(6):: dFdSig, dSigel, aux, dPPdSig, DummyVec
double precision, dimension(2):: dFdSP
double precision, dimension(2,6):: dSPdEpsp, dSPdEpsrate
double precision:: p, q, eta, e_c, A, Hard, Gi, Ki
double precision:: denom, numerator, lambda, aux2(2),Dummyvar
double precision:: theta, J3, J2, cos3theta, Mtheta, D1, D2, dEpsvol, dEpsq, dErate_eff, Erate_devf
logical:: ApplyStrainRateUpdates
integer:: I, J
!_Get the derivatives___________________________________________________________________________
!step 1 get p and a
call getPandQ(Sig, p, q, eta)
call getDevVolStrain(Erate+dErate, dEpsvol, Erate_devf)
dErate_eff=Erate_devf-Erate_dev
!get dFdSig and dPPdSig for inner cap evaluated at Sig, M_i, p_i, psi_i
call getdFdSig(Locus, Sig, p_i, M_i, M_tc, CHIi, CHI_tce, N, psi, dFdSig, dPPdSig)
!get dFdSP evaluated at Sig, M_i, p_i, psi_i
call getdFdSP(Locus, Sig, M_i, p_i, psi, CHIi, lambda_e, N, CHI_tce, M_tc, p, dFdSP)
! get dSPdEpsp evaluated at Sig, M_i, p_i
call getdSPdEpsp(Locus, Sig, Epsp, dEps, e_o, e, H_0, H_y, pi_0, pi_0, q, p, M_i, M_tc,&
CHIi, CHI_tce, psi, N, S, K, Gamma, lambda_e, dSPdEpsp, Erate_dev, Erate_devf, &
Refrate, alpha_pi)
call strain_rate_derivatives(alpha_chi, alpha_pi, Erate_dev, Erate_devf,&
RefRate, pi_0, chi_tc, Erate, dSPdEpsrate)
!_________________________________________________________________________________________________
!Update parameters due to strain rate ___________________________________________________________
Gi=G
Ki=K
call check4crossing(Erate_dev, Erate_devf, dErate_eff, RefRate, ApplyStrainRateUpdates)
if (ApplyStrainRateUpdates) then
Gi=G_0*((p/p_ref)**nG)*(1.0d0+alpha_G*log10(Erate_dev/RefRate))
else
Gi=G_0*((p/p_ref)**nG)
endif
Ki=G_0*((p/p_ref)**nG)*2*(1+nu)/(3*(1-2*nu))
!_________________________________________________________________________________________________
!Ensemble Elastic constitutive matrix _____________________________________________________________
D1 = Ki+(4*Gi/3)
D2 = Ki-(2*Gi/3)
DE = 0.0
DE(1:3,1:3) = D2
DE(1,1) = D1
DE(2,2) = D1
DE(3,3) = D1
DE(4,4) = Gi
DE(5,5) = Gi
DE(6,6) = Gi
!___________________________________________________________________________________________________
!Compute plastic multiplier ________________________________________________________________________
call MatVec(DE, 6, dEps, 6, dSigel)
!compute the plastic multiplier lambda
!fist compute A =dFdSigTDedPdSig (dPdSig=dFdSig for associated flow rule)
call MatVec(DE, 6, dPPdSig, 6, aux)
A=0.0d0
do I=1,6 !dot product
A=A+dFdSig(I)*aux(I)
end do
!compute hardening parameter Hard=-dFdSp*dSPdEpsp*dPdSig_________________
do I= 1,2
aux2(I)=0.0d0
end do
do J= 1,2 !dSPdEpsp*dPdSig_______________________________________________
do I= 1, 6
aux2(J)=aux2(J)+dSPdEpsp(J,I)*dPPdSig(I)
end do
end do
Hard=0.0d0
do J=1,2
Hard=Hard+dFdSP(J)*aux2(J)
end do
Hard=-Hard
if (Int_Method) then
do i=1,6 !dF/dSP * dSP*dErate
DummyVec(i)=dFdSP(1)*dSPdEpsrate(1,i)+dFdSP(2)*dSPdEpsrate(2,i)
enddo
call DotProduct(DummyVec, dPPdSig, 6, Dummyvar)
Hard=Hard-(1.0/(DT*Dtime))*Dummyvar
endif
!Compute denominator_______________________________________________________
denom=A+Hard
!Compute dFdSigT*De*dEps= dFdSigT*dSigel___________________________________
numerator=0.0d0
do I=1,6
numerator=numerator+dFdSig(I)*dSigel(I)
end do
!Compute strain rate contribution= dFdSP*dSP_Erate _________________________
DSPErate=0.0d0
do J=1, 2
do I=1,6
DSPErate(J)=dSPdEpsrate(J,I)*dErate(I)+DSPErate(J)
enddo
enddo
if (.not.Int_Method) then
do J=1, 2
do I=1,6
DSPErate(J)=dSPdEpsrate(J,I)*dErate(I)+DSPErate(J)
enddo
enddo
numerator=numerator+dFdSP(1)*DSPErate(1)+dFdSP(2)*DSPErate(2)
end if
!compute lambda________________________________________________________
lambda=numerator/denom
!____________________________________________________________________________________________________
!Compute plastic strain dEpsP=lambda*dPdSig _________________________________________________________
dEpsP=lambda*dPPdSig
!_____________________________________________________________________________________________________
!compute dSig=dSigel-lambda De*dPPdSig _______________________________________________________________
!De*dFdSig was calculated in aux
do I=1,6
aux(I)=lambda*aux(I)
dSig(I)=dSigel(I)-aux(I) !dSig
end do
!______________________________________________________________________________________________________
!Compute dSP=dSPdEpsp*dEpsp+dSPdEpsratedEpsrate*dEpsrate ______________________________________________
dSP(1)=0.0d0
dSP(2)=0.0d0
do J=1,2
do I=1,6!dSPdEpsp*dEpsp
dSP(J)=dSP(J)+dSPdEpsp(J,I)*dEpsP(I)
end do
end do
dSP=dSP+DSPErate
!______________________________________________________________________________________________________
!Update state parameters ______________________________________________________________________________
p_i=p_i+dSP(1)
if (ApplyStrainRateUpdates) then
pi_0=p_i/(1.0d0+alpha_pi*log10(Erate_dev/Refrate))
else
pi_0=p_i
endif
call getDevVolStrain(dEps, dEpsvol, dEpsq)
e= e + dEpsvol * ( 1. + e)
e_c=Gamma-lambda_e*log(-p_i)
psi=e-e_c
CHI_tce= CHI_tce+ dSP(2)
CHIi=CHI_tce/(1-lambda_e*CHI_tce/M_tc)
call getMlode(Sig+dSig, M_tc, Theta, J3, J2, cos3Theta, Mtheta)
call GetMiwithPsi(Mtheta, M_tc,CHIi, N, psi, M_i)
G=Gi
K=Ki
!______________________________________________________________________________________________________
end subroutine GetdSiganddSP
!
!
subroutine stressCorrection(MAXIT, FTOL, F0, dEpsp, Sig, G_0, nu, p_ref, nG, p_i, pi_0, &
S, M_i, M_tc, N, psi, CHIi, CHI_tce, H_0, H_y, e_o, e, Gamma,&
Lambda_e, IErate0I, IErateI, RefRate, K, G, Locus, Epsp, alpha_pi,&
alpha_G, Int_Method, Erate, Chi_tc, alpha_chi, dErate, &
DT, dtime)
!_____________________________________________________________________________________
!Subroutine for computing the change in stress (dSig) and state parameters (dSP)
!_____________________________________________________________________________________
implicit none
!input variables
double precision, dimension(6), intent(in):: dEpsp, Erate, dErate
double precision, intent(in):: FTOL
double precision, intent(in):: G_0, nu, p_ref, nG, M_tc, N,Chi_tc, H_0, H_y, S
double precision, intent(inout):: p_i, M_i, e, psi, CHIi, CHI_tce
double precision, intent(in):: e_o, Gamma, lambda_e
double precision, intent(in):: IErate0I, IErateI, RefRate ,alpha_pi, alpha_G, &
alpha_chi, DT, Dtime
integer, intent(in):: MAXIT
!output variables
double precision, intent(inout):: F0, Sig(6), Epsp(6), G, K, pi_0
logical, intent(inout):: Locus, Int_Method
!local variables
double precision, dimension(6)::dEpspS,DummyVec
double precision, dimension(2)::dSP
double precision, dimension(6,6):: DE
double precision, dimension(6):: dFdSig, dPPdSig, dSigel, aux, Signew
double precision, dimension(2):: dFdSP, DSPErate
double precision, dimension(2,6):: dSPdEpsp, dSPdEpsrate
double precision:: p, q, eta, e_c, A, Hard, dEpsvol, dEpsq
double precision:: M_in, p_in, en, psin, D1, D2, Gn, Kn, p_i0n, CHI_tcen
double precision:: denom, numerator, lambda, aux2(3), F2, Erate_dev0
double precision:: J3, J2, cos3Theta, Mtheta, theta, M_itc, eta_L, Dummyvar,dErate_eff
logical:: ApplyStrainRateUpdates
integer:: I, J, count
count=0
do while ((F0>FTOL) .or. (F0<0.0d0) .and. (count<MAXIT))
!step 1 get p and a
!_Get the derivatives___________________________________________________________________________
!step 1 get p and q
call getPandQ(Sig, p, q, eta)
!get dFdSig and dPPdSig for inner cap evaluated at Sig, M_i, p_i, psi_i
call getdFdSig(Locus, Sig, p_i, M_i, M_tc, CHIi, CHI_tce, N, psi, dFdSig, dPPdSig)
!get dFdSP evaluated at Sig, M_i, p_i, psi_i
call getdFdSP(Locus, Sig, M_i, p_i, psi, CHIi, lambda_e, N, CHI_tce, M_tc, p, dFdSP)
! get dSPdEpsp evaluated at Sig, M_i, p_i
!__________________________________
call getdSPdEpsp(Locus, Sig, Epsp, dEpsp, e_o, e, H_0, H_y, pi_0, pi_0, q ,p, M_i, M_tc, &
CHIi, CHI_tce, psi, N, S, K, Gamma, lambda_e, dSPdEpsp, IErateI, IErateI,&
Refrate, alpha_pi)
call strain_rate_derivatives(alpha_chi, alpha_pi, IErate0I, IErateI, &
RefRate, pi_0, chi_tc, Erate, dSPdEpsrate)
dErate_eff=IErateI-IErate0I
call check4crossing(IErate0I, IErateI, dErate_eff, RefRate, ApplyStrainRateUpdates)
!Update parameters due to strain rate ___________________________________________________________
if (ApplyStrainRateUpdates) then
Gn=G_0*((p/p_ref)**nG)*(1.0d0+alpha_G*log10(IErateI/RefRate))
else
Gn=G_0*((p/p_ref)**nG)
endif
Kn=G_0*((p/p_ref)**nG)*2*(1+nu)/(3*(1-2*nu))
!Ensemble Elastic constitutive matrix _____________________________________________________________
D1 = Kn+(4*Gn/3)
D2 = Kn-(2*Gn/3)
DE = 0.0
DE(1:3,1:3) = D2
DE(1,1) = D1
DE(2,2) = D1
DE(3,3) = D1
DE(4,4) = Gn
DE(5,5) = Gn
DE(6,6) = Gn
!___________________________________________________________________________________________________
!Compute lambda ____________________________________________________________________________________
!compute the plastic multiplier lambda
!fist compute A =dFdSigTDedPdSig (dPdSig=dFdSig for associated flow rule)
call MatVec(DE, 6, dPPdSig, 6, aux)
A=0.0d0
do I=1,6 !dot product
A=A+dFdSig(I)*aux(I)
end do
!compute hardening parameter Hard=-dFdSp*dSPdEpsp*dPdSig_________________
do I= 1,3
aux2(I)=0.0d0
end do
do J= 1,2 !dSPdEpsp*dPdSig_______________________________________________
do I= 1, 6
aux2(J)=aux2(J)+dSPdEpsp(J,I)*dPPdSig(I)
end do
end do
Hard=0.0d0
do J=1,2
Hard=Hard+dFdSP(J)*aux2(J)
end do
Hard=-Hard
if (Int_Method) then
do i=1,6 !dF/dSP * dSP*dErate
DummyVec(i)=dFdSP(1)*dSPdEpsrate(1,i)+dFdSP(2)*dSPdEpsrate(2,i)
enddo
call DotProduct(DummyVec, dPPdSig, 6, Dummyvar)
Hard=Hard-(1.0/(DT*Dtime))*Dummyvar
endif
!Compute denominator_______________________________________________________
denom=A+Hard
!Compute numerator ________________________________________________________
numerator=F0
!compute lambda________________________________________________________
lambda=numerator/denom
!Update Sigma=Sig-lambda*Del*dFdSig
!De*dFdSig was calculated in aux
do I=1,6
aux(I)=lambda*aux(I)
Signew(I)=Sig(I)-aux(I)
end do
!Compute plastic strain: dEpspS=lambda* dFdSig
do I=1, 6
dEpspS(I)=lambda*dFdSig(I)
end do
Epsp= Epsp + dEpspS
!Compute dSP=dSPdEpsp*dEpsp+dSPdEpsratedEpsrate*dEpsrate_______________________
dSP(1)=0.0d0
dSP(2)=0.0d0
do J=1,2
do I=1,6!dSPdEpsp*dEpsp
dSP(J)=dSP(J)+dSPdEpsp(J,I)*dEpspS(I)
end do
end do
!
if (Int_Method) then
do J=1,2
do I=1,6!dSPdEpsp*dEpsp
dSP(J)=dSP(J)+dSPdEpsrate(J,I)*dEpspS(I)*(1.0/(DT*Dtime))
end do
end do
endif
!Update SP _____________________________________________________________________________________________
p_in=p_i+dSP(1)!+(S*q*dpimax/(p*eta_L))
if (ApplyStrainRateUpdates) then
p_i0n=p_in/(1.0d0+alpha_pi*log10(IErateI/Refrate))
else
p_i0n=p_in
endif
CHI_tcen= CHI_tce+ dSP(2)
!dSP(2)=DSPErate(2)