<div dir="ltr">Hello<div>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 ?</div>
<div><br></div><div>Thanks</div><div>praveen</div><div><br></div><div><div>C=======================================================================</div><div> subroutine usrdat2</div><div><br></div><div> include 'SIZE'</div>
<div> include 'TOTAL'</div><div><br></div><div> parameter(XTOL=1e-10)</div><div> character*3 cbv</div><div> integer e, f</div><div> real xmin, xmax, ymax</div><div><br></div><div> xmin = -5.0</div>
<div> xmax = +10.0</div><div> ymax = 3.0</div><div><br></div><div>c set boundary conditions</div><div> do e = 1,nelt</div><div> do f = 1,2*ndim</div><div> cbv = cbc(f,e,1)</div><div> if (cbv.ne.'E ') then ! This is boundary edge</div>
<div>c TODO: Get mid-point coordinate of face f = (xf,yf)</div><div> if(abs(xf-xmin).lt.XTOL)then</div><div> cbc(f,e,1) = 'v ' ! inlet</div><div> else if(abs(xf-xmax).lt.XTOL)then</div>
<div> cbc(f,e,1) = 'O ' ! outlet</div><div> else if(abs(yf-ymax).lt.XTOL)then</div><div> cbc(f,e,1) = 'SYM' ! top wall</div><div> else</div>
<div> cbc(f,e,1) = 'W ' ! bottom wall</div><div> endif</div><div> endif</div><div> enddo</div><div> enddo</div><div><br></div><div> return</div><div>
end</div></div><div><br></div></div>