pbc3d_NoStress_advection_diffusion_3d_t Subroutine

public subroutine pbc3d_NoStress_advection_diffusion_3d_t(bc, mymodel)

No-stress boundary condition for the BR1 diffusive flux. Reflects the interior gradient so that the normal component of the averaged gradient vanishes at the boundary: sigma_ext = sigma_int - 2 (sigma_int . nhat) nhat This gives zero diffusive flux through the wall and is unconditionally stable for Bassi-Rebay.

Arguments

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

Contents


Source Code

  subroutine pbc3d_NoStress_advection_diffusion_3d_t(bc,mymodel)
    !! No-stress boundary condition for the BR1 diffusive flux.
    !! Reflects the interior gradient so that the normal component
    !! of the averaged gradient vanishes at the boundary:
    !!   sigma_ext = sigma_int - 2 (sigma_int . nhat) nhat
    !! This gives zero diffusive flux through the wall and is
    !! unconditionally stable for Bassi-Rebay.
    class(BoundaryCondition),intent(in) :: bc
    class(Model),intent(inout) :: mymodel
    ! Local
    integer :: n,i,j,iEl,s,ivar,idir
    real(prec) :: nhat(1:3),sigma_n

    select type(m => mymodel)
    class is(advection_diffusion_3d_t)
      do n = 1,bc%nBoundaries
        iEl = bc%elements(n)
        s = bc%sides(n)
        do j = 1,m%solution%interp%N+1
          do i = 1,m%solution%interp%N+1
            nhat(1:3) = m%geometry%nHat%boundary(i,j,s,iEl,1,1:3)
            do ivar = 1,m%nvar
              sigma_n = m%solutionGradient%boundary(i,j,s,iEl,ivar,1)*nhat(1)+ &
                        m%solutionGradient%boundary(i,j,s,iEl,ivar,2)*nhat(2)+ &
                        m%solutionGradient%boundary(i,j,s,iEl,ivar,3)*nhat(3)
              do idir = 1,3
                m%solutionGradient%extBoundary(i,j,s,iEl,ivar,idir) = &
                  m%solutionGradient%boundary(i,j,s,iEl,ivar,idir)- &
                  2.0_prec*sigma_n*nhat(idir)
              enddo
            enddo
          enddo
        enddo
      enddo
    endselect

  endsubroutine pbc3d_NoStress_advection_diffusion_3d_t