migrating from Nek5000 to NekRS

263 views
Skip to first unread message

Arsen Iskhakov

unread,
Aug 17, 2021, 1:14:48 PM8/17/21
to Nek5000
Hello everyone,

I need to switch from Nek5000 to NekRS.
My Nek5000 .usr file has following custom commands in userchk():

      subroutine userchk()
      implicit none
      include 'SIZE'
      include 'TOTAL'

      ! velocity gradients
      real dwdx(lx1, ly1, lz1, lelv),
     &     dwdy(lx1, ly1, lz1, lelv),
     &     dwdz(lx1, ly1, lz1, lelv)
      
      ! calculate velocity gradients
      call gradm1(dwdx, dwdy, dwdz, vz)

      ! make derivatives smooth
      n = nx1*ny1*nz1*nelv
      call col2(dwdy, bm1, n)
      call dssum(dwdy, nx1, ny1, nz1)
      call col2(dwdy, bintm1, n)

      return
      end 

Is it possible to do the same commands in NekRS in .udf file?
At this point, I do not want to consider calling userchk() from UDF_ExecuteStep (I want to have "pure" c++ implementation since there are some more things that I will do later there).


Thanks!

vclei...@gmail.com

unread,
Aug 17, 2021, 3:06:39 PM8/17/21
to Nek5000
Hello Arsen,

You can do similar commands in nekRS. To do so, you need to define these functions in the .udf and implement them in the .oudf file.

I am sending you a case setup of a differently heated square cavity (DHSC) that I have implemented a few months ago (thus it is likely that they won't work in the latest version of the code). These files may be useful for you once it computes the temperature gradient `gradT` in the .oudf file. Just for your knowledge, the idea of this case is to account for buoyancy effects using the Simple Gradient Diffusion Hypothesis (SGDH) which explicitly computes a production term that depends on the temperature gradient. This term is included in `userq` (see the `qAdd` kernel).

Another piece of advice that I can give you for computing the derivatives is to look at `okl/plugins/RANSktau.okl` file, I used what's available in this file to develop the DHSC case.

I hope this can help.

Regards,
Victor

dhsc.tar.gz
Reply all
Reply to author
Forward
0 new messages