Imposing BCs to non-periodic Boundaries in user file

98 views
Skip to first unread message

Daniyal Ahmed Khan

unread,
May 6, 2021, 3:00:33 AM5/6/21
to Nek5000
Hello , 
 I have converted my mesh successfully using gmsh2nek from gmsh to nek5000 in .re2 format. Since I had some periodic boundaries, so I need to specify these while doing gmsh2nek. I am actually stuck in defining BC's to my non-periodic boundaries in .usr file. Can anybody guide me about it.
I have attached some pics which might help u understand my problem. The red boundaries are all periodic (defined while doing gmsh2nek), the orange ones are wall and blue ones are input and output, respectively.
Any sort of help would be highly appreciated. 
Thanks.
1.png
BCs.JPG
2.png

Fischer, Paul

unread,
May 6, 2021, 7:59:16 AM5/6/21
to Daniyal Ahmed Khan, Nek5000

Dear Daniyal,
I think you can simply do the following, after you convert the BCs:

      imid=1                    ! Set mesh to support midside nodes
      call gen_re2(imid)  ! Output new .re2 file
      call exitti('quit after gen_re2$',imid)

Then, use the new .re2 file but also regenerate​ your map or ma2 file.

The point is that periodic BCs change the mesh topology, which is reflected in the ma2 or map file, so that has to be regenerated if you add or delete periodic BCs.

Note that you should not continue the simulation after calling gen_re2 because it clobbers some arrays when it outputs the file.   Also, all MPI ranks must call those two routines above, so the calls should not be in any if-block that would not allow all ranks to execute that statement.

hth,
Paul


From: nek...@googlegroups.com <nek...@googlegroups.com> on behalf of Daniyal Ahmed Khan <daniyalah...@gmail.com>
Sent: Thursday, May 6, 2021 2:00 AM
To: Nek5000 <nek...@googlegroups.com>
Subject: [nek5000] Imposing BCs to non-periodic Boundaries in user file
 
--
You received this message because you are subscribed to the Google Groups "Nek5000" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nek5000+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nek5000/818b533f-5912-4a96-aa05-c6455ee7c67cn%40googlegroups.com.

hy...@anl.gov

unread,
May 6, 2021, 1:18:24 PM5/6/21
to Nek5000
I think the easiest way is to redo gmsh2nek but without periodicity this time. 

Emmanuel Gillyns

unread,
May 21, 2021, 9:55:18 AM5/21/21
to Nek5000
Hi,

It might be too late for you, but just in case, it should work with the following in your usrdat2() :

do iel=1,nelv
  do ifc=1,2*ndim
    id_face = bc(5,ifc,iel,1)
    if (id_face.eq.1) then
      cbc(ifc,iel,1) = 'W '
    elseif (id_face.eq.2) then
      cbc(ifc,iel,1) = 'W '
    elseif (id_face.eq.3) then
      cbc(ifc,iel,1) = 'v '
    elseif (id_face.eq.4) then
      cbc(ifc,iel,1) = 'O '
    endif
  enddo
enddo
Reply all
Reply to author
Forward
0 new messages