I am still making progress in the development of the BC. However, I figurd out that the flow given by the UDF makes no physical sense. The code (cs_user_BC.f90) is as follows :
Code: Select all
s_tot = 0.d0
sumpre = 0.d0
call getfbr('outlet', nlelt, lstelt)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
volden = bmasfl(ifac) / bpro_rho(ifac) * surfbn(ifac) ! flow = massflux/density*S
sumpre = sumpre+volden
s_tot = s_tot+surfbn(ifac)
enddo
print *, 'flow out', sumpre
print *, 'flow out', s_tot
Is there a good way to find what I am doing wrong here?