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
101 USE matparam_def_mod
103
104
105
106#include "implicit_f.inc"
107
108
109
110#include "com04_c.inc"
111#include "param_c.inc"
112
113
114
115 INTEGER NEL, NUPARAM, NUVAR, IPM(NPROPMI,NUMGEO), MAT(NEL)
116 INTEGER,INTENT(IN) ::NVAREOS
118 . time , timestep , uparam(nuparam),
119 . rho(nel), rho0(nel), vnew(nel), eint(nel),
120 . epspxx(nel), epspyy(nel), epspzz(nel),
121 . epspxy(nel), epspyz(nel), epspzx(nel),
122 . depsxx(nel), depsyy(nel), depszz(nel),
123 . depsxy(nel), depsyz(nel), depszx(nel),
124 . epsxx(nel), epsyy(nel), epszz(nel),
125 . epsxy(nel), epsyz(nel), epszx(nel),
126 . sigoxx(nel), sigoyy(nel), sigozz(nel),
127 . sigoxy(nel), sigoyz(nel), sigozx(nel),
128 . dvol(nel) , vol0(nel) , pm(npropm,nummat),
129 . psh(nel) , bufmat(*) , muold(nel)
130
131 my_real,
INTENT(INOUT) :: vareos(nvareos*nel)
132 TYPE(MATPARAM_STRUCT_) ,DIMENSION(NUMMAT), INTENT(IN) :: MAT_PARAM
133 INTEGER,INTENT(IN) :: NVARTMP_EOS
134 INTEGER,INTENT(INOUT) :: VARTMP_EOS(NEL,NVARTMP_EOS)
135
136
137
139 . signxx(nel), signyy(nel), signzz(nel),
140 . signxy(nel), signyz(nel), signzx(nel),
141 . sigvxx(nel), sigvyy(nel), sigvzz(nel),
142 . sigvxy(nel), sigvyz(nel), sigvzx(nel),
143 . soundsp(nel), viscmax(nel)
144
145
146
147 my_real uvar(nel,nuvar), off(nel)
148
149
150
151 INTEGER NPF(*), NFUNC, (NFUNC)
152 my_real finter,fintte,tf(*),fint2v
153 EXTERNAL finter,fintte
154
155
156
157 INTEGER , ITER, MATS(NEL),IPLA(NEL), MXS, IFLAG1,
158 . IFLAG2, ITEMAX, IMAX, IPLAS,
161 . dfs(nel), mus(nel), mu2s(nel), dpdm(nel),
162 . theta(nel), dpde(nel)
164 . mu(nel)
166 . ps,pe,alphae,alphap,en,beta,eta,xi,unsurn,
167 . bulk0,c0,dalpdpe,aa,hh,hh2,g,g2,dav,
168 . bulk1, crit, tol, pnew1, dfda, dgda,
169 . gs, dgdalpha, bulk
171 . rhos(nel),rhos0(nel),espes(nel),
172 . vnews(nel),dvols(nel),pnew(nel),
173 . alphayld(nel),pyld(nel),alpha0(nel),
174 . alphaold(nel),dpdael(nel),eintn(nel),pold(nel)
176 . sigold(nel,6), pnewg(nel)
177 DOUBLE PRECISION ALPHA1(NEL),ALPHA(NEL),
178
179 bulk=uparam(1)
180 pe = uparam(2)
181 ps = uparam(3)
182 en = uparam(4)
183 tol= uparam(5)
184 mxs =nint(uparam
185 iflag1=nint(uparam(7))
186 iflag2=nint(uparam(8))
187 itemax=nint(uparam(17))
188 DO i=1,nel
189 mats(i) = mxs
190 rhos0(i)= pm(89,mxs)
191 ENDDO
192 bulk0= pm(32,mxs)
193 g =uparam(10)
194 alphae=uparam(11)
195 gs = pm(22,mxs)
196 dgdalpha= (g-gs)/(alphae-one)
197 alphap=uparam(12)
198 aa =uparam(13)
199 unsurn=uparam(14)
200 xi =uparam(15)
201 eta =uparam(16)
202 eostyp = mat_param(mxs)%IEOS
203
204 DO i=1,nel
205 alphaold(i)= uvar(i,3)
206 alphayld(i)= uvar(i,4)
207 pold(i)=-(sigoxx(i)+sigoyy(i)+sigozz(i))*third
208 pyld(i)=ps-xi*(alphayld(i)-one)**unsurn
209 ENDDO
210 DO i=1,nel
211 mu(i) =rho(i)/rho0(i)-one
212 ENDDO
213 DO i=1,nel
214 sigold(i,1:3)=-pold(i)
215 sigold(i,4:6)=zero
216 ENDDO
217
218
219
220 DO i=1,nel
221 IF(alphaold(i) == one) THEN
222
223 alpha0(i)=one
224 ipla(i)=2
225 ELSE
226
227 hh =aa*(alphaold(i)-one)+one
228 hh2=hh*hh
229 dpdael(i)=bulk0/(alphaold(i)*(one-alphaold(i)/hh2))
230 bulk1=bulk0*(one+mu(i))/alphae
231 IF(iflag1 == 1) THEN
232 alpha0(i)=(pold(i)+bulk0-alphaold(i)*dpdael(i))/(bulk1-dpdael(i))
233 ELSEIF(iflag1 == 2) THEN
234 alpha0(i)= bulk0/(bulk1-pold(i))
235 ENDIF
236 alpha0(i)=
max(alpha0(i),one)
237 ENDIF
238 ENDDO
239
240 DO i=1,nel
242 ENDDO
243
244
245
246 iter=0
247 100 iter=iter+1
248
249
250
251 DO i=1,nel
252 rhos(i) =rho(i)*
alpha(i)
253 dvols(i)=dvol(i)-vnew(i)*(one-alphaold(i)/
alpha(i))
254 dvols(i)=dvols(i)/alphaold(i)
255 vnews(i)=vnew(i)/
alpha(i)
256 ENDDO
257
258
259
260 DO i=1,nel
261 mus(i) = (one + mu(i))*
alpha(i)/alphae - one
262 dfs(i) = one/(one+mus(i))
263 eintn(i)=eint(i)-half*pold(i)*dvols(i)
264 ENDDO
265
266
267
268 CALL eosmain(0 ,nel ,eostyp ,pm ,off ,eintn ,
269 . rhos ,rhos0 ,mus ,mu2s ,espes ,
270 . dvols ,dfs ,vnews ,mats ,psh ,
271 . pnew ,dpdm ,dpde ,theta ,
272 . bufmat ,sigold ,muold ,75 ,
273 . npf ,tf ,vareos ,nvareos,mat_param(mxs),
274 . bid ,nvartmp_eos, vartmp_eos)
275 CALL eosmain(1 ,nel ,eostyp ,pm ,off ,eintn ,
276 . rhos ,rhos0 ,mus ,mu2s ,espes
277 . dvols ,dfs ,vnews ,mats ,psh ,
278 . pnew ,dpdm ,dpde ,theta ,
279 . bufmat ,sigold ,muold ,75 ,
280 . npf ,tf ,vareos ,nvareos,mat_param(mxs),
281 . bid ,nvartmp_eos, vartmp_eos)
282 IF(iflag1 == 2) THEN
283 DO i=1,nel
284 pnew(i)=pnew(i)/
alpha(i)
285 ENDDO
286 ENDIF
287
288
289
290 IF (iter <= itemax) THEN
291
292
293
294 DO i=1,nel
295 IF(ipla(i)==2)cycle
296 ipla(i)=0
297 dfda=dpdm(i)*(one+mu(i))/alphae + dpde(i)*eint(i)/vol0(i)
298 dgda=dpdael(i)
299 pnewg(i)=pold(i)+dpdael(i)*(
alpha(i)-alphaold(i))
300
301 IF(iflag1 == 1) THEN
302 dalpha=(pnew(i)-pnewg(i))/(dfda-dgda)
303 ELSEIF(iflag1 == 2) THEN
304 dalpha=(pnew(i)-pnewg(i))/((dfda-pnew(i))/
alpha(i)-dgda)
305 ENDIF
306 alpha1(i)=
alpha(i)-dalpha
307 alpha1(i)=
max(alpha1(i),one)
308 ENDDO
309
310 crit=-one
311 DO i=1,nel
312 IF(ipla(i)==2)cycle
313 beta=abs(
alpha(i)-alpha1(i))
314 IF(beta > crit) THEN
315 crit=beta
316 imax=i
317 ENDIF
318 ENDDO
319
320
321
322
323 IF (crit > tol) THEN
324 DO i=1,nel
326 ENDDO
327 GO TO 100
328 ENDIF
329 ELSE
330 CALL ancmsg(msgid=137,anmode=aninfo,i1=itemax)
332 ENDIF
333
334
335
336 iplas=0
337 DO i=1,nel
338 IF(ipla(i)==2)cycle
339 IF(pnew(i) > pyld(i)) THEN
340 ipla(i)=1
341 iplas=1
342 ENDIF
343 ENDDO
344 IF(iplas==0) GO TO 300
345
346
347
348 DO i=1,nel
349 IF(ipla(i)==1)
alpha(i)=alpha0(i)
350 ENDDO
351 iter=0
352 200 iter=iter+1
353
354
355
356 DO i=1,nel
357 rhos(i) =rho(i)*
alpha(i)
358 dvols(i)=dvol(i)-vnew(i)*(one-alphaold(i)/
alpha(i))
359 dvols(i)=dvols(i)/alphaold(i)
360 vnews(i)=vnew(i)/
alpha(i)
361 ENDDO
362
363
364
365 DO i=1,nel
366 mus(i) = (one + mu(i))*
alpha(i)/alphae - one
367 dfs(i) = one/(one+mus(i))
368 eintn(i)=eint(i)-half*pold(i)*dvols(i)
369 ENDDO
370
371
372
373 CALL eosmain(0 ,nel ,eostyp ,pm ,off ,eintn ,
374 . rhos ,rhos0 ,mus ,mu2s ,espes ,
375 . dvols ,dfs ,vnews ,mats ,psh ,
376 . pnew ,dpdm ,dpde ,theta ,
377 . bufmat,sigold,muold ,75 ,
378 . npf ,tf ,vareos ,nvareos,mat_param(mxs),
379 . bid, nvartmp_eos, vartmp_eos)
380 CALL eosmain(1 ,nel ,eostyp ,pm ,off ,eintn ,
381 . rhos ,rhos0 ,mus ,mu2s ,espes ,
382 . dvols ,dfs ,vnews ,mats ,psh ,
383 . pnew ,dpdm ,dpde ,theta ,
384 . bufmat,sigold,muold ,75 ,
385 . npf ,tf ,vareos ,nvareos,mat_param(mxs),
386 . bid, nvartmp_eos, vartmp_eos)
387 IF(iflag1 == 2) THEN
388 DO i=1,nel
389 pnew(i)=pnew(i)/
alpha(i)
390 ENDDO
391 ENDIF
392
393
394
395 IF (iter <= itemax) THEN
396
397
398
399 DO i=1,nel
400 IF(ipla(i)/=1)cycle
401 dfda=dpdm(i)*(one+mu(i))/alphae + dpde(i)*eint(i)/vol0(i)
402 dgda=-xi*unsurn*(
max(
alpha(i)-one,em20))**(unsurn-one)
403 pnewg(i)=ps-xi*(
max(
alpha(i)-one,em20))**unsurn
404
405 IF(iflag1 == 1) THEN
406 dalpha=(pnew(i)-pnewg(i))/(dfda-dgda)
407 ELSEIF(iflag1 == 2) THEN
408 dalpha=(pnew(i)-pnewg(i))/((dfda-pnew(i))/
alpha(i)-dgda)
409 ENDIF
410 alpha1(i)=
alpha(i)-dalpha
411 alpha1(i)=
max(alpha1(i),one)
412 ENDDO
413
414 crit=-one
415 DO i=1,nel
416 IF(ipla(i)/=1)cycle
417 beta=abs(
alpha(i)-alpha1(i))
418 IF(beta > crit) THEN
419 crit=beta
420 imax=i
421 ENDIF
422 ENDDO
423
424
425
426
427 IF (crit > tol) THEN
428 DO i=1,nel
430 ENDDO
431 GO TO 200
432 ENDIF
433 ELSE
434 CALL ancmsg(msgid=137,anmode=aninfo,i1=itemax)
436 ENDIF
437
438
439
440 300 CONTINUE
441 DO i=1,nel
442 IF(
alpha(i) > one)
THEN
443 IF(ipla(i) == 1) THEN
444 IF(pnew(i) < ps) THEN
445 alphayld(i)= one+ eta*(ps-pnew(i))**en
446 ELSE
447 alphayld(i)=one
448 ENDIF
449 ENDIF
450 ENDIF
451 ENDDO
452
453
454
455 IF(iflag2==2)THEN
456 DO i=1,nel
457 dav = (depsxx(i)+depsyy(i)+depszz(i))*third
458 g =
max(zero,gs+dgdalpha*(
alpha(i)-one))
459 g2 = two*g
460 signxx(i)=sigoxx(i)+pold(i)+g2*(depsxx(i)-dav)
461 signyy(i)=sigoyy(i)+pold(i)+g2*(depsyy(i)-dav)
462 signzz(i)=sigozz(i)+pold(i)+g2*(depszz(i)-dav)
463 signxy(i)=sigoxy(i)+g*depsxy(i)
464 signyz(i)=sigoyz(i)+g*depsyz(i)
465 signzx(i)=sigozx(i)+g*depszx(i)
466 ENDDO
467 ENDIF
468
469
470
471 DO i=1,nel
472 uvar(i,2)=theta(i)
474 uvar(i,4)=alphayld(i)
475 signxx(i)=signxx(i)-pnew(i)
476 signyy(i)=signyy(i)-pnew(i)
477 signzz(i)=signzz(i)-pnew(i)
478
479 viscmax(i)=zero
480 ENDDO
481
482 DO i=1,nel
483 IF(
alpha(i) > one)
THEN
484 soundsp(i)=sqrt(bulk0/rhos0(1))*(aa*(
alpha
485 ELSE
486 soundsp(i)=sqrt(bulk0/rhos0(1))
487 ENDIF
488 ENDDO
489
490 RETURN
subroutine eosmain(iflag, nel, eostyp, pm, off, eint, rho, rho0, mu, mu2, espe, dvol, df, vnew, mat, psh, pnew, dpdm, dpde, theta, bufmat, sig, mu_bak, mlw, npf, tf, vareos, nvareos, mat_param, bfrac, nvartmp, vartmp)
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)