setgradientboundarycondition_DGModel2D_t Subroutine

public subroutine setgradientboundarycondition_DGModel2D_t(this)

Boundary conditions for the solution are set to 0 for the external state to provide radiation type boundary conditions.

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D_t), intent(inout) :: this

Contents


Source Code

  subroutine setgradientboundarycondition_DGModel2D_t(this)
    !! Boundary conditions for the solution are set to
    !! 0 for the external state to provide radiation type
    !! boundary conditions.
    implicit none
    class(DGModel2D_t),intent(inout) :: this
    ! local
    integer :: i,iEl,j,e2,bcid
    real(prec) :: dsdx(1:this%nvar,1:2)
    real(prec) :: nhat(1:2),x(1:2)

    do concurrent(j=1:4,iel=1:this%mesh%nElem)

      bcid = this%mesh%sideInfo(5,j,iEl) ! Boundary Condition ID
      e2 = this%mesh%sideInfo(3,j,iEl) ! Neighboring Element ID

      if(e2 == 0) then
        if(bcid == SELF_BC_PRESCRIBED) then

          do i = 1,this%solutiongradient%interp%N+1 ! Loop over quadrature points
            x = this%geometry%x%boundary(i,j,iEl,1,1:2)

            this%solutiongradient%extBoundary(i,j,iEl,1:this%nvar,1:2) = &
              this%pbc2d_Prescribed(x,this%t)
          enddo

        elseif(bcid == SELF_BC_RADIATION) then

          do i = 1,this%solutiongradient%interp%N+1 ! Loop over quadrature points
            nhat = this%geometry%nhat%boundary(i,j,iEl,1,1:2)

            dsdx = this%solutiongradient%boundary(i,j,iEl,1:this%nvar,1:2)

            this%solutiongradient%extBoundary(i,j,iEl,1:this%nvar,1:2) = &
              this%pbc2d_Radiation(dsdx,nhat)
          enddo

        elseif(bcid == SELF_BC_NONORMALFLOW) then

          do i = 1,this%solutiongradient%interp%N+1 ! Loop over quadrature points
            nhat = this%geometry%nhat%boundary(i,j,iEl,1,1:2)

            dsdx = this%solutiongradient%boundary(i,j,iEl,1:this%nvar,1:2)

            this%solutiongradient%extBoundary(i,j,iEl,1:this%nvar,1:2) = &
              this%pbc2d_NoNormalFlow(dsdx,nhat)
          enddo

        endif
      endif

    enddo

  endsubroutine setgradientboundarycondition_DGModel2D_t