riemannflux1d_advection_diffusion_1d_t Function

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

Arguments

TypeIntentOptionalAttributesName
class(advection_diffusion_1d_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_advection_diffusion_1d_t(this,sL,sR,dsdx,nhat) result(flux)
    class(advection_diffusion_1d_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
    integer :: ivar

    do ivar = 1,this%solution%nvar
      flux(ivar) = 0.5_prec*(this%u*nhat*(sL(ivar)+sR(ivar))+ &
                             abs(this%u*nhat)*(sL(ivar)-sR(ivar)))- & ! advective flux
                   this%nu*dsdx(ivar)*nhat ! diffusive flux
    enddo

  endfunction riemannflux1d_advection_diffusion_1d_t