hbc3d_NoNormalFlow_ECAdvection3D Subroutine

public subroutine hbc3d_NoNormalFlow_ECAdvection3D(bc, mymodel)

Prescribed-zero boundary state for the tracer.

"No-normal-flow" only has physical meaning when the velocity field is a prognostic variable that can be reflected at the wall. For a passive tracer with externally-prescribed velocity the appropriate external state is identically zero everywhere on the boundary, which combined with the LLF (= upwind for linear advection) Riemann flux gives correct inflow (zero injection) and outflow (upwind sL) behaviour.

Arguments

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

Contents


Source Code

  subroutine hbc3d_NoNormalFlow_ECAdvection3D(bc,mymodel)
    !! Prescribed-zero boundary state for the tracer.
    !!
    !! "No-normal-flow" only has physical meaning when the velocity field
    !! is a prognostic variable that can be reflected at the wall. For a
    !! passive tracer with externally-prescribed velocity the appropriate
    !! external state is identically zero everywhere on the boundary,
    !! which combined with the LLF (= upwind for linear advection) Riemann
    !! flux gives correct inflow (zero injection) and outflow (upwind sL)
    !! behaviour.
    class(BoundaryCondition),intent(in) :: bc
    class(Model),intent(inout) :: mymodel
    ! Local
    integer :: n,i,j,iEl,k

    select type(m => mymodel)
    class is(ECAdvection3D_t)
      do n = 1,bc%nBoundaries
        iEl = bc%elements(n)
        k = bc%sides(n)
        do j = 1,m%solution%interp%N+1
          do i = 1,m%solution%interp%N+1
            m%solution%extBoundary(i,j,k,iEl,1:m%nvar) = 0.0_prec
          enddo
        enddo
      enddo
    endselect

  endsubroutine hbc3d_NoNormalFlow_ECAdvection3D