[Nek5000-users] How to identify boundary faces ?
nek5000-users at lists.mcs.anl.gov
nek5000-users at lists.mcs.anl.gov
Tue Jan 29 22:43:59 CST 2013
Hello
I want to identify boundary faces to set their boundary condition type.
Following some of the examples, I created the following function. To find
the location of the face, I need to know the coordinates (xf,yf) of the
face center using which I can figure out where the face lies. Is this
possible to find ?
Thanks
praveen
C=======================================================================
subroutine usrdat2
include 'SIZE'
include 'TOTAL'
parameter(XTOL=1e-10)
character*3 cbv
integer e, f
real xmin, xmax, ymax
xmin = -5.0
xmax = +10.0
ymax = 3.0
c set boundary conditions
do e = 1,nelt
do f = 1,2*ndim
cbv = cbc(f,e,1)
if (cbv.ne.'E ') then ! This is boundary edge
c TODO: Get mid-point coordinate of face f = (xf,yf)
if(abs(xf-xmin).lt.XTOL)then
cbc(f,e,1) = 'v ' ! inlet
else if(abs(xf-xmax).lt.XTOL)then
cbc(f,e,1) = 'O ' ! outlet
else if(abs(yf-ymax).lt.XTOL)then
cbc(f,e,1) = 'SYM' ! top wall
else
cbc(f,e,1) = 'W ' ! bottom wall
endif
endif
enddo
enddo
return
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20130130/24461ebe/attachment.html>
More information about the Nek5000-users
mailing list