1 : C CONJP6 SOURCE CHAT 05/01/12 22:17:53 5004
2 : SUBROUTINE CONJP6(JL,JR,WVEC_L,WVEC_R,NVECT,TVECT,
3 : & ga,v_inf)
4 : C************************************************************************
5 : C
6 : C PROJET : CASTEM 2000
7 : C
8 : C NOM : CONJP6
9 : C
10 : C DESCRIPTION : Voir KONJP5
11 : C
12 : C LANGAGE : FORTRAN 77 + ESOPE 2000 (avec estensions CISI)
13 : C
14 : C AUTEUR : S. KUDRIAKOV, DM2S/SFME/LTMF
15 : C
16 : C************************************************************************
17 : C
18 : c----------------------------------------------------------------------
19 : c GENERAL DESCRIPTION:
20 : c This subroutine provides the jacobians which are the derivatives
21 : c of the numerical flux function defined at the cell interface
22 : c with respect to the PRIMITIVE variables of the left and right
23 : c cells (relative to the cell interface).
24 : c The low-mach number corrections are made for the flux functions
25 : c
26 : c EQUATIONS: 2D Euler equations of gas dynamics
27 : c
28 : c
29 : c REFERENCE: 1) JCP, 129, 364-382 (1996)
30 : c " A Sequel to AUSM: AUSM+ ".
31 : c M.S.Liou
32 : c 2) AIAA Journal, Sept. 1998
33 : c " Low-Diffusion Flux-Splitting Methods for Flows at All Speeds"
34 : c J.R.Edwards and M.S.Liou
35 : c----------------------------------------------------------------------
36 : c INPUT:
37 : c
38 : c alpha -- parameter of the AUSM+ scheme in the Pressure function;
39 : c ( -3/4 <= alpha <= 3/16 ) (imposed as a parameter)
40 : c
41 : c beta -- parameter of the AUSM+ scheme in the Mach function;
42 : c ( -1/16 <= beta <= 1/2 ) (imposed as a parameter)
43 : c
44 : c wvec_l -- vector of the primitive variables (rho,ux,uy,p) at the
45 : c left cell;
46 : c
47 : c wvec_r -- vector of the primitive variables (rho,ux,uy,p) at the
48 : c right cell;
49 : c
50 : c nvect -- normal vector to the interface (2 components in 2D);
51 : c
52 : c tvect -- tangential vector to the interface;
53 : c
54 : c ga -- ratio of the specific heats (assumed constant)
55 : c
56 : c v_inf -- parameter for reference velocity, see Ref. 2).
57 : c----------------------------------------------------------------------
58 : c
59 : c OUTPUT:
60 : c
61 : c jl -- jakobian matrix 4 by 4 - derivatives of the numerical
62 : c flux function with respect to the PRIMITIVE variables
63 : c from the left cell;
64 : c
65 : c jr -- jakobian matrix 4 by 4 - derivatives of the numerical
66 : c flux function with respect to the PRIMITIVE variables
67 : c from the right cell.
68 : c----------------------------------------------------------------------
69 : IMPLICIT INTEGER(I-N)
70 : real*8 wvec_l(4),wvec_r(4)
71 : real*8 nvect(2),tvect(2)
72 : real*8 jl(4,4),jr(4,4)
73 : real*8 alpha,beta
74 : real*8 ga,gm1,temph
75 : real*8 n_x,n_y,t_x,t_y
76 : real*8 un_l, un_r, ut_l, ut_r
77 : real*8 ml,mr,Mplus,Mmin,mmid
78 : real*8 mpl_m, mmin_m,am
79 : real*8 rold_l,uold_l,vold_l,pold_l,eold_l
80 : real*8 rold_r,uold_r,vold_r,pold_r,eold_r
81 : real*8 Pplus,Pmin
82 : real*8 hr_l,hr_r,top,bot,bots
83 : real*8 br1,br3,br4,temp_l,temp_r,brac_l,brac_r
84 : real*8 aleft, arigh
85 : real*8 damr_l,damr_r,damu_l,damu_r
86 : real*8 damv_l,damv_r,damp_l,damp_r
87 : real*8 dmlr_l,dmlr_r,dmlu_l,dmlu_r
88 : real*8 dmlv_l,dmlv_r,dmlp_l,dmlp_r
89 : real*8 dmrr_l,dmrr_r,dmru_l,dmru_r
90 : real*8 dmrv_l,dmrv_r,dmrp_l,dmrp_r
91 : real*8 dMpr_l,dMpr_r,dMpu_l,dMpu_r
92 : real*8 dMpv_l,dMpv_r,dMpp_l,dMpp_r
93 : real*8 dMmr_l,dMmr_r,dMmu_l,dMmu_r
94 : real*8 dMmv_l,dMmv_r,dMmp_l,dMmp_r
95 : real*8 dmir_l,dmir_r,dmiu_l,dmiu_r
96 : real*8 dmiv_l,dmiv_r,dmip_l,dmip_r
97 : real*8 d3mr_l,d3mr_r,d3mu_l,d3mu_r
98 : real*8 d3mv_l,d3mv_r,d3mp_l,d3mp_r
99 : real*8 d2mr_l,d2mr_r,d2mu_l,d2mu_r
100 : real*8 d2mv_l,d2mv_r,d2mp_l,d2mp_r
101 : real*8 dPpr_l,dPpr_r,dPpu_l,dPpu_r
102 : real*8 dPpv_l,dPpv_r,dPpp_l,dPpp_r
103 : real*8 dPmr_l,dPmr_r,dPmu_l,dPmu_r
104 : real*8 dPmv_l,dPmv_r,dPmp_l,dPmp_r
105 : real*8 dpir_l,dpir_r,dpiu_l,dpiu_r
106 : real*8 dpiv_l,dpiv_r,dpip_l,dpip_r
107 : real*8 epsil,qq,amw,Mmin1,Mplus1
108 : real*8 fmid,mlw,mrw,termp
109 : real*8 ur_r,ur_l,urm,mhalf,mhalfr
110 : real*8 durr_l,durr_r,duru_l,duru_r
111 : real*8 durv_l,durv_r,durp_l,durp_r
112 : real*8 dmhr_l,dmhr_r,dmhu_l,dmhu_r
113 : real*8 dmhv_l,dmhv_r,dmhp_l,dmhp_r
114 : real*8 dmfr_l,dmfr_r,dmfu_l,dmfu_r
115 : real*8 dmfv_l,dmfv_r,dmfp_l,dmfp_r
116 : real*8 dfm_mf,dfm_mh
117 : real*8 dfmr_l,dfmr_r,dfmu_l,dfmu_r
118 : real*8 dfmv_l,dfmv_r,dfmp_l,dfmp_r
119 : real*8 m1mr_l,m1mr_r,m1mu_l,m1mu_r
120 : real*8 m1mv_l,m1mv_r,m1mp_l,m1mp_r
121 : real*8 m1pr_l,m1pr_r,m1pu_l,m1pu_r
122 : real*8 m1pv_l,m1pv_r,m1pp_l,m1pp_r
123 : real*8 tmpr_l,tmpr_r,tmpu_l,tmpu_r
124 : real*8 tmpv_l,tmpv_r,tmpp_l,tmpp_r
125 : real*8 coef,canc,v_inf
126 : real*8 sr_l,sr_r,su_l,su_r,sv_l,sv_r,sp_l,sp_r
127 : real*8 rum,rumr_l,rumu_l,rumv_l,rump_l
128 : real*8 rumr_r,rumu_r,rumv_r,rump_r
129 : parameter(alpha = 0.1875D0, beta = 0.125D0)
130 : parameter(epsil = 1.0d0)
131 : canc=1.0d0
132 : c-------------------------------------------------------------
133 : n_x=nvect(1)
134 : n_y=nvect(2)
135 : t_x=tvect(1)
136 : t_y=tvect(2)
137 : c----------------------------
138 : gm1=ga-1.0d0
139 : c----------------------------
140 : rold_l=wvec_l(1)
141 : uold_l=wvec_l(2)
142 : vold_l=wvec_l(3)
143 : pold_l=wvec_l(4)
144 : c-----------------------
145 : rold_r=wvec_r(1)
146 : uold_r=wvec_r(2)
147 : vold_r=wvec_r(3)
148 : pold_r=wvec_r(4)
149 : c------------------------------------------------------------------
150 : c Computation of the specific total energy on the left and right.
151 : c------------------------------------------------------------------
152 : eold_l=(uold_l*uold_l+vold_l*vold_l)/2.0d0
153 : eold_l=eold_l+pold_l/(gm1*rold_l)
154 : eold_r=(uold_r*uold_r+vold_r*vold_r)/2.0d0
155 : eold_r=eold_r+pold_r/(gm1*rold_r)
156 : c------------------------------------------------------------------
157 : c Computing reference velocity and its derivatives
158 : c------------------------------------------------------------------
159 : aleft=sqrt(ga*pold_l/rold_l)
160 : arigh=sqrt(ga*pold_r/rold_r)
161 : qq=sqrt(uold_l*uold_l+vold_l*vold_l)
162 : if(qq .lt. (epsil*v_inf)) then
163 : ur_l = epsil*v_inf
164 : durr_l=0.0d0
165 : duru_l=0.0d0
166 : durv_l=0.0d0
167 : durp_l=0.0d0
168 : else
169 : ur_l=qq
170 : durr_l=0.0d0
171 : duru_l=uold_l/qq
172 : durv_l=vold_l/qq
173 : durp_l=0.0d0
174 : endif
175 : c-----------------------
176 : if(ur_l .ge. aleft) then
177 : ur_l=aleft
178 : durr_l=-aleft/(2.0d0*rold_l)
179 : duru_l=0.0d0
180 : durv_l=0.0d0
181 : durp_l=ga/(2.0d0*aleft*rold_l)
182 : endif
183 : c------------------------------------------------------------------
184 : c-------------------------------------------------------------------
185 : qq=sqrt(uold_r*uold_r+vold_r*vold_r)
186 : if(qq .lt. (epsil*v_inf)) then
187 : ur_r = epsil*v_inf
188 : durr_r=0.0d0
189 : duru_r=0.0d0
190 : durv_r=0.0d0
191 : durp_r=0.0d0
192 : else
193 : ur_r=qq
194 : durr_r=0.0d0
195 : duru_r=uold_r/qq
196 : durv_r=vold_r/qq
197 : durp_r=0.0d0
198 : endif
199 : c----------------------------
200 : if(ur_r .ge. arigh) then
201 : ur_r=arigh
202 : durr_r=-arigh/(2.0d0*rold_r)
203 : duru_r=0.0d0
204 : durv_r=0.0d0
205 : durp_r=ga/(2.0d0*arigh*rold_r)
206 : endif
207 : c------------------------------------------------------------------
208 : c Reference velocity at the interface is taken as an average
209 : c of the reference velocities of the neighbouring cells
210 : c-------------------------------------------------------------------
211 : urm=0.5d0*(ur_l+ur_r)
212 : durr_l=0.5d0*durr_l
213 : duru_l=0.5d0*duru_l
214 : durv_l=0.5d0*durv_l
215 : durp_l=0.5d0*durp_l
216 : c-------------------------
217 : durr_r=0.5d0*durr_r
218 : duru_r=0.5d0*duru_r
219 : durv_r=0.5d0*durv_r
220 : durp_r=0.5d0*durp_r
221 : c-------------------------------------------------------------------
222 : c Computation of the speed of sound and its derivatives;
223 : c numerical speed of sound at the interface is taken as an average
224 : c of the speeds of sounds of the neighbouring cells
225 : c-------------------------------------------------------------------
226 : am=0.5d0*(aleft+arigh)
227 : c-------------------------------------------------------------------
228 : if(abs(urm/am-1.0d0).le.0.000001d0) then
229 : coef=0.0d0
230 : else
231 : coef=1.0d0
232 : endif
233 : c-------------------------------------------------------------------
234 : damr_r=-arigh/(4.0d0*rold_r)
235 : damu_r=0.0d0
236 : damv_r=0.0d0
237 : damp_r=ga/(4.0d0*arigh*rold_r)
238 : c-----------------------
239 : damr_l=-aleft/(4.0d0*rold_l)
240 : damu_l=0.0d0
241 : damv_l=0.0d0
242 : damp_l=ga/(4.0d0*aleft*rold_l)
243 : c-------------------------------------------------------------------
244 : c Computing numerical Mach number and its derivatives,
245 : c see p.370, under (A1).
246 : c-------------------------------------------------------------------
247 : un_l=uold_l*n_x+vold_l*n_y
248 : un_r=uold_r*n_x+vold_r*n_y
249 : ut_l=uold_l*t_x+vold_l*t_y
250 : ut_r=uold_r*t_x+vold_r*t_y
251 : c-------------------------------------------------------------------
252 : ml=un_l/am
253 : mr=un_r/am
254 : mhalf=0.5d0*(un_l+un_r)/am
255 : c---------------------
256 : top=0.5d0*(un_l+un_r)/(am*am)
257 : dmhr_l=-top*damr_l
258 : dmhu_l=n_x/2.0d0/am-top*damu_l
259 : dmhv_l=n_y/2.0d0/am-top*damv_l
260 : dmhp_l=-top*damp_l
261 : c---------------------
262 : dmhr_r=-top*damr_r
263 : dmhu_r=n_x/2.0d0/am-top*damu_r
264 : dmhv_r=n_y/2.0d0/am-top*damv_r
265 : dmhp_r=-top*damp_r
266 : c--------------------------------
267 : mhalfr=urm/am
268 : c---------------------
269 : top=urm/(am*am)
270 : dmfr_l=durr_l/am-top*damr_l
271 : dmfu_l=duru_l/am-top*damu_l
272 : dmfv_l=durv_l/am-top*damv_l
273 : dmfp_l=durp_l/am-top*damp_l
274 : c---------------------
275 : dmfr_r=durr_r/am-top*damr_r
276 : dmfu_r=duru_r/am-top*damu_r
277 : dmfv_r=durv_r/am-top*damv_r
278 : dmfp_r=durp_r/am-top*damp_r
279 : c-------------------------------------------------------------------
280 : c Scaling function for the speed of sound and its derivatives
281 : c-------------------------------------------------------------------
282 : top=(1.0d0-mhalfr*mhalfr)*(1.0d0-mhalfr*mhalfr)
283 : top=top*mhalf*mhalf+4.0d0*mhalfr*mhalfr
284 : bot=1.0d0+mhalfr*mhalfr
285 : if(abs(canc-0.0d0).lt.0.000001d0) then
286 : fmid=1.0d0
287 : else
288 : fmid=sqrt(top)/bot
289 : endif
290 : c--------------------------
291 : temph=-4.0d0*(1.0d0-mhalfr*mhalfr)*mhalfr
292 : temph=temph*mhalf*mhalf+8.0d0*mhalfr
293 : dfm_mf=temph/(sqrt(top)*2.0d0*bot)
294 : dfm_mf=dfm_mf-sqrt(top)*2.0d0*mhalfr/(bot*bot)
295 : c--------------------------
296 : temph=2.0d0*(1.0d0-mhalfr*mhalfr)*(1.0d0-mhalfr*mhalfr)*mhalf
297 : dfm_mh=temph/(2.0d0*bot*sqrt(top))
298 : c--------------------------
299 : dfmr_l=dfm_mf*dmfr_l+dfm_mh*dmhr_l
300 : dfmu_l=dfm_mf*dmfu_l+dfm_mh*dmhu_l
301 : dfmv_l=dfm_mf*dmfv_l+dfm_mh*dmhv_l
302 : dfmp_l=dfm_mf*dmfp_l+dfm_mh*dmhp_l
303 : c--------------------------
304 : dfmr_r=dfm_mf*dmfr_r+dfm_mh*dmhr_r
305 : dfmu_r=dfm_mf*dmfu_r+dfm_mh*dmhu_r
306 : dfmv_r=dfm_mf*dmfv_r+dfm_mh*dmhv_r
307 : dfmp_r=dfm_mf*dmfp_r+dfm_mh*dmhp_r
308 : c--------------------------
309 : amw=fmid*am
310 : mlw=un_l/amw
311 : mrw=un_r/amw
312 : c--------------------------
313 : damr_l=canc*coef*dfmr_l*am+fmid*damr_l
314 : damu_l=canc*coef*dfmu_l*am+fmid*damu_l
315 : damv_l=canc*coef*dfmv_l*am+fmid*damv_l
316 : damp_l=canc*coef*dfmp_l*am+fmid*damp_l
317 : c--------------------------
318 : damr_r=canc*coef*dfmr_r*am+fmid*damr_r
319 : damu_r=canc*coef*dfmu_r*am+fmid*damu_r
320 : damv_r=canc*coef*dfmv_r*am+fmid*damv_r
321 : damp_r=canc*coef*dfmp_r*am+fmid*damp_r
322 : c-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/
323 : am=amw
324 : c-------------------------------------------------------------------
325 : c Redefinition of the numerical mach numbers
326 : c-------------------------------------------------------------------
327 : if(abs(canc-0.0d0).lt.0.000001d0) then
328 : top=2.0d0
329 : bot=0.0d0
330 : else
331 : top=1.0d0+mhalfr*mhalfr
332 : bot=1.0d0-mhalfr*mhalfr
333 : endif
334 : ml=0.5d0*(top*mlw+bot*mrw)
335 : mr=0.5d0*(top*mrw+bot*mlw)
336 : c-------------------------------------------------------------------
336 : c Mplus and Mmin are calligraphic lettes M+ and M- from the paper,
337 : c see (19a) and (19b), p.367.
338 : c-------------------------------------------------------------------
339 : if(abs(ml) .ge. 1.0d0) then
340 : Mplus=(ml+abs(ml))/2.0d0
341 : else
342 : Mplus=(ml+1.0d0)*(ml+1.0d0)/4.0d0
343 : Mplus=Mplus+beta*(ml*ml-1.0d0)*(ml*ml-1.0d0)
344 : endif
345 : Mplus1=(ml+abs(ml))/2.0d0
346 : c-------------------------------------------------------------------
347 : if(abs(mr) .ge. 1.0d0) then
348 : Mmin=(mr-abs(mr))/2.0d0
349 : else
350 : Mmin=-(mr-1.0d0)*(mr-1.0d0)/4.0d0
351 : Mmin=Mmin-beta*(mr*mr-1.0d0)*(mr*mr-1.0d0)
352 : endif
353 : Mmin1=(mr-abs(mr))/2.0d0
354 : c-------------------------------------------------------------------
355 : c Derivatives of ml and mr with respect to both sets of primitive
356 : c variables: left and right.
357 : c-------------------------------------------------------------------
358 : temp_l=-un_l/(am*am)
359 : temp_r=-un_r/(am*am)
360 : c--------
361 : dmlr_l=temp_l*damr_l
362 : dmlr_r=temp_l*damr_r
363 : dmrr_l=temp_r*damr_l
364 : dmrr_r=temp_r*damr_r
365 : c--------
366 : dmlu_l=n_x/am+temp_l*damu_l
367 : dmlu_r=temp_l*damu_r
368 : dmru_l=temp_r*damu_l
369 : dmru_r=n_x/am+temp_r*damu_r
370 : c--------
371 : dmlv_l=n_y/am+temp_l*damv_l
372 : dmlv_r=temp_l*damv_r
373 : dmrv_l=temp_r*damv_l
374 : dmrv_r=n_y/am+temp_r*damv_r
375 : c--------
376 : dmlp_l=temp_l*damp_l
377 : dmlp_r=temp_l*damp_r
378 : dmrp_l=temp_r*damp_l
379 : dmrp_r=temp_r*damp_r
380 : c-----------------------------
381 : sr_l=dmlr_l
382 : sr_r=dmlr_r
383 : su_l=dmlu_l
384 : su_r=dmlu_r
385 : sv_l=dmlv_l
386 : sv_r=dmlv_r
387 : sp_l=dmlp_l
388 : sp_r=dmlp_r
389 : c-----------------------------------------------------------------
390 : c Redefinition of the derivatives of the ml & mr
391 : c-----------------------------------------------------------------
392 : temp_l=(mlw-mrw)*mhalfr
393 : temp_r=-temp_l
394 : c--------
395 : dmlr_l=0.5d0*(top*dmlr_l+bot*dmrr_l)+canc*coef*temp_l*dmfr_l
396 : dmlu_l=0.5d0*(top*dmlu_l+bot*dmru_l)+canc*coef*temp_l*dmfu_l
397 : dmlv_l=0.5d0*(top*dmlv_l+bot*dmrv_l)+canc*coef*temp_l*dmfv_l
398 : dmlp_l=0.5d0*(top*dmlp_l+bot*dmrp_l)+canc*coef*temp_l*dmfp_l
399 : c--------
400 : dmlr_r=0.5d0*(top*dmlr_r+bot*dmrr_r)+canc*coef*temp_l*dmfr_r
401 : dmlu_r=0.5d0*(top*dmlu_r+bot*dmru_r)+canc*coef*temp_l*dmfu_r
402 : dmlv_r=0.5d0*(top*dmlv_r+bot*dmrv_r)+canc*coef*temp_l*dmfv_r
403 : dmlp_r=0.5d0*(top*dmlp_r+bot*dmrp_r)+canc*coef*temp_l*dmfp_r
404 : c--------
405 : dmrr_l=0.5d0*(top*dmrr_l+bot*sr_l)+canc*coef*temp_r*dmfr_l
406 : dmru_l=0.5d0*(top*dmru_l+bot*su_l)+canc*coef*temp_r*dmfu_l
407 : dmrv_l=0.5d0*(top*dmrv_l+bot*sv_l)+canc*coef*temp_r*dmfv_l
408 : dmrp_l=0.5d0*(top*dmrp_l+bot*sp_l)+canc*coef*temp_r*dmfp_l
409 : c--------
410 : dmrr_r=0.5d0*(top*dmrr_r+bot*sr_r)+canc*coef*temp_r*dmfr_r
411 : dmru_r=0.5d0*(top*dmru_r+bot*su_r)+canc*coef*temp_r*dmfu_r
412 : dmrv_r=0.5d0*(top*dmrv_r+bot*sv_r)+canc*coef*temp_r*dmfv_r
413 : dmrp_r=0.5d0*(top*dmrp_r+bot*sp_r)+canc*coef*temp_r*dmfp_r
414 : c-----------------------------------------------------------
415 : c mmid is m_{1/2} (notation as in the paper, see (13),p.366)
416 : c-----------------------------------------------------------
417 : mmid=Mplus+Mmin
418 : c-----------------------------------------------------------
419 : c Computing the derivatives of M+ and M-
420 : c-----------------------------------------------------------
421 : if(ml .ge. 1.0d0) then
422 : dMpr_l=dmlr_l
423 : dMpu_l=dmlu_l
424 : dMpv_l=dmlv_l
425 : dMpp_l=dmlp_l
426 : c--------------------
427 : dMpr_r=dmlr_r
428 : dMpu_r=dmlu_r
429 : dMpv_r=dmlv_r
430 : dMpp_r=dmlp_r
431 : else
432 : if((ml .gt. -1.0d0) .and. (ml .lt. 1.0d0)) then
433 : temph=(ml+1.0d0)/2.0d0
434 : dMpr_l=(temph+4.0d0*beta*ml*(ml*ml-1.0d0))*dmlr_l
435 : dMpu_l=(temph+4.0d0*beta*ml*(ml*ml-1.0d0))*dmlu_l
436 : dMpv_l=(temph+4.0d0*beta*ml*(ml*ml-1.0d0))*dmlv_l
437 : dMpp_l=(temph+4.0d0*beta*ml*(ml*ml-1.0d0))*dmlp_l
438 : c--------------------
439 : dMpr_r=(temph+4.0d0*beta*ml*(ml*ml-1.0d0))*dmlr_r
440 : dMpu_r=(temph+4.0d0*beta*ml*(ml*ml-1.0d0))*dmlu_r
441 : dMpv_r=(temph+4.0d0*beta*ml*(ml*ml-1.0d0))*dmlv_r
442 : dMpp_r=(temph+4.0d0*beta*ml*(ml*ml-1.0d0))*dmlp_r
443 : else
444 : dMpr_l=0.0d0
445 : dMpu_l=0.0d0
446 : dMpv_l=0.0d0
447 : dMpp_l=0.0d0
448 : c---------------------
449 : dMpr_r=0.0d0
450 : dMpu_r=0.0d0
451 : dMpv_r=0.0d0
452 : dMpp_r=0.0d0
453 : endif
454 : endif
455 : c-----------------------------------------------------------
456 : c addition of low Mach number
457 : c-----------------------------------------------------------
458 : if(ml .ge. 0.0d0) then
459 : m1pr_l=dmlr_l
460 : m1pu_l=dmlu_l
461 : m1pv_l=dmlv_l
462 : m1pp_l=dmlp_l
463 : c---------------------
464 : m1pr_r=dmlr_r
465 : m1pu_r=dmlu_r
466 : m1pv_r=dmlv_r
467 : m1pp_r=dmlp_r
468 : else
469 : m1pr_l=0.0d0
470 : m1pu_l=0.0d0
471 : m1pv_l=0.0d0
472 : m1pp_l=0.0d0
473 : c--------------------
474 : m1pr_r=0.0d0
475 : m1pu_r=0.0d0
476 : m1pv_r=0.0d0
477 : m1pp_r=0.0d0
478 : endif
479 : c-----------------------------------------------------------
480 : if(mr .ge. 1.0d0) then
481 : dMmr_l=0.0d0
482 : dMmu_l=0.0d0
483 : dMmv_l=0.0d0
484 : dMmp_l=0.0d0
485 : c---------------------
486 : dMmr_r=0.0d0
487 : dMmu_r=0.0d0
488 : dMmv_r=0.0d0
489 : dMmp_r=0.0d0
490 : else
491 : if((mr .gt. -1.0d0) .and. (mr .lt. 1.0d0)) then
492 : temph=(-mr+1.0d0)/2.0d0
493 : dMmr_l=(temph-4.0d0*beta*mr*(mr*mr-1.0d0))*dmrr_l
494 : dMmu_l=(temph-4.0d0*beta*mr*(mr*mr-1.0d0))*dmru_l
495 : dMmv_l=(temph-4.0d0*beta*mr*(mr*mr-1.0d0))*dmrv_l
496 : dMmp_l=(temph-4.0d0*beta*mr*(mr*mr-1.0d0))*dmrp_l
497 : c--------------------
498 : dMmr_r=(temph-4.0d0*beta*mr*(mr*mr-1.0d0))*dmrr_r
499 : dMmu_r=(temph-4.0d0*beta*mr*(mr*mr-1.0d0))*dmru_r
500 : dMmv_r=(temph-4.0d0*beta*mr*(mr*mr-1.0d0))*dmrv_r
501 : dMmp_r=(temph-4.0d0*beta*mr*(mr*mr-1.0d0))*dmrp_r
502 : else
503 : dMmr_l=dmrr_l
504 : dMmu_l=dmru_l
505 : dMmv_l=dmrv_l
506 : dMmp_l=dmrp_l
507 : c--------------------
508 : dMmr_r=dmrr_r
509 : dMmu_r=dmru_r
510 : dMmv_r=dmrv_r
511 : dMmp_r=dmrp_r
512 : endif
513 : endif
514 : c-----------------------------------------------------------
515 : c addition of low Mach number
516 : c-----------------------------------------------------------
517 : if(mr .le. 0.0d0) then
518 : m1mr_l=dmrr_l
519 : m1mu_l=dmru_l
520 : m1mv_l=dmrv_l
521 : m1mp_l=dmrp_l
522 : c---------------------
523 : m1mr_r=dmrr_r
524 : m1mu_r=dmru_r
525 : m1mv_r=dmrv_r
526 : m1mp_r=dmrp_r
527 : else
528 : m1mr_l=0.0d0
529 : m1mu_l=0.0d0
530 : m1mv_l=0.0d0
531 : m1mp_l=0.0d0
532 : c--------------------
533 : m1mr_r=0.0d0
534 : m1mu_r=0.0d0
535 : m1mv_r=0.0d0
536 : m1mp_r=0.0d0
537 : endif
538 : c-----------------------------------------------------------------
539 : c computing the derivatives of m_{1/2} (notation as in the paper)
540 : c-----------------------------------------------------------------
541 : dmir_l=dMpr_l+dMmr_l
542 : dmir_r=dMpr_r+dMmr_r
543 : c-------------
544 : dmiu_l=dMpu_l+dMmu_l
545 : dmiu_r=dMpu_r+dMmu_r
546 : c-------------
547 : dmiv_l=dMpv_l+dMmv_l
548 : dmiv_r=dMpv_r+dMmv_r
549 : c-------------
550 : dmip_l=dMpp_l+dMmp_l
551 : dmip_r=dMpp_r+dMmp_r
552 : c----------------------------------------------------------------
553 : c computing the main convective variables and their derivatives
554 : c mpl_m is m^{+}_{1/2} (paper's notation) and
555 : c mmin_m is m^{-}_{1/2} (paper's notation), see (A2) on p.370.
556 : c----------------------------------------------------------------
557 : termp=(Mmin1-Mmin+Mplus-Mplus1)*(1.0d0/(mhalfr*mhalfr)-1.0d0)
558 : termp=termp*(pold_l-pold_r)/(pold_l/rold_l+pold_r/rold_r)
559 : c-------------------------------------------------------------
560 : c derivatives of the termp
561 : c-------------------------------------------------------------
562 : top=(Mmin1-Mmin+Mplus-Mplus1)
563 : bots=1.0d0/(pold_l/rold_l+pold_r/rold_r)
564 : bot=(pold_l-pold_r)*bots
565 : temph=1.0d0/(mhalfr*mhalfr)-1.0d0
566 : c---------------------------
567 : tmpr_l=(m1mr_l-dMmr_l+dMpr_l-m1pr_l)*bot*temph
568 : tmpr_l=tmpr_l-2.0d0*bot*top*dmfr_l/(mhalfr*mhalfr*mhalfr)
569 : tmpr_l=tmpr_l+temph*top*bot*bots*(pold_l/rold_l/rold_l)
570 : c---------------------------
571 : tmpu_l=(m1mu_l-dMmu_l+dMpu_l-m1pu_l)*bot*temph
572 : tmpu_l=tmpu_l-2.0d0*bot*top*dmfu_l/(mhalfr*mhalfr*mhalfr)
573 : c---------------------------
574 : tmpv_l=(m1mv_l-dMmv_l+dMpv_l-m1pv_l)*bot*temph
575 : tmpv_l=tmpv_l-2.0d0*bot*top*dmfv_l/(mhalfr*mhalfr*mhalfr)
576 : c---------------------------
577 : tmpp_l=(m1mp_l-dMmp_l+dMpp_l-m1pp_l)*bot*temph
578 : tmpp_l=tmpp_l-2.0d0*bot*top*dmfp_l/(mhalfr*mhalfr*mhalfr)
579 : tmpp_l=tmpp_l+temph*top*bots*(1.0d0-bot/rold_l)
580 : c------------rrrrrrrr-------
581 : c------------rrrrrrrr-------
582 : tmpr_r=(m1mr_r-dMmr_r+dMpr_r-m1pr_r)*bot*temph
583 : tmpr_r=tmpr_r-2.0d0*bot*top*dmfr_r/(mhalfr*mhalfr*mhalfr)
584 : tmpr_r=tmpr_r+temph*top*bot*bots*(pold_r/rold_r/rold_r)
585 : c---------------------------
586 : tmpu_r=(m1mu_r-dMmu_r+dMpu_r-m1pu_r)*bot*temph
587 : tmpu_r=tmpu_r-2.0d0*bot*top*dmfu_r/(mhalfr*mhalfr*mhalfr)
588 : c---------------------------
589 : tmpv_r=(m1mv_r-dMmv_r+dMpv_r-m1pv_r)*bot*temph
590 : tmpv_r=tmpv_r-2.0d0*bot*top*dmfv_r/(mhalfr*mhalfr*mhalfr)
591 : c---------------------------
592 : tmpp_r=(m1mp_r-dMmp_r+dMpp_r-m1pp_r)*bot*temph
593 : tmpp_r=tmpp_r-2.0d0*bot*top*dmfp_r/(mhalfr*mhalfr*mhalfr)
594 : tmpp_r=tmpp_r-temph*top*bots*(1.0d0+bot/rold_r)
595 : c-------------------------------------------------------------
596 : if(mmid .ge. 0.0d0) then
597 : mpl_m = mmid
598 : d2mr_l=dmir_l
599 : d2mu_l=dmiu_l
600 : d2mv_l=dmiv_l
601 : d2mp_l=dmip_l
602 : c------------
603 : d2mr_r=dmir_r
604 : d2mu_r=dmiu_r
605 : d2mv_r=dmiv_r
606 : d2mp_r=dmip_r
607 : c------------
608 : else
609 : mpl_m = 0.0d0
610 : d2mr_l=0.0d0
611 : d2mu_l=0.0d0
612 : d2mv_l=0.0d0
613 : d2mp_l=0.0d0
614 : c------------
615 : d2mr_r=0.0d0
616 : d2mu_r=0.0d0
617 : d2mv_r=0.0d0
618 : d2mp_r=0.0d0
619 : endif
620 : c---------------------------------------------
621 : cc derivatives for the term termm
622 : cc------------------------------------------------------------------
623 : if(mmid .le. 0.0d0) then
624 : mmin_m = mmid
625 : d3mr_l=dmir_l
626 : d3mu_l=dmiu_l
627 : d3mv_l=dmiv_l
628 : d3mp_l=dmip_l
629 : c------------
630 : d3mr_r=dmir_r
631 : d3mu_r=dmiu_r
632 : d3mv_r=dmiv_r
633 : d3mp_r=dmip_r
634 : c------------
635 : else
636 : mmin_m = 0.0d0
637 : d3mr_l=0.0d0
638 : d3mu_l=0.0d0
639 : d3mv_l=0.0d0
640 : d3mp_l=0.0d0
641 : c------------
642 : d3mr_r=0.0d0
643 : d3mu_r=0.0d0
644 : d3mv_r=0.0d0
645 : d3mp_r=0.0d0
646 : endif
647 : c---------------------------------------------------------------
647 : c Computing the calligraphic P+ and P- with their derivatives,
648 : c see (21a) & (21b) on p.368.
649 : c---------------------------------------------------------------
650 : if(ml .ge. 1.0d0) then
651 : Pplus = 1.0d0
652 : else
653 : if((ml .gt. -1.0d0) .and. (ml .lt. 1.0d0)) then
654 : Pplus=(ml+1.0d0)*(ml+1.0d0)*(2.0d0-ml)/4.0d0
655 : Pplus=Pplus+alpha*ml*(ml*ml-1.0d0)*(ml*ml-1.0d0)
656 : else
657 : Pplus = 0.0d0
658 : endif
659 : endif
660 : c---------------------------------------------------------------
661 : if(mr .ge. 1.0d0) then
662 : Pmin = 0.0d0
663 : else
664 : if((mr .gt. -1.0d0) .and. (mr .lt. 1.0d0)) then
665 : Pmin=(mr-1.0d0)*(mr-1.0d0)*(2.0d0+mr)/4.0d0
666 : Pmin=Pmin-alpha*mr*(mr*mr-1.0d0)*(mr*mr-1.0d0)
667 : else
668 : Pmin = 1.0d0
669 : endif
670 : endif
671 : c---------------------------------------------------------------
672 : brac_l=(ml+1.0d0)*(2.0d0-ml)/2.0d0-(ml+1.0d0)*(ml+1.0d0)/4.0d0
673 : brac_l=brac_l+alpha*(ml*ml-1.0d0)*(ml*ml-1.0d0)
674 : brac_l=brac_l+4.0d0*alpha*ml*ml*(ml*ml-1.0d0)
675 : c--------------
676 : brac_r=(mr-1.0d0)*(2.0d0+mr)/2.0d0+(mr-1.0d0)*(mr-1.0d0)/4.0d0
677 : brac_r=brac_r-alpha*(mr*mr-1.0d0)*(mr*mr-1.0d0)
678 : brac_r=brac_r-4.0d0*alpha*mr*mr*(mr*mr-1.0d0)
679 : c---------------------------------------------------------------
680 : if((ml .gt. -1.0d0) .and. (ml .lt. 1.0d0)) then
681 : dPpr_l=brac_l*dmlr_l
682 : dPpr_r=brac_l*dmlr_r
683 : c------------
684 : dPpu_l=brac_l*dmlu_l
685 : dPpu_r=brac_l*dmlu_r
686 : c------------
687 : dPpv_l=brac_l*dmlv_l
688 : dPpv_r=brac_l*dmlv_r
689 : c------------
690 : dPpp_l=brac_l*dmlp_l
691 : dPpp_r=brac_l*dmlp_r
692 : c------------
693 : else
694 : dPpr_l=0.0d0
695 : dPpr_r=0.0d0
696 : c-----------
697 : dPpu_l=0.0d0
698 : dPpu_r=0.0d0
699 : c-----------
700 : dPpv_l=0.0d0
701 : dPpv_r=0.0d0
702 : c-----------
703 : dPpp_l=0.0d0
704 : dPpp_r=0.0d0
705 : c-----------
706 : endif
707 : c---------------------------------------------------------------
708 : if((mr .gt. -1.0d0) .and. (mr .lt. 1.0d0)) then
709 : dPmr_l=brac_r*dmrr_l
710 : dPmr_r=brac_r*dmrr_r
711 : c------------
712 : dPmu_l=brac_r*dmru_l
713 : dPmu_r=brac_r*dmru_r
714 : c------------
715 : dPmv_l=brac_r*dmrv_l
716 : dPmv_r=brac_r*dmrv_r
717 : c------------
718 : dPmp_l=brac_r*dmrp_l
719 : dPmp_r=brac_r*dmrp_r
720 : c------------
721 : else
722 : dPmr_l=0.0d0
723 : dPmr_r=0.0d0
724 : c-----------
725 : dPmu_l=0.0d0
726 : dPmu_r=0.0d0
727 : c-----------
728 : dPmv_l=0.0d0
729 : dPmv_r=0.0d0
730 : c-----------
731 : dPmp_l=0.0d0
732 : dPmp_r=0.0d0
733 : c-----------
734 : endif
735 : c-------------------------------------------------------------------
736 : c computing pmid -- p_{1/2} and its derivatives, see (20b), p.367.
737 : c-------------------------------------------------------------------
738 : dpir_l=dPpr_l*pold_l+dPmr_l*pold_r
739 : dpiu_l=dPpu_l*pold_l+dPmu_l*pold_r
740 : dpiv_l=dPpv_l*pold_l+dPmv_l*pold_r
741 : dpip_l=dPpp_l*pold_l+Pplus+dPmp_l*pold_r
742 : c----------------------------
743 : dpir_r=dPpr_r*pold_l+dPmr_r*pold_r
744 : dpiu_r=dPpu_r*pold_l+dPmu_r*pold_r
745 : dpiv_r=dPpv_r*pold_l+dPmv_r*pold_r
746 : dpip_r=dPpp_r*pold_l+Pmin+dPmp_r*pold_r
747 : c---------------------------------------------------------------------
748 : c Computation of the mass flux (rho * u)_1/2
749 : c---------------------------------------------------------------
750 : rum=am*(mpl_m*rold_l+mmin_m*rold_r)+canc*am*termp
751 : c-------------------------------------------------------
752 : rumr_l=damr_l*(mpl_m*rold_l+mmin_m*rold_r)+
753 : & am*(d2mr_l*rold_l+mpl_m+d3mr_l*rold_r)
754 : rumr_l=rumr_l+canc*coef*(damr_l*termp+am*tmpr_l)
755 : rumu_l=damu_l*(mpl_m*rold_l+mmin_m*rold_r)+
756 : & am*(d2mu_l*rold_l+d3mu_l*rold_r)
757 : rumu_l=rumu_l+canc*coef*(damu_l*termp+am*tmpu_l)
758 : rumv_l=damv_l*(mpl_m*rold_l+mmin_m*rold_r)+
759 : & am*(d2mv_l*rold_l+d3mv_l*rold_r)
760 : rumv_l=rumv_l+canc*coef*(damv_l*termp+am*tmpv_l)
761 : rump_l=damp_l*(mpl_m*rold_l+mmin_m*rold_r)+
762 : & am*(d2mp_l*rold_l+d3mp_l*rold_r)
763 : rump_l=rump_l+canc*coef*(damp_l*termp+am*tmpp_l)
764 : c-------------------------------------------------
765 : rumr_r=damr_r*(mpl_m*rold_l+mmin_m*rold_r)+
766 : & am*(d2mr_r*rold_l+mmin_m+d3mr_r*rold_r)
767 : rumr_r=rumr_r+canc*coef*(damr_r*termp+am*tmpr_r)
768 : rumu_r=damu_r*(mpl_m*rold_l+mmin_m*rold_r)+
769 : & am*(d2mu_r*rold_l+d3mu_r*rold_r)
770 : rumu_r=rumu_r+canc*coef*(damu_r*termp+am*tmpu_r)
771 : rumv_r=damv_r*(mpl_m*rold_l+mmin_m*rold_r)+
772 : & am*(d2mv_r*rold_l+d3mv_r*rold_r)
773 : rumv_r=rumv_r+canc*coef*(damv_r*termp+am*tmpv_r)
774 : rump_r=damp_r*(mpl_m*rold_l+mmin_m*rold_r)+
775 : & am*(d2mp_r*rold_l+d3mp_r*rold_r)
776 : rump_r=rump_r+canc*coef*(damp_r*termp+am*tmpp_r)
777 : c---------------------------------------------------------------------
778 : c computing JACOBIAN as a derivative of the numerical flux function
779 : c with respect to the primitive variables.
780 : c Notation: jl(i,j) --- is the derivative of the i-component of the
781 : c flux function with respect to the j-component of the
782 : c vector of primitive variables of the left state.
783 : c jr(i,j) --- is the derivative of the i-component of the
784 : c flux function with respect to the j-component of the
785 : c vector of primitive variables of the right state.
786 : c---------------------------------------------------------------------
787 : jl(1,1)=rumr_l
788 : jl(1,2)=rumu_l
789 : jl(1,3)=rumv_l
790 : jl(1,4)=rump_l
791 : c------------------------------------
792 : jr(1,1)=rumr_r
793 : jr(1,2)=rumu_r
794 : jr(1,3)=rumv_r
795 : jr(1,4)=rump_r
796 : c------------------------------------
797 : c---------------------------------------------------------
798 : if(rum .ge. 0.0d0) then
799 : br3=rumr_l*un_l
800 : br4=rumr_l*ut_l
801 : else
802 : br3=rumr_l*un_r
803 : br4=rumr_l*ut_r
804 : endif
805 : jl(2,1)=n_x*(br3+dpir_l)+br4*t_x
806 : jl(3,1)=n_y*(br3+dpir_l)+br4*t_y
807 : c-------------------
808 : if(rum .ge. 0.0d0) then
809 : br3=rumu_l*un_l+rum*n_x
810 : br4=rumu_l*ut_l+rum*t_x
811 : else
812 : br3=rumu_l*un_r
813 : br4=rumu_l*ut_r
814 : endif
815 : jl(2,2)=n_x*(br3+dpiu_l)+br4*t_x
816 : jl(3,2)=n_y*(br3+dpiu_l)+br4*t_y
817 : c-------------------
818 : if(rum .ge. 0.0d0) then
819 : br3=rumv_l*un_l+rum*n_y
820 : br4=rumv_l*ut_l+rum*t_y
821 : else
822 : br3=rumv_l*un_r
823 : br4=rumv_l*ut_r
824 : endif
825 : jl(2,3)=n_x*(br3+dpiv_l)+br4*t_x
826 : jl(3,3)=n_y*(br3+dpiv_l)+br4*t_y
827 : c-------------------
828 : if(rum .ge. 0.0d0) then
829 : br3=rump_l*un_l
830 : br4=rump_l*ut_l
831 : else
832 : br3=rump_l*un_r
833 : br4=rump_l*ut_r
834 : endif
835 : jl(2,4)=n_x*(br3+dpip_l)+br4*t_x
836 : jl(3,4)=n_y*(br3+dpip_l)+br4*t_y
837 : c-------------------------------------------------------------
838 : c-------------------------------------------------------------
839 : if(rum .ge. 0.0d0) then
840 : br3=rumr_r*un_l
841 : br4=rumr_r*ut_l
842 : else
843 : br3=rumr_r*un_r
844 : br4=rumr_r*ut_r
845 : endif
846 : jr(2,1)=n_x*(br3+dpir_r)+br4*t_x
847 : jr(3,1)=n_y*(br3+dpir_r)+br4*t_y
848 : c-------------------
849 : if(rum .ge. 0.0d0) then
850 : br3=rumu_r*un_l
851 : br4=rumu_r*ut_l
852 : else
853 : br3=rumu_r*un_r+rum*n_x
854 : br4=rumu_r*ut_r+rum*t_x
855 : endif
856 : jr(2,2)=n_x*(br3+dpiu_r)+br4*t_x
857 : jr(3,2)=n_y*(br3+dpiu_r)+br4*t_y
858 : c-------------------
859 : if(rum .ge. 0.0d0) then
860 : br3=rumv_r*un_l
861 : br4=rumv_r*ut_l
862 : else
863 : br3=rumv_r*un_r+rum*n_y
864 : br4=rumv_r*ut_r+rum*t_y
865 : endif
866 : jr(2,3)=n_x*(br3+dpiv_r)+br4*t_x
867 : jr(3,3)=n_y*(br3+dpiv_r)+br4*t_y
868 : c-------------------
869 : if(rum .ge. 0.0d0) then
870 : br3=rump_r*un_l
871 : br4=rump_r*ut_l
872 : else
873 : br3=rump_r*un_r
874 : br4=rump_r*ut_r
875 : endif
876 : jr(2,4)=n_x*(br3+dpip_r)+br4*t_x
877 : jr(3,4)=n_y*(br3+dpip_r)+br4*t_y
878 : c-------------------------------------------------------------
879 : c ------ f44444444444444444444444444444 ---------
880 : c-------------------------------------------------------------
881 : hr_l=(uold_l*uold_l+vold_l*vold_l)/2.0d0+ga*pold_l/gm1/rold_l
882 : hr_r=(uold_r*uold_r+vold_r*vold_r)/2.0d0+ga*pold_r/gm1/rold_r
883 : c-------------------------------------------------------------
884 : if(rum .ge. 0.0d0) then
885 : br1=rumr_l*hr_l-rum*ga*pold_l/gm1/rold_l/rold_l
886 : else
887 : br1=rumr_l*hr_r
888 : endif
889 : jl(4,1)=br1
890 : c---------------------
891 : if(rum .ge. 0.0d0) then
892 : br1=rumu_l*hr_l+rum*uold_l
893 : else
894 : br1=rumu_l*hr_r
895 : endif
896 : jl(4,2)=br1
897 : c---------------------
898 : if(rum .ge. 0.0d0) then
899 : br1=rumv_l*hr_l+rum*vold_l
900 : else
901 : br1=rumv_l*hr_r
902 : endif
903 : jl(4,3)=br1
904 : c---------------------
905 : if(rum .ge. 0.0d0) then
906 : br1=rump_l*hr_l+rum*ga/gm1/rold_l
907 : else
908 : br1=rump_l*hr_r
909 : endif
910 : jl(4,4)=br1
911 : c----------------------------------------------------------
912 : if(rum .ge. 0.0d0) then
913 : br1=rumr_r*hr_l
914 : else
915 : br1=rumr_r*hr_r-rum*ga*pold_r/gm1/rold_r/rold_r
916 : endif
917 : jr(4,1)=br1
918 : c---------------------
919 : if(rum .ge. 0.0d0) then
920 : br1=rumu_r*hr_l
921 : else
922 : br1=rumu_r*hr_r+rum*uold_r
923 : endif
924 : jr(4,2)=br1
925 : c---------------------
926 : if(rum .ge. 0.0d0) then
927 : br1=rumv_r*hr_l
928 : else
929 : br1=rumv_r*hr_r+rum*vold_r
930 : endif
931 : jr(4,3)=br1
932 : c---------------------
933 : if(rum .ge. 0.0d0) then
934 : br1=rump_r*hr_l
935 : else
936 : br1=rump_r*hr_r+rum*ga/gm1/rold_r
937 : endif
938 : jr(4,4)=br1
939 : c-------------------------------------------------------------
940 : c-------------------------------------------------------------
941 : return
942 : end
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 :
© Cast3M 2003 - All rights reserved.
Disclaimer