Uses a local lax-friedrich's upwind flux The max eigenvalue is taken as the sound speed
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(LinearEuler2D_t), | intent(in) | :: | this | |||
real(kind=prec), | intent(in) | :: | sL(1:this%nvar) | |||
real(kind=prec), | intent(in) | :: | sR(1:this%nvar) | |||
real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar,1:2) | |||
real(kind=prec), | intent(in) | :: | nhat(1:2) |
pure function riemannflux2d_LinearEuler2D_t(this,sL,sR,dsdx,nhat) result(flux)
!! Uses a local lax-friedrich's upwind flux
!! The max eigenvalue is taken as the sound speed
class(LinearEuler2D_t),intent(in) :: this
real(prec),intent(in) :: sL(1:this%nvar)
real(prec),intent(in) :: sR(1:this%nvar)
real(prec),intent(in) :: dsdx(1:this%nvar,1:2)
real(prec),intent(in) :: nhat(1:2)
real(prec) :: flux(1:this%nvar)
! Local
real(prec) :: fL(1:this%nvar)
real(prec) :: fR(1:this%nvar)
real(prec) :: u,v,p,c,rho0
u = sL(2)
v = sL(3)
p = sL(4)
rho0 = this%rho0
c = this%c
fL(1) = rho0*(u*nhat(1)+v*nhat(2)) ! density
fL(2) = p*nhat(1)/rho0 ! u
fL(3) = p*nhat(2)/rho0 ! v
fL(4) = rho0*c*c*(u*nhat(1)+v*nhat(2)) ! pressure
u = sR(2)
v = sR(3)
p = sR(4)
fR(1) = rho0*(u*nhat(1)+v*nhat(2)) ! density
fR(2) = p*nhat(1)/rho0 ! u
fR(3) = p*nhat(2)/rho0 ! v
fR(4) = rho0*c*c*(u*nhat(1)+v*nhat(2)) ! pressure
flux(1:4) = 0.5_prec*(fL(1:4)+fR(1:4))+c*(sL(1:4)-sR(1:4))
endfunction riemannflux2d_LinearEuler2D_t