riemannflux2d_LinearEuler2D_PML_t Function

public pure function riemannflux2d_LinearEuler2D_PML_t(this, sL, sR, dsdx, nhat) result(flux)

Impedance-matched Riemann flux for acoustic variables 1-5, with zero flux returned for the auxiliary variables 6-9. The acoustic formula is identical to the parent LinearEuler2D model; see riemannflux2d_LinearEuler2D_t for the derivation.

Arguments

TypeIntentOptionalAttributesName
class(LinearEuler2D_PML_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)

Return Value real(kind=prec)(1:this%nvar)


Contents


Source Code

  pure function riemannflux2d_LinearEuler2D_PML_t(this,sL,sR,dsdx,nhat) result(flux)
    !! Impedance-matched Riemann flux for acoustic variables 1-5, with
    !! zero flux returned for the auxiliary variables 6-9. The acoustic
    !! formula is identical to the parent LinearEuler2D model; see
    !! riemannflux2d_LinearEuler2D_t for the derivation.
    class(LinearEuler2D_PML_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) :: rho0,cL,cR,ZL,ZR,unL,unR,pL,pR,un_star,p_star,c2_avg

    rho0 = this%rho0
    cL = sL(5)
    cR = sR(5)
    ZL = rho0*cL
    ZR = rho0*cR

    unL = sL(2)*nhat(1)+sL(3)*nhat(2)
    unR = sR(2)*nhat(1)+sR(3)*nhat(2)
    pL = sL(4)
    pR = sR(4)

    un_star = (ZL*unL+ZR*unR+(pL-pR))/(ZL+ZR)
    p_star = (ZR*pL+ZL*pR+ZL*ZR*(unL-unR))/(ZL+ZR)
    c2_avg = 0.5_prec*(cL*cL+cR*cR)

    flux(1) = rho0*un_star
    flux(2) = p_star*nhat(1)/rho0
    flux(3) = p_star*nhat(2)/rho0
    flux(4) = rho0*c2_avg*un_star
    flux(5) = 0.0_prec
    flux(6:9) = 0.0_prec
    if(.false.) flux(1) = flux(1)+dsdx(1,1) ! suppress unused-dummy-argument warning

  endfunction riemannflux2d_LinearEuler2D_PML_t