No-normal-flow boundary condition for 2D linear Euler equations. Reflects the velocity vector about the boundary normal while preserving pressure, sound speed, background density, and the relaxation rate.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(BoundaryCondition), | intent(in) | :: | bc | |||
| class(Model), | intent(inout) | :: | mymodel |
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, background density, and the
!! relaxation rate.
class(BoundaryCondition),intent(in) :: bc
class(Model),intent(inout) :: mymodel
! Local
integer :: n,i,iEl,j
real(prec) :: nhat(1:2),s(1:6)
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:6)
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
m%solution%extBoundary(i,j,iEl,6) = s(6) ! sigma
enddo
enddo
endselect
endsubroutine hbc2d_NoNormalFlow_LinearEuler2D