ausmf
C AUSMF SOURCE CB215821 16/04/21 21:15:10 8920 c---------------------------------------------------------------------- c GENERAL DESCRIPTION: c This subroutine provides the jacobian which is the derivatives c of the numerical flux function of the AUSM+ scheme c defined at the cell interface c with respect to the primitive variables of the left c cell (relative to the cell interface). c c EQUATIONS: 2D Euler equations of gas dynamics c c c REFERENCE: JCP, 129, 364-382 (1996) c " A Sequel to AUSM: AUSM+ ". c---------------------------------------------------------------------- c INPUT: c c c (rog,uxg,uyg,pg) -- vector of the primitive variables at the c left cell; c c (rod,uxd,uyd,pd) -- vector of the primitive variables at the c right cell; c c (cnx,cny) -- normal vector to the interface (2 components in 2D); c c (ctx,cty) -- tangential vector to the interface; c c ga -- ratio of the specific heats (assumed constant) c---------------------------------------------------------------------- c c OUTPUT: c c dfro -- vector of length 4 which represents derivatives of c flux-function for conservative variable (rho) c with respect to the primitive variables c c dfrun -- vector of length 4 which represents derivatives of c flux-function for conservative variable (rho u_n) c with respect to the primitive variables c c dfrut -- vector of length 4 which represents derivatives of c flux-function for conservative variable (rho u_t) c with respect to the primitive variables c c dfret -- vector of length 4 which represents derivatives of c flux-function for conservative variable (rho e_t) c with respect to the primitive variables c---------------------------------------------------------------------- & ga,cnx,cny,ctx,cty, & dfro,dfrun,dfrut,dfret) IMPLICIT INTEGER(I-N) real*8 rog,uxg,uyg,pg real*8 rod,uxd,uyd,pd real*8 cnx,cny,ctx,cty real*8 jl(4,4),f(4) real*8 dfro(4),dfrun(4) real*8 dfrut(4),dfret(4) real*8 ga, gm1,temph real*8 n_x,n_y,t_x,t_y real*8 un_l, un_r, ut_l, ut_r real*8 ml,mr,Mplus,Mmin,mmid real*8 mpl_m, mmin_m,am real*8 rold_l,uold_l,vold_l,pold_l,eold_l real*8 rold_r,uold_r,vold_r,pold_r,eold_r real*8 Pplus,Pmin,pmid real*8 hr_l,hr_r real*8 br1,br2,br3,br4,temp_l,temp_r,brac_l,brac_r real*8 aleft, arigh real*8 damr_l,damu_l real*8 damv_l,damp_l real*8 dmlr_l,dmlu_l real*8 dmlv_l,dmlp_l real*8 dmrr_l,dmru_l real*8 dmrv_l,dmrp_l real*8 dMpr_l,dMpu_l real*8 dMpv_l,dMpp_l real*8 dMmr_l,dMmu_l real*8 dMmv_l,dMmp_l real*8 dmir_l,dmiu_l real*8 dmiv_l,dmip_l real*8 d3mr_l,d3mu_l real*8 d3mv_l,d3mp_l real*8 d2mr_l,d2mu_l real*8 d2mv_l,d2mp_l real*8 dPpr_l,dPpu_l real*8 dPpv_l,dPpp_l real*8 dPmr_l,dPmu_l real*8 dPmv_l,dPmp_l real*8 dpir_l,dpiu_l real*8 dpiv_l,dpip_l integer i c c alpha -- parameter of the AUSM+ scheme in the Pressure function; c ( -3/4 <= alpha <= 3/16 ) (imposed as a parameter) c c beta -- parameter of the AUSM+ scheme in the Mach function; c ( -1/16 <= beta <= 1/2 ) (imposed as a parameter) c c----------------------- gm1=ga-1.0d0 c----------------------- n_x=cnx n_y=cny t_x=ctx t_y=cty c---------------------------- c---------------------------- rold_l=rog uold_l=uxg vold_l=uyg pold_l=pg c----------------------- rold_r=rod uold_r=uxd vold_r=uyd pold_r=pd c------------------------------------------------------------------ c Computation of the specific total energy on the left and right. c------------------------------------------------------------------ eold_l=(uold_l*uold_l+vold_l*vold_l)/2.0d0 eold_l=eold_l+pold_l/(gm1*rold_l) eold_r=(uold_r*uold_r+vold_r*vold_r)/2.0d0 eold_r=eold_r+pold_r/(gm1*rold_r) c------------------------------------------------------------------- c Computation of the speed of sound and its derivatives; c numerical speed of sound at the interface is taken as an average c of the speeds of sounds of the neighbouring cells c------------------------------------------------------------------- aleft=SQRT(ga*pold_l/rold_l) arigh=SQRT(ga*pold_r/rold_r) am=0.5d0*(aleft+arigh) c------------------------------------------------------------------- damr_l=-aleft/(4.0d0*rold_l) damu_l=0.0d0 damv_l=0.0d0 damp_l=ga/(4.0d0*aleft*rold_l) c------------------------------------------------------------------- c Computing numerical Mach number and its derivatives, c see p.370, under (A1). c------------------------------------------------------------------- un_l=uold_l*n_x+vold_l*n_y un_r=uold_r*n_x+vold_r*n_y ut_l=uold_l*t_x+vold_l*t_y ut_r=uold_r*t_x+vold_r*t_y c------------------------------------------------------------------- ml=un_l/am mr=un_r/am c------------------------------------------------------------------- c Mplus and Mmin are calligraphic lettes M+ and M- from the paper, c see (19a) and (19b), p.367. c------------------------------------------------------------------- if(ABS(ml) .ge. 1.0d0) then Mplus=(ml+ABS(ml))/2.0d0 else Mplus=(ml+1.0d0)*(ml+1.0d0)/4.0d0 Mplus=Mplus+beta*(ml*ml-1.0d0)*(ml*ml-1.0d0) endif c------------------------------------------------------------------- if(ABS(mr) .ge. 1.0d0) then Mmin=(mr-ABS(mr))/2.0d0 else Mmin=-(mr-1.0d0)*(mr-1.0d0)/4.0d0 Mmin=Mmin-beta*(mr*mr-1.0d0)*(mr*mr-1.0d0) endif c------------------------------------------------------------------- c Derivatives of ml and mr with respect to both sets of primitive c variables: left and right. c------------------------------------------------------------------- temp_l=-un_l/(am*am) temp_r=-un_r/(am*am) c-------- dmlr_l=temp_l*damr_l dmrr_l=temp_r*damr_l c-------- dmlu_l=n_x/am+temp_l*damu_l dmru_l=temp_r*damu_l c-------- dmlv_l=n_y/am+temp_l*damv_l dmrv_l=temp_r*damv_l c-------- dmlp_l=temp_l*damp_l dmrp_l=temp_r*damp_l c----------------------------------------------------------- c mmid is m_{1/2} (notation as in the paper, see (13),p.366) c----------------------------------------------------------- mmid=Mplus+Mmin c----------------------------------------------------------- c Computing the derivatives of M+ and M- c----------------------------------------------------------- if(ml .ge. 1.0d0) then dMpr_l=dmlr_l dMpu_l=dmlu_l dMpv_l=dmlv_l dMpp_l=dmlp_l c-------------------- else if((ml .gt. -1.0d0) .and. (ml .lt. 1.0d0)) then temph=(ml+1.0d0)/2.0d0 dMpr_l=(temph+4.0d0*beta*ml*(ml*ml-1.0d0))*dmlr_l dMpu_l=(temph+4.0d0*beta*ml*(ml*ml-1.0d0))*dmlu_l dMpv_l=(temph+4.0d0*beta*ml*(ml*ml-1.0d0))*dmlv_l dMpp_l=(temph+4.0d0*beta*ml*(ml*ml-1.0d0))*dmlp_l c-------------------- else dMpr_l=0.0d0 dMpu_l=0.0d0 dMpv_l=0.0d0 dMpp_l=0.0d0 c--------------------- endif endif c----------------------------------------------------------- if(mr .ge. 1.0d0) then dMmr_l=0.0d0 dMmu_l=0.0d0 dMmv_l=0.0d0 dMmp_l=0.0d0 c--------------------- else if((mr .gt. -1.0d0) .and. (mr .lt. 1.0d0)) then temph=(-mr+1.0d0)/2.0d0 dMmr_l=(temph-4.0d0*beta*mr*(mr*mr-1.0d0))*dmrr_l dMmu_l=(temph-4.0d0*beta*mr*(mr*mr-1.0d0))*dmru_l dMmv_l=(temph-4.0d0*beta*mr*(mr*mr-1.0d0))*dmrv_l dMmp_l=(temph-4.0d0*beta*mr*(mr*mr-1.0d0))*dmrp_l c-------------------- else dMmr_l=dmrr_l dMmu_l=dmru_l dMmv_l=dmrv_l dMmp_l=dmrp_l c-------------------- endif endif c----------------------------------------------------------------- c computing the derivatives of m_{1/2} (notation as in the paper) c----------------------------------------------------------------- dmir_l=dMpr_l+dMmr_l c------------- dmiu_l=dMpu_l+dMmu_l c------------- dmiv_l=dMpv_l+dMmv_l c------------- dmip_l=dMpp_l+dMmp_l c---------------------------------------------------------------- c computing the main convective variables and their derivatives c mpl_m is m^{+}_{1/2} (paper's notation) and c mmin_m is m^{-}_{1/2} (paper's notation), see (A2) on p.370. c---------------------------------------------------------------- if(mmid .ge. 0.0d0) then mpl_m = mmid d2mr_l=dmir_l d2mu_l=dmiu_l d2mv_l=dmiv_l d2mp_l=dmip_l c------------ else mpl_m = 0.0d0 d2mr_l=0.0d0 d2mu_l=0.0d0 d2mv_l=0.0d0 d2mp_l=0.0d0 c------------ endif c--------------------------------------------- if(mmid .le. 0.0d0) then mmin_m = mmid d3mr_l=dmir_l d3mu_l=dmiu_l d3mv_l=dmiv_l d3mp_l=dmip_l c------------ else mmin_m = 0.0d0 d3mr_l=0.0d0 d3mu_l=0.0d0 d3mv_l=0.0d0 d3mp_l=0.0d0 c------------ endif c--------------------------------------------------------------- c Computing the calligraphic P+ and P- with their derivatives, c see (21a) & (21b) on p.368. c--------------------------------------------------------------- if(ml .ge. 1.0d0) then Pplus = 1.0d0 else if((ml .gt. -1.0d0) .and. (ml .lt. 1.0d0)) then Pplus=(ml+1.0d0)*(ml+1.0d0)*(2.0d0-ml)/4.0d0 else Pplus = 0.0d0 endif endif c--------------------------------------------------------------- if(mr .ge. 1.0d0) then Pmin = 0.0d0 else if((mr .gt. -1.0d0) .and. (mr .lt. 1.0d0)) then Pmin=(mr-1.0d0)*(mr-1.0d0)*(2.0d0+mr)/4.0d0 else Pmin = 1.0d0 endif endif c--------------------------------------------------------------- brac_l=(ml+1.0d0)*(2.0d0-ml)/2.0d0-(ml+1.0d0)*(ml+1.0d0)/4.0d0 c-------------- brac_r=(mr-1.0d0)*(2.0d0+mr)/2.0d0+(mr-1.0d0)*(mr-1.0d0)/4.0d0 c--------------------------------------------------------------- if((ml .gt. -1.0d0) .and. (ml .lt. 1.0d0)) then dPpr_l=brac_l*dmlr_l dPpu_l=brac_l*dmlu_l dPpv_l=brac_l*dmlv_l dPpp_l=brac_l*dmlp_l else dPpr_l=0.0d0 dPpu_l=0.0d0 dPpv_l=0.0d0 dPpp_l=0.0d0 endif c--------------------------------------------------------------- if((mr .gt. -1.0d0) .and. (mr .lt. 1.0d0)) then dPmr_l=brac_r*dmrr_l dPmu_l=brac_r*dmru_l dPmv_l=brac_r*dmrv_l dPmp_l=brac_r*dmrp_l else dPmr_l=0.0d0 dPmu_l=0.0d0 dPmv_l=0.0d0 dPmp_l=0.0d0 endif c------------------------------------------------------------------- c computing pmid -- p_{1/2} and its derivatives, see (20b), p.367. c------------------------------------------------------------------- pmid=Pplus*pold_l + Pmin*pold_r dpir_l=dPpr_l*pold_l+dPmr_l*pold_r dpiu_l=dPpu_l*pold_l+dPmu_l*pold_r dpiv_l=dPpv_l*pold_l+dPmv_l*pold_r dpip_l=dPpp_l*pold_l+Pplus+dPmp_l*pold_r c--------------------------------------------------------------------- c computing JACOBIAN as a derivative of the numerical flux function c with respect to the primitive variables. c Notation: jl(i,j) --- is the derivative of the i-component of the c flux function with respect to the j-component of the c vector of primitive variables of the left state. c jr(i,j) --- is the derivative of the i-component of the c flux function with respect to the j-component of the c vector of primitive variables of the right state. c--------------------------------------------------------------------- f(1)=am*(mpl_m*rold_l+mmin_m*rold_r) c--------------------------------------------------------------------- jl(1,1)=damr_l*f(1)/am+am*(d2mr_l*rold_l+mpl_m) jl(1,1)=jl(1,1)+am*d3mr_l*rold_r jl(1,2)=damu_l*f(1)/am+am*(d2mu_l*rold_l+d3mu_l*rold_r) jl(1,3)=damv_l*f(1)/am+am*(d2mv_l*rold_l+d3mv_l*rold_r) jl(1,4)=damp_l*f(1)/am+am*(d2mp_l*rold_l+d3mp_l*rold_r) c------------------------------------ c------------------------------------ br1=mpl_m*rold_l*un_l+mmin_m*rold_r*un_r br2=mpl_m*rold_l*ut_l+mmin_m*rold_r*ut_r f(2)=n_x*(am*br1+pmid)+am*t_x*br2 c--------------------------------------------------------- br3=d2mr_l*rold_l*un_l+mpl_m*un_l+d3mr_l*rold_r*un_r br4=d2mr_l*rold_l*ut_l+mpl_m*ut_l+d3mr_l*rold_r*ut_r jl(2,1)=n_x*(damr_l*br1+am*br3+dpir_l) jl(2,1)=jl(2,1)+t_x*damr_l*br2+am*t_x*br4 c------------------- br3=d2mu_l*rold_l*un_l+mpl_m*rold_l*n_x br3=br3+d3mu_l*rold_r*un_r br4=d2mu_l*rold_l*ut_l+mpl_m*rold_l*t_x br4=br4+d3mu_l*rold_r*ut_r jl(2,2)=n_x*(damu_l*br1+am*br3+dpiu_l) jl(2,2)=jl(2,2)+t_x*damu_l*br2+am*t_x*br4 c------------------- br3=d2mv_l*rold_l*un_l+mpl_m*rold_l*n_y br3=br3+d3mv_l*rold_r*un_r br4=d2mv_l*rold_l*ut_l+mpl_m*rold_l*t_y br4=br4+d3mv_l*rold_r*ut_r jl(2,3)=n_x*(damv_l*br1+am*br3+dpiv_l) jl(2,3)=jl(2,3)+t_x*damv_l*br2+am*t_x*br4 c------------------- br3=d2mp_l*rold_l*un_l+d3mp_l*rold_r*un_r br4=d2mp_l*rold_l*ut_l+d3mp_l*rold_r*ut_r jl(2,4)=n_x*(damp_l*br1+am*br3+dpip_l) jl(2,4)=jl(2,4)+t_x*damp_l*br2+am*t_x*br4 c------------------------------------------------------------- c------------------------------------------------------------- br1=mpl_m*rold_l*un_l+mmin_m*rold_r*un_r br2=mpl_m*rold_l*ut_l+mmin_m*rold_r*ut_r f(3)=n_y*(am*br1+pmid)+am*t_y*br2 br3=d2mr_l*rold_l*un_l+mpl_m*un_l+d3mr_l*rold_r*un_r br4=d2mr_l*rold_l*ut_l+mpl_m*ut_l+d3mr_l*rold_r*ut_r jl(3,1)=n_y*(damr_l*br1+am*br3+dpir_l) jl(3,1)=jl(3,1)+t_y*damr_l*br2+am*t_y*br4 c------------------- br3=d2mu_l*rold_l*un_l+mpl_m*rold_l*n_x br3=br3+d3mu_l*rold_r*un_r br4=d2mu_l*rold_l*ut_l+mpl_m*rold_l*t_x br4=br4+d3mu_l*rold_r*ut_r jl(3,2)=n_y*(damu_l*br1+am*br3+dpiu_l) jl(3,2)=jl(3,2)+t_y*damu_l*br2+am*t_y*br4 c------------------- br3=d2mv_l*rold_l*un_l+mpl_m*rold_l*n_y br3=br3+d3mv_l*rold_r*un_r br4=d2mv_l*rold_l*ut_l+mpl_m*rold_l*t_y br4=br4+d3mv_l*rold_r*ut_r jl(3,3)=n_y*(damv_l*br1+am*br3+dpiv_l) jl(3,3)=jl(3,3)+t_y*damv_l*br2+am*t_y*br4 c------------------- br3=d2mp_l*rold_l*un_l+d3mp_l*rold_r*un_r br4=d2mp_l*rold_l*ut_l+d3mp_l*rold_r*ut_r jl(3,4)=n_y*(damp_l*br1+am*br3+dpip_l) jl(3,4)=jl(3,4)+t_y*damp_l*br2+am*t_y*br4 c------------------------------------------------------------- c ------ f44444444444444444444444444444 --------- c------------------------------------------------------------- hr_l=rold_l*(uold_l*uold_l+vold_l*vold_l)/2.0d0+ga*pold_l/gm1 hr_r=rold_r*(uold_r*uold_r+vold_r*vold_r)/2.0d0+ga*pold_r/gm1 f(4)=am*(mpl_m*hr_l+mmin_m*hr_r) c--------------------- br1=d2mr_l*hr_l+mpl_m*(uold_l*uold_l+vold_l*vold_l)/2.0d0 br1=br1+d3mr_l*hr_r jl(4,1)=damr_l*f(4)/am+am*br1 c--------------------- br1=d2mu_l*hr_l+mpl_m*uold_l*rold_l br1=br1+d3mu_l*hr_r jl(4,2)=damu_l*f(4)/am+am*br1 c--------------------- br1=d2mv_l*hr_l+mpl_m*vold_l*rold_l br1=br1+d3mv_l*hr_r jl(4,3)=damv_l*f(4)/am+am*br1 c--------------------- br1=d2mp_l*hr_l+mpl_m*ga/gm1 br1=br1+d3mp_l*hr_r jl(4,4)=damp_l*f(4)/am+am*br1 c---------------------------------------------------------- c---------------------------------------------------------- do 1 i=1,4 dfro(i)=jl(1,i) dfrun(i)=jl(2,i)*n_x+jl(3,i)*n_y dfrut(i)=jl(2,i)*t_x+jl(3,i)*t_y dfret(i)=jl(4,i) 1 continue c---------------------------------------------------------------------- return end
© Cast3M 2003 - Tous droits réservés.
Mentions légales