flux2d_advection_diffusion_2d_t Function

public pure function flux2d_advection_diffusion_2d_t(this, s, dsdx) result(flux)

Arguments

TypeIntentOptionalAttributesName
class(advection_diffusion_2d_t), intent(in) :: this
real(kind=prec), intent(in) :: s(1:this%solution%nvar)
real(kind=prec), intent(in) :: dsdx(1:this%solution%nvar,1:2)

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


Contents


Source Code

  pure function flux2d_advection_diffusion_2d_t(this,s,dsdx) result(flux)
    class(advection_diffusion_2d_t),intent(in) :: this
    real(prec),intent(in) :: s(1:this%solution%nvar)
    real(prec),intent(in) :: dsdx(1:this%solution%nvar,1:2)
    real(prec) :: flux(1:this%solution%nvar,1:2)
    ! Local
    integer :: ivar

    do ivar = 1,this%solution%nvar
      flux(ivar,1) = this%u*s(ivar)-this%nu*dsdx(ivar,1) ! advective flux + diffusive flux
      flux(ivar,2) = this%v*s(ivar)-this%nu*dsdx(ivar,2) ! advective flux + diffusive flux
    enddo

  endfunction flux2d_advection_diffusion_2d_t