No-normal-flow boundary condition for 2D linear Euler equations. Reflects the velocity vector about the boundary normal while preserving density and pressure.
| 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 density and pressure.
class(BoundaryCondition),intent(in) :: bc
class(Model),intent(inout) :: mymodel
! Local
integer :: n,i,iEl,j
real(prec) :: nhat(1:2),s(1:4)
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:4)
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
enddo
enddo
endselect
endsubroutine hbc2d_NoNormalFlow_LinearEuler2D