riemannflux2d_LinearShallowWater2D_t Function

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

Arguments

TypeIntentOptionalAttributesName
class(LinearShallowWater2D_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,1:2)
real(kind=prec), intent(in) :: nhat(1:2)

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


Contents


Source Code

  pure function riemannflux2d_LinearShallowWater2D_t(this,sL,sR,dsdx,nhat) result(flux)
    class(LinearShallowWater2D_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,1:2)
    real(prec),intent(in) :: nhat(1:2)
    real(prec) :: flux(1:this%solution%nVar)
    ! Local
    real(prec) :: c
    real(prec) :: unL
    real(prec) :: unR

    c = sqrt(this%g*this%H)

    unL = sL(1)*nhat(1)+sL(2)*nhat(2)
    unR = sR(1)*nhat(1)+sR(2)*nhat(2)

    flux(1) = 0.5_prec*(this%g*(sL(3)+sR(3))+c*(unL-unR))*nhat(1)
    flux(2) = 0.5_prec*(this%g*(sL(3)+sR(3))+c*(unL-unR))*nhat(2)
    flux(3) = 0.5_prec*(this%H*(unL+unR)+c*(sL(3)-sR(3)))

  endfunction riemannflux2d_LinearShallowWater2D_t