[Nek5000-users] Area integral calculation in Nek

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Mon Oct 15 15:15:57 CDT 2012


Hi Joerg,

If your geometry came from n2to3, then your data
is organized into planar sections and you can compute

            /
   F(z) =   |  f(x,y,z) dx dy
            /A

as follows:

       common /scruz/ fbar(lz1,lelz),wght(lz1,lelz),work(lz1,lelz)
       integer e,eg,ex,ey,ez,f

       nelz  = [how many levels you have in z]
       nelxy = nelgv/nelz ! Number of elements in a plane

       call rzero(fbar,nz1*nelz)
       call rzero(wght,nz1*nelz)

       f = 5  ! Pick face 5 to evaluate surface Jacobian

       do e=1,nelv
          eg = lglel(e)
          call get_exyz(ex,ey,ez,eg,nelxyz,1,nelz)
          do k=1,nz1
          do i=1,nx1*ny1
             fbar(k,ez) = fbar(k,ez)+area(i,f,e)*f(i,1,k,e)
             wght(k,ez) = wght(k,ez)+area(i,f,e)
          enddo
          enddo
       enddo
       call gop(fbar,work,'+  ',nz1*nelv)
       call gop(wght,work,'+  ',nz1*nelv)
       do i=1,nz1*nelz
          fbar(i,1)=fbar(i,1)/wght(i,1) ! If you want the average
       enddo

That should pretty much work as is... You need to specify
nelz and lelz >= nelz.

Paul


On Mon, 15 Oct 2012, nek5000-users at lists.mcs.anl.gov wrote:

> Hi,
>
> I work in cylindrical geometry and want to evaluate an integral of one of
> scalar fields over the circular cross section at fixed position z_0. I
> suppose that the best way would be to make use of the GLL quadrature formulas
> on the elements after picking the elements at desired height z_0. I have two
> short questions:
>
> 1/  Is it correct that xm1, ym1, zm1 are the coordinate arrays, i.e. fixing
> for example zm1(i,1,1,1)=0.5 would then give all elements that contain nodes
> in exactly this plane?
>
> 2/ Are the GLL weights at the primary and secondary nodes stored in a
> specific array or do I have to evaluate them for each element, e.g. by
> combination of 1d routines which are collected in speclib.f?
>
> Thanks in advance, Joerg.
>
> _______________________________________________
> Nek5000-users mailing list
> Nek5000-users at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>


More information about the Nek5000-users mailing list