c-----------------------------------------------------------------------
subroutine userbc(ix,iy,iz,iside,eg) ! set up boundary conditions
c
c NOTE ::: This subroutine MAY NOT be called by every process
c
c implicit none
integer ix,iy,iz,iside,eg, id_face
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'
c if (cbc(iside,gllel(eg),ifield).eq.'v01')
do iel = 1,nelv
do ifc = 1,2*ndim
id_face = bc(5,ifc,iel,1)
if (id_face .eq. 1) then ! inlet
cbc(ifc,iel,1)= 'v'
cbc(ifc,iel,2)= 't'
elseif(id_face .eq. 2) then ! outlet
cbc(ifc,iel,1)= 'O'
cbc(ifc,iel,2)= 'I'
elseif(id_face .eq. 3) then ! wall
cbc(ifc,iel,1)= 'W'
cbc(ifc,iel,2)= 'I'
endif
enddo
enddo
!inlet
if(ifield .eq. 1) then
ux = 10.0 ! inlet velocity
uy = 0.0
uz = 0.0
elseif(ifield .eq. 2) then
temp = 50.0 ! inlet temperature
endif
return
end
But when I looked at the simulation result, it seems that the inlet condition is not correctly imposed. Can anyone spot some mistakes from the subroutine userbc? Thanks!