hbc2d_NoNormalFlow_LinearEuler2D_PML Subroutine

public subroutine hbc2d_NoNormalFlow_LinearEuler2D_PML(bc, mymodel)

No-normal-flow BC for the PML-augmented linear Euler model. Variables 1-5 are treated identically to the parent LinearEuler2D no-normal-flow BC. Auxiliary variables 6-9 are given a zero exterior state; since they carry zero Riemann flux the exterior value is mathematically irrelevant, but zeroing it keeps the boundary state clean for diagnostics.

Arguments

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

Contents


Source Code

  subroutine hbc2d_NoNormalFlow_LinearEuler2D_PML(bc,mymodel)
    !! No-normal-flow BC for the PML-augmented linear Euler model.
    !! Variables 1-5 are treated identically to the parent
    !! LinearEuler2D no-normal-flow BC. Auxiliary variables 6-9 are
    !! given a zero exterior state; since they carry zero Riemann flux
    !! the exterior value is mathematically irrelevant, but zeroing it
    !! keeps the boundary state clean for diagnostics.
    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_PML_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) = s(1) ! density
          m%solution%extBoundary(i,j,iEl,2) = &
            (nhat(2)**2-nhat(1)**2)*s(2)-2.0_prec*nhat(1)*nhat(2)*s(3) ! u
          m%solution%extBoundary(i,j,iEl,3) = &
            (nhat(1)**2-nhat(2)**2)*s(3)-2.0_prec*nhat(1)*nhat(2)*s(2) ! v
          m%solution%extBoundary(i,j,iEl,4) = s(4) ! p
          m%solution%extBoundary(i,j,iEl,5) = s(5) ! c
          m%solution%extBoundary(i,j,iEl,6:9) = 0.0_prec ! PML auxiliaries
        enddo
      enddo
    endselect

  endsubroutine hbc2d_NoNormalFlow_LinearEuler2D_PML