getting lambda2 and history points results from already calculated results

399 views
Skip to first unread message

Hussein Kokash

unread,
Aug 22, 2022, 1:59:32 PM8/22/22
to Nek5000
Hello guys,

I have output files (velocity) for a case and I want to get lambda2 files and history points results from these files.

How can I have them without recalculating the case because the case takes very long time to compute? is it done by restarting? what should I change in order to get them and would I do that for every output file?


Thank you very much, stay safe everyone!

YuHsiang Lan

unread,
Sep 2, 2022, 1:10:34 PM9/2/22
to Nek5000
Hi,

I happen to need this recently.
Basically, you can read the output files one by one from a list and do whatever you want.

The subroutine is from others and I simply modify it to meet my need.

include 'mypost.f'

1. Put your files into a list
cat a.list
cyl0.f00001
cyl0.f00002
...
cyl0.f01000


2. In userchk, call the interface subroutine (mypost.f/post_reader) to read that list
      character*127 fname

      fname='a.list ' ! space for end character ?
      call post_reader(fname) ! read all file in the a.list one by one

      call exitt0
   It will go through all file in the list, open it one by one and execute the following work subroutine

3. Edit the "post_reader_work" subroutine (put it in user file) to do post-processing
   In my case, I want to save them into uniform grid.
      subroutine post_reader_work(ifile) ! do stuff after open a file
      implicit none
      include 'SIZE'
      include 'TOTAL'
      integer ifile

      ifreguo = .true.
      ifxyo = .true.
      call outpost(vx,vy,vz,pr,t,'unf')
      if(nio.eq.0) write(*,*) 'file',ifile,' ... done!'

      return
      end
  You can call lambda2(t) there and manipulate istep (=0 since it's called at the first userchk) and time (read from file) based on the variable "ifile" so call hpts() will dump them into your .his file directly.

Hope this helps,
Yu-Hsiang
--
mypost.f

Hussein Kokash

unread,
Sep 4, 2022, 5:21:35 PM9/4/22
to Nek5000
I will test it out and give you a feedback of the results.


Thank you Yu-Hsiang, appreciate it!

Hussein Kokash

unread,
Sep 5, 2022, 3:53:36 PM9/5/22
to Nek5000
Yu-Hsiang, is it possible to attach the .usr file that you use for post-processing?

And regarding the subroutine mypost.f, it goes in the core folder of Nek5000?


Thank you!

YuHsiang Lan

unread,
Sep 5, 2022, 3:57:29 PM9/5/22
to Nek5000
Hi,

Here you are.
You simply put the mypost.f under the same folder as your usr file and it should compile.

Yu-Hsiang
--
cyl.usr

Hussein Kokash

unread,
Sep 5, 2022, 10:48:40 PM9/5/22
to Nek5000
Hello YuHsiang,

An update, it worked brilliantly on history points for all the files, however using lambda or vorticity it always came back with this:

Error: Function ‘vort’ at (1) has no IMPLICIT type
makefile:129: recipe for target 'usrfile' failed
make: *** [usrfile] Error 1
make: *** Waiting for unfinished jobs....



This is what I use to call vorticity for example:
      if (mod(ISTEP,int(UPARAM(1))).eq.0) then
        call comp_vort3(vort , w1, w2, vx, vy, vz)
        call outpost(vort(1,1),vort(1,2),vort(1,3),pr,t,'vrt')
      endif


I guess there is a change to be made on how to call vorticity in the post_reader_work subroutine, is that so?

And thank a lot, again :)
Reply all
Reply to author
Forward
0 new messages