riemannflux2d_ECAdvection2D_t Function

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

Local Lax-Friedrichs (Rusanov) Riemann flux for linear advection. Entropy-stable: provides symmetric dissipation at element interfaces. Uses the per-face spectral radius lambda = |u.n|, matching upwind (Godunov) for linear advection: tangential faces (u.n=0) contribute zero flux, avoiding spurious dissipation across element interfaces whose face normal is perpendicular to the velocity.

Arguments

TypeIntentOptionalAttributesName
class(ECAdvection2D_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_ECAdvection2D_t(this,sL,sR,dsdx,nhat) result(flux)
    !! Local Lax-Friedrichs (Rusanov) Riemann flux for linear advection.
    !! Entropy-stable: provides symmetric dissipation at element interfaces.
    !! Uses the per-face spectral radius lambda = |u.n|, matching upwind
    !! (Godunov) for linear advection: tangential faces (u.n=0) contribute
    !! zero flux, avoiding spurious dissipation across element interfaces
    !! whose face normal is perpendicular to the velocity.
    class(ECAdvection2D_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) :: un,lam

    un = this%u*nhat(1)+this%v*nhat(2)
    lam = abs(un)
    flux(1) = 0.5_prec*(un*(sL(1)+sR(1))-lam*(sR(1)-sL(1)))
    if(.false.) flux(1) = flux(1)+dsdx(1,1) ! suppress unused-dummy-argument warning

  endfunction riemannflux2d_ECAdvection2D_t