hbc2d_NoNormalFlow_LinearEuler2D Subroutine

public subroutine hbc2d_NoNormalFlow_LinearEuler2D(bc, mymodel)

No-normal-flow boundary condition for 2D linear Euler equations. Reflects the velocity vector about the boundary normal while preserving pressure, sound speed, and background density.

Arguments

TypeIntentOptionalAttributesName
class(BoundaryCondition), intent(in) :: bc
class(Model), intent(inout) :: mymodel

Contents


Source Code

  subroutine hbc2d_NoNormalFlow_LinearEuler2D(bc,mymodel)
    !! No-normal-flow boundary condition for 2D linear Euler equations.
    !! Reflects the velocity vector about the boundary normal while
    !! preserving pressure, sound speed, and background density.
    class(BoundaryCondition),intent(in) :: bc
    class(Model),intent(inout) :: mymodel
    ! Local
    integer :: n,i,iEl,j
    real(prec) :: nhat(1:2),s(1:5)

    select type(m => mymodel)
    class is(LinearEuler2D_t)
      do n = 1,bc%nBoundaries
        iEl = bc%elements(n)
        j = bc%sides(n)
        do i = 1,m%solution%interp%N+1
          nhat = m%geometry%nhat%boundary(i,j,iEl,1,1:2)
          s = m%solution%boundary(i,j,iEl,1:5)
          m%solution%extBoundary(i,j,iEl,1) = &
            (nhat(2)**2-nhat(1)**2)*s(1)-2.0_prec*nhat(1)*nhat(2)*s(2) ! u
          m%solution%extBoundary(i,j,iEl,2) = &
            (nhat(1)**2-nhat(2)**2)*s(2)-2.0_prec*nhat(1)*nhat(2)*s(1) ! v
          m%solution%extBoundary(i,j,iEl,3) = s(3) ! p
          m%solution%extBoundary(i,j,iEl,4) = s(4) ! c
          m%solution%extBoundary(i,j,iEl,5) = s(5) ! rho0
        enddo
      enddo
    endselect

  endsubroutine hbc2d_NoNormalFlow_LinearEuler2D