Boundary ID after n2to3

29 views
Skip to first unread message

Sai Pranay

unread,
Aug 30, 2024, 9:55:23 AM8/30/24
to Nek5000
Hello all, 

Is there a way to get the boundary ID info of all the surfaces after performing n2to3 subroutine. i.e. from a .re2 format mesh
I need this info to get information out of the wall boundary ID. 
I tried converting the mesh into a .rea format but I couldn't decipher the info there. 

Do let me know if there is way to do it.

Thanks

YuHsiang Lan

unread,
Aug 30, 2024, 10:19:03 AM8/30/24
to Nek5000
Hi,

n2to3 should preserve the boundaryID of the original 2D mesh and extrude it to all elements on the face 1 to face 4.
Face 5 and 6 will use user's input and store BC in CBC.

In userdat2, you can do something like this

do iel=1,nelt
do ifc=1,4   ! convert bc id to cbc based on original 2D mesh
   if (boundaryID(ifc,iel).eq.1) cbc(ifc,iel,1) = 'W  '
enddo
do ifc=5,6   ! convert face 5-6 (z direction) from n2to3
   if (cbc(ifc,iel,1).eq.'v  ') cbc(ifc,iel,1) = 'W  '
enddo
enddo

Personally, I like putting use CBC to carry my boundary conditions. And, I use 'W  ', 'W01', 'W02', ... to act as a the boundaryID.
Therefore, if you want to distinguish the newly generated BC on face 5-6 and some other 'W  ', you can put 'W01' in n2to3 and convert it in userdat2.

Hope this helps,
Yu-Hsiang
--

Sai Pranay

unread,
Aug 30, 2024, 11:43:54 AM8/30/24
to Nek5000
Thank you

I donot want to convert/assign IDs, just see/visualise what ID's are assigned where. 


Pranay

Filipe Brandao

unread,
Dec 12, 2025, 1:16:09 PM (23 hours ago) Dec 12
to Nek5000
I am facing similar issue here. I have a 2D mesh created with gmsh with only 3 boundary IDs: 1- inlet, 2 - outlet, 3 - walls.

When executing the n2to3 command, we are asked to inform the boundary type for boundaries 5 and 6. What about boundary ID 4? I am prescribing the following in the .usr file :

    call setbc(1,1,'v  ') ! inflow
    call setbc(2,1,'O  ') ! outlet
    call setbc(3,1,'W  ') ! wall

    call setbc(5,1,'P  ')
    call setbc(6,1,'P  ')

I am not setting anything to ID 4 because I am assuming I would not have one. Is this correct? How can I find out?

Filipe


Reply all
Reply to author
Forward
0 new messages