setgradientboundarycondition_DGModel3D_t Subroutine

public subroutine setgradientboundarycondition_DGModel3D_t(this)

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

Arguments

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

Contents


Source Code

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

    do iEl = 1,this%solution%nElem ! Loop over all elements
      do k = 1,6 ! Loop over all sides

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

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

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

                this%solutiongradient%extBoundary(i,j,k,iEl,1:this%nvar,1:3) = &
                  this%pbc3d_Prescribed(x,this%t)
              enddo
            enddo

          elseif(bcid == SELF_BC_RADIATION) then

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

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

                this%solutiongradient%extBoundary(i,j,k,iEl,1:this%nvar,1:3) = &
                  this%pbc3d_Radiation(dsdx,nhat)
              enddo
            enddo

          elseif(bcid == SELF_BC_NONORMALFLOW) then

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

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

                this%solutiongradient%extBoundary(i,j,k,iEl,1:this%nvar,1:3) = &
                  this%pbc3d_NoNormalFlow(dsdx,nhat)
              enddo
            enddo

          endif
        endif

      enddo
    enddo

  endsubroutine setgradientboundarycondition_DGModel3D_t