[Nek5000-users] Add/subtract 1d-mean profile

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Mon Mar 12 07:54:11 CDT 2012


Hi Jan,


Please, take a look at the routine planar_average_z(ua,u,w1,w2) in navier5.f:1728

For a box-like (say cartesian) geometry with element numbering in the lexographical order, it returns xy-plane-averaged ua of an array u(i,j,k,e)


To use it you need to set your box dimensions, say with lelx,lely,lelz in SIZE and then in userchk()


       real ua(lz1,lelz),uf(lx1,ly1,lz1,lelv),w1(lz1,lelz),w2(lz1,nelz) ! avg., fluct. & work arrays
       integer e,eg,ez

       nelx = lelx
       nely = lely
       nelz = lelz
       melg = nelx*nely*nelz

       if (melg.eq.nelgt) then

         call planar_average_z(ua,vz,w1,w2)
         
         do e=1,nelv
           do k=1,nz1
           do k=1,nz1
           do k=1,nz1

             eg = lglel(e)
             call get_exyz(ex,ey,ez,eg,nelx,nely,nelz) ! lexicographical ordering

             uf(i,j,k,e) = vz(i,j,k,e) - ua(k,ez)      ! not efficient but clear
           enddo
           enddo
           enddo
         enddo
       else
         if (nid.eq.0)  write (6,*) ' Wrong lelx,lely,lelz'
       endif


Best.
Aleks



----- Original Message -----
From: nek5000-users at lists.mcs.anl.gov
To: nek5000-users at lists.mcs.anl.gov
Sent: Sunday, March 11, 2012 12:09:00 PM
Subject: Re: [Nek5000-users] Add/subtract 1d-mean profile

(Same mail, new formatting...)

Hi Paul,

first of all thanks for the quick reply!


   >  I guess my first question is the following.  When you say you want to
   >
   >  "add or subtract this profile which is given on the global nodes
to each point of the field"
   >  it seems we need to be talking in the context of some software
   >  that is going to read the field in and then process the data.
   >
   >  At present, I know of only 3 codes to do that: nek, VisIt, and
postnek (though there have been custom, one-off, codes written
   >  in the past).

I want to do the whole post-processing in nek. With VisIt I only
visualize my data generated with nek (the post-processed data as well
as the raw simulation data). With postnek I haven't worked until now
and I think postnek is not what I'm looking for.



   >  Second question is --- What do you want to do with this field
   >  after you have subtracted the mean profile?   Do you want to
   >  write it to disk, visualize it, use it in a calculation, analyze
it with more statistics, or....?

I want to analyze the statistics, calculate higher order moments of
the fluctuation field (to compare it with the channel data of Robert
D. Moser, John Kim and Nagi N. Mansour,
Physics of Fluids, vol 11(4), for example the skewness or the flatness
of the field) or the gradients of the fluctuation field du'_i/dx_j to
get (fluctuation based) \omega'_k or the (fluctuation based) strain
rate tensor s'_ij = 1/2*(du'_i/dx_j + du'_j/dx_i).
These are only few examples on what I would like to do...

But for all these things I need the fluctuation field and that means
u' = u - <u>.
In this context <u> would be (for example if I don't have the temporal
avg_all() means) the spatial (y-) mean over the full channel domain.

When I do my production run with the code I can obtain the temporal
averages by calling avg_all() every timestep and then write it to
disk, thats clear to me.

But my question aims on how to get the fluctuation field without
having the temporal averages. Based on only a single velocity filed
(as described above).



   >  In any case, it seems likely that processing in nek is the
   >  way to go because it has the ability to read the data, write
   >  the data, and readily compute statistics.   In this mode, you
   >  simply are using nek as a post-processor and not for timestepping.
   >
   >  Please advise if that's the path you wish to take, or if you
   >  had something else in mind.

Yes, thats the way I want  to do my post-processing (and already do it
right now...).

Regards
Jan F.
_______________________________________________
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