Properly Setting BCs when Using gmsh2nek

800 views
Skip to first unread message

Rob Steele

unread,
Apr 24, 2020, 8:38:12 PM4/24/20
to Nek5000
Hello,

I'm attempting to recreate the turbPipe example in V19, with the exception of generating my own mesh in Gmsh, and subsequently exporting it to Nek5000 and running gmsh2nek.

I understand from the notes I was able to find online that periodic boundaries can be set by gmsh2nek, but all non-periodic boundaries (such as a wall) must be set in userdat2 in the .usr file.  Looking at the .usr file provided in the turbPipe example, it appears that the wall boundary is set by the existing code.

When I run my simulation, I get:

gs_setup: 0 unique labels shared

   handle bytes (avg, min, max): 2.80675e+06 2806748 2806748

   buffer bytes (avg, min, max): 0 0 0

   setupds time 4.9320E-02 seconds   4  6      110976        1700

  0  4      20  1  E    get_fast_bc_error

  0  2      20  1  E    get_fast_bc_error

  0  1      20  1  E    get_fast_bc_error

  0  3      20  1  E    get_fast_bc_error

  0  5      20  1  E    get_fast_bc_error

 -1  6      20  1  MSH  get_fast_bc_error

EXIT: Error A get_fast_bc         20


Which suggests to me my BCs are not set correctly.

My question is, what do the various options in gmsh2nek mean? For example:

1) Enter number of periodic boundary surface pairs: (would the inlet and outlet be a surface pair?  Or is that 2 surface pairs?)

2) input surface 1 and surface 2 BoundaryID (am I suppose to just enter '1' and then '2'?)

3) input translation vector (surface 1 -> surface 2) (is this suppose to be the direction of flow?)

Thanks!
Rob Steele

Byron Guerrero

unread,
Apr 25, 2020, 3:08:20 AM4/25/20
to Rob Steele, Nek5000
Hi Rob,

About your questions:

It depends on how you created your pipe mesh using gmsh. I'm not sure about your gmsh file, but mine looks like this:
$MeshFormat
2.2 0 8
$EndMeshFormat
$PhysicalNames
4
2 1 "inlet"
2 2 "outlet"
2 3 "walls"
3 4 "fluid"

It means that the physical name 1 = inlet, 2 = outlet, and 3 = walls.

Additionally, let's suppose that your pipe mesh has a length Lz = 10, whose axis is between  points (0, 0, 0) and (0,0,10)

Therefore when you execute gmsh2nek, you should do the following:

1) Enter number of periodic boundary surface pairs  (select 1 and 2 as inlet and outlet are periodic pairs if you require a peridic pipe)
1 2

2) input surface 1 and surface 2 BoundaryID()
1 2

3) input translation vector (For this example)
0 0 10

Hope this helps.

Best,
Byron

--
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/9e0db254-6ce6-43c6-a3e2-8088e352440d%40googlegroups.com.

Rob Steele

unread,
Apr 26, 2020, 11:33:11 PM4/26/20
to Nek5000

That helps a lot Byron, but for some reason I'm still getting errors.

Here's what the top of my .msh file looks like:

$MeshFormat

2.2 0 8

$EndMeshFormat

$PhysicalNames

4

2 1 "inlet"

2 2 "outlet"

2 3 "wall"

3 4 "flowDomain"

$EndPhysicalNames

$Nodes

14801


When I run gmsh2nek, this is what I get:

Input .msh file name: turbPipe

 total node number is        14801

 total quad element number is          570

 total hex element number is         1700

 ******************************************************

 Boundary info summary

 BoundaryName     BoundaryID

 inlet           1

 outlet           2

 wall           3

 ******************************************************

 Enter number of periodic boundary surface pairs:

1 2

 input surface 1 and  surface 2  BoundaryID

1 2

 input translation vector (surface 1 -> surface 2)

0 0 5

 doing periodic check for surface           1

 ERROR,          85 faces did not map

 doing periodic check for surface           1

 ERROR,          85 faces are wrongout of total           85  faces

 ******************************************************

 Please set boundary conditions to all non-periodic boundaries

 in .usr file usrdat2() subroutine

 ******************************************************


writing turbPipe.re2                                              


Then if I were to compile and run using the other files (except ma2 and re2 files) including in the turbPipe example I get the following error:

 call usrsetvert

 done :: usrsetvert


gs_setup: 0 unique labels shared

   handle bytes (avg, min, max): 2.80675e+06 2806748 2806748

   buffer bytes (avg, min, max): 0 0 0

   setupds time 5.2686E-02 seconds   4  6      110976        1700

  0  4      20  1  E    get_fast_bc_error

  0  2      20  1  E    get_fast_bc_error

  0  1      20  1  E    get_fast_bc_error

  0  3      20  1  E    get_fast_bc_error

  0  5      20  1  E    get_fast_bc_error

 -1  6      20  1  MSH  get_fast_bc_error

EXIT: Error A get_fast_bc         20

  

an error occured: dying ...




Any help would be greatly appreciated.
Thanks!
Rob Steele



To unsubscribe from this group and stop receiving emails from it, send an email to nek5000+unsubscribe@googlegroups.com.

Yuan, Haomin

unread,
Apr 28, 2020, 12:03:52 AM4/28/20
to Rob Steele, Nek5000

https://groups.google.com/d/msg/nek5000/yzbw3aQw3Sw/oXnfwOURAgAJ

 

Please check this link, someone answered it before.

 

 

Haomin (Kirk) Yuan

Nuclear/Reactor Engineer, Building 208/C145,

Nuclear Science & Engineering Division,

Argonne National Laboratory

Office number: 630-252-4171

To unsubscribe from this group and stop receiving emails from it, send an email to nek5000+u...@googlegroups.com.

--

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/323194fd-dc24-46d0-9aec-412483894a9d%40googlegroups.com.

Byron Guerrero

unread,
Apr 28, 2020, 7:52:37 PM4/28/20
to Rob Steele, Nek5000
Hi Rob,

I revised your file, and it seems to work. I made a typo on my previous post. As this is a periodic pipe, you only have one pair of periodic surfaces. Additionally, I can see that your pipe length Lz=10, not 5 as you have tried.

When I ran gmsh2nek, my terminal looks like this:

byron@ubuntu:~/Nek5000/Mesh$ gmsh2nek
Enter mesh dimension: 3
Input .msh file name: pipeTest

 total node number is        14801
 total quad element number is          570
 total hex element number is         1700
 ******************************************************
 Boundary info summary
 BoundaryName     BoundaryID
 inlet           1
 outlet           2
 wall           3
 ******************************************************
 Enter number of periodic boundary surface pairs:
1
 input surface 1 and  surface 2  BoundaryID
1 2
 input translation vector (surface 1 -> surface 2)
0 0 10

 ******************************************************
 Please set boundary conditions to all non-periodic boundaries
 in .usr file usrdat2() subroutine
 ******************************************************

writing pipeTest.re2

Hope this helps.

Cheers,
Byron

To unsubscribe from this group and stop receiving emails from it, send an email to nek5000+u...@googlegroups.com.

--
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/323194fd-dc24-46d0-9aec-412483894a9d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages