[Nek5000-users] set obj for internal fluid surface

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Mon Sep 12 16:38:04 CDT 2011


Hi Mike,

If the geometry were a sphere and I new (roughly) that my
elements were of size 0.1 in thickness, I would use something
like:


       nxyz  = nx1*ny1*nz1
       nface = 2*ndim

       do e=1,nelv

          f = 6  ! top z surfae

          x=xm1(2,2,nz1,e)  ! spherical face is on top "z" surface
          y=ym1(2,2,nz1,e)  ! spherical face is on top "z" surface
          z=zm1(2,2,nz1,e)  ! spherical face is on top "z" surface

          rad = x*x+y*y+z*z
          if (rad.gt.0) rad=sqrt(rad)



          if (abs(rad-rad_sph).lt.0.2*thickness) then ! on the sphere

c           check normal also (superflous for this example)
             nx = unx(2,2,f,e)
             ny = uny(2,2,f,e)
             nz = unz(2,2,f,e)

             rn = nx*x + ny*y + nz*z  ! N.X
             if (rn.gt.0) then ! we have the outward pointing face, add obj
                iobj  = 1
                nmember(iobj) = nmember(iobj) + 1
                mem = nmember(iobj)
                eg  = lglel(e)
                object(iobj,mem,1) = eg
                object(iobj,mem,2) = f
             endif

          endif
       enddo


This code was extracted from the "ext_cyl" example as a starting
point.

Another approach --- if you know a lot about your surface at
the time of mesh creation (e.g., the element and face numbers),
you can just store this in a list and read it in.

Paul






More information about the Nek5000-users mailing list