47
48
49
50#include "implicit_f.inc"
51#include "comlock.inc"
52
53
54
55#include "mvsiz_p.inc"
56
57
58
59#include "com08_c.inc"
60#include "scr02_c.inc"
61#include "scr18_c.inc"
62#include "param_c.inc"
63#include "cong1_c.inc"
64#include "units_c.inc"
65#include "scr07_c.inc"
66
67
68
69 INTEGER, INTENT(IN) :: NEL
70 INTEGER, INTENT(IN) :: ITY
71 INTEGER, INTENT(IN) :: JTUR
72 INTEGER, INTENT(IN) :: JTHE
73 INTEGER NELTST,,PID(*),(*), NGL(*)
75
77 . pm(npropm,*), off(*), rho(*), rk(*), t(*),
78 . re(*),sti(*),offg(*),geo(npropg,*),mumax(*),
79 . vol(*), vd2(*), deltax(*), ssp(*), vis(*),
80 . psh(*), pnew(*),qvis(*) ,ssp_eq(*), d1(*),
81 . d2(*), d3(*)
83 INTEGER,INTENT(IN) :: G_DT
84
85
86
87 INTEGER I,J, MT
89 . al(mvsiz),dtx(mvsiz), qx(mvsiz), cx(mvsiz), qxmater(mvsiz),
90 . qa, qb, visi, facq,
91 . cns1, cns2, sph, ak1, bk1, ak2, bk2, tli, akk, xmu, tmu, rpr,
92 . atu
93
94
95
96 IF(impl==zero)THEN
97 DO i=1,nel
98 cx(i)=ssp(i)+sqrt(vd2(i))
99 ENDDO
100 visi=one
101 facq=one
102 ELSE
103 DO i=1,nel
104 cx(i)=sqrt(vd2(i))
105 ENDDO
106 visi=zero
107 facq=zero
108 ENDIF
109
110
111
112 DO i=1,nel
113 al(i)=zero
114 IF(off(i)<1.) cycle
115 al(i)=vol(i)**third
116 ENDDO
117
118 mt = mat(1)
119 DO i=1,nel
120 qa =facq*geo(14,pid(i))
121 qb =facq*geo(15,pid(i))
122 cns1=geo(16,pid(i))
123 cns2=geo(17,pid(i))*ssp(i)*al(i)*rho(i)
124 psh(i)=pm(88,mt)
125 pnew(i)=zero
126 qxmater(i)=cns1*ssp(i) + visi*(two*vis(i)+cns2) /
max(em20,rho(i)*deltax(i))
127 qx(i)=qb*ssp(i) + qa*mumax(i) + qxmater(i)
128 qvis(i)=zero
129 ENDDO
130
131 DO i=1,nel
132 dtx(i)=deltax(i)/
max(em20,qx(i)+sqrt(qx(i)*qx(i)+cx(i)*cx(i)))
133
134 ssp_eq(i) =
max(em20,qxmater(i)+sqrt(qxmater(i)*qxmater(i)+cx(i)*cx(i)))
135 ENDDO
136
137 IF(jthe/=0)THEN
138 mt = mat(1)
139 sph = pm(69,mt)
140 ak1 = pm(75,mt)
141 bk1 = pm(76,mt)
142 ak2 = pm(77,mt)
143 bk2 = pm(78,mt)
144 tli = pm(80,mt)
145 DO i=1,nel
146 IF(t(i)<tli)THEN
147 akk=ak1+bk1*t(i)
148 ELSE
149 akk=ak2+bk2*t(i)
150 ENDIF
151 IF(jtur/=0)THEN
152 xmu = rho(i)*pm(24,mt)
153 tmu = pm(81,mt)
154 rpr = pm(95,mt)
155 atu=rpr*tmu*rk(i)*rk(i)/(
max(em15,re(i)*vol(i))*xmu)
156 akk=akk*(one + atu)
157 ENDIF
158 dtx(i) =
min(dtx(i),half*deltax(i)*deltax(i)*sph/akk)
159 ENDDO
160 ENDIF
161
162 DO i=1,nel
163 sti(i) = zero
164 IF(off(i)==zero) cycle
165 sti(i) = two*rho(i) * vol(i) / (dtx(i)*dtx(i))
166 dtx(i)= dtfac1(ity)*dtx(i)
167
168 IF(nodadt==0)dt2t=
min(dtx(i),dt2t)
169 ENDDO
170
171 IF(g_dt/=zero)THEN
172 DO i=1,nel
174 ENDDO
175 ENDIF
176
177
178 IF(nodadt==0)THEN
179 IF(idtmin(ity)==1)THEN
180 DO 170 i=1,nel
181 IF(dtx(i)>dtmin1(ity).OR.off(i)==zero) GO TO 170
182 tstop = tt
183#include "lockon.inc"
184 WRITE(iout,*) ' **ERROR : TIME STEP LESS OR EQUAL DTMIN FOR SPH PARTICLE'
185 WRITE(istdo,*)' **ERROR : TIME STEP LESS OR EQUAL DTMIN FOR SPH PARTICLE'
186#include "lockoff.inc"
187 170 CONTINUE
188 ELSEIF(idtmin(ity)==2)THEN
189 DO 270 i=1,nel
190 IF(dtx(i)>dtmin1(ity).OR.off(i)==zero) GO TO 270
191 off(i) = zero
192#include "lockon.inc"
193 WRITE(iout,*) ' -- DELETE SPH PARTICLE',ngl(i)
194 WRITE(istdo,*)' -- DELETE SPH PARTICLE',ngl(i)
195#include "lockoff.inc"
196 270 CONTINUE
197 ELSEIF(idtmin(ity)==5)THEN
198 DO 570 i=1,nel
199 IF(dtx(i)>dtmin1(ity).OR.off(i)==0.) GO TO 570
200 mstop = 2
201#include "lockon.inc"
202 WRITE(iout,*)
203 . ' **ERROR : TIME STEP LESS OR EQUAL DTMIN FOR SPH PARTICLE'
204 WRITE(istdo,*)
205 . ' **ERROR : TIME STEP LESS OR EQUAL DTMIN FOR SPH PARTICLE'
206#include "lockoff.inc"
207 570 CONTINUE
208 ENDIF
209
210 DO i=1,nel
211 IF(dtx(i)>dt2t.OR.off(i)==zero) cycle
212
213 neltst =ngl(i)
214 ityptst=ity
215 ENDDO
216
217 ENDIF
218
219 RETURN
subroutine dtsph(ssp, pm, geo, pid, mat, rho0, vis, deltax, vol, dtx)