riemannflux1d_Burgers1D_t Function

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

Arguments

TypeIntentOptionalAttributesName
class(Burgers1D_t), intent(in) :: this
real(kind=prec), intent(in) :: sL(1:this%solution%nvar)
real(kind=prec), intent(in) :: sR(1:this%solution%nvar)
real(kind=prec), intent(in) :: dsdx(1:this%solution%nvar)
real(kind=prec), intent(in) :: nhat

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


Contents


Source Code

  pure function riemannflux1d_Burgers1D_t(this,sL,sR,dsdx,nhat) result(flux)
    class(Burgers1D_t),intent(in) :: this
    real(prec),intent(in) :: sL(1:this%solution%nvar)
    real(prec),intent(in) :: sR(1:this%solution%nvar)
    real(prec),intent(in) :: dsdx(1:this%solution%nvar)
    real(prec),intent(in) :: nhat
    real(prec) :: flux(1:this%solution%nvar)
    ! Local
    real(prec) :: fL,fR,cmax

    ! Local Lax-Friedrich's flux
    fL = 0.5_prec*sL(1)*sL(1)*nhat
    fR = 0.5_prec*sR(1)*sR(1)*nhat
    cmax = max(abs(sL(1)*nhat),abs(sR(1)*nhat)) ! maximum wave speed

    flux(1) = 0.5_prec*(fL+fR)+cmax*(sL(1)-sR(1)) & ! advective flux
              -this%nu*dsdx(1)*nhat

  endfunction riemannflux1d_Burgers1D_t