CFD Online Discussion Forums

CFD Online Discussion Forums (
-   SU2 (
-   -   Periodic Boundary Condition Tutorial (

88turbo March 18, 2013 22:55

Periodic Boundary Condition Tutorial
I tried to find a tutorials or test case on using the periodic boundary condition module (SU2_PBC), but didn't have a lot of luck. I saw the periodic markers in the open rotor test case, but I couldn't get it to run. The case I'm running creates a 'mesh_out.su2' file, but I don't know if I need to run that back through the SU2_CFD or not. Any help is appreciated! Thanks!

shirazbj March 19, 2013 20:30

1 Attachment(s)

I tried this case a while ago, see:

I tried with su2_cfd, but not su2_pbc. Under win7@32.

The mesh_openrotor_79k.su2 already has periodic conditions in it. I tried to remove all parts after MARKER_TAG= SEND_RECEIVE in the mesh file and then run su2_pdc.exe, It generate a new mesh file and added the removed parts. Also there is a periodic_halo.vtk, but it looks wired in Paraview. See attached pic.

The new Rev1206 source code can outputs nearly correct mesh in ascii tecplot format whih ghost points removed. The original 2.0 version can't. still expecting the new version of new output.



shirazbj March 21, 2013 22:55

1 Attachment(s)
this is the result with new 2.0.2 su2_pbc.

still looks wired.

fpalacios March 23, 2013 14:37

The picture doesn't make sense for me... as far I see the periodic_original.plt already has a halo cells created by the PBC?
Maybe you are running PBC twice, or maybe the original grid already has the periodic structure.


shirazbj March 24, 2013 20:54

I see. With the mesh file provided for that case, i also need to remove some points and elements before runing su2_pbc.exe. Not just the send_receive tag parts.

if su2_pbc is combined into su2_cfd, maybe it's easier to output the result.

Amrita Lonkar May 2, 2013 12:52

Hi Steve and Cean,

The procedure to include PBC boundary conditions in your simulation are:

1) Create a regular mesh in .su2 or .cgns format.
2) Use a configuration file which has the option for the periodic marker.

For example,
MARKER_PERIODIC= ( SideWall1, SideWall2, 0,1.0, 0, -60, 0, 0, 0, 0,0, SideWall2, SideWall1, 0,1.0,0, 60, 0,0, 0,0,0 )

where the format of the above quantities is:
% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y,
% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis,
% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ).

Use this mesh file and configuration file to run SU2_PBC as:

SU2_PBC configuration.cfg

This will output a new mesh (by default named mesh_out.su2) with a set of halo cells.

Use this mesh file to run a flow simulation. This can be done by just renaming the input mesh file in the configuration file as:
MESH_FILENAME = mesh_out.su2

This should work, let us know if this doesn't. We will soon add a test case to demonstrate this capability. Thanks for highlighting this issue.


shirazbj May 2, 2013 20:34

Hi Amrita,

I realised the compilcation of the mesh file: it may be a normal file or a file generated by su2_PBC.

If su2_CFD can hide the su2_PBC detail, it would be more easy to use.



copeland May 9, 2013 13:00

Hi Cean,

Just to follow up, you can always tell if a mesh file has been generated using SU2_PBC by opening the .su2 mesh file and searching for "MARKER_TAG= SEND_RECEIVE". If this send/receive tag is in the file, it has been generated using the periodic module.

Thanks for your suggestion on incorporating PBC into the main CFD module, we are always looking for ways to improve the usability of the code. We'll keep it in mind for future releases.


gerritgroot May 20, 2013 05:59

Error in the cfg of this case

I tried the same as Shirazbj and after some effort cleaning up the mesh "mesh_openrotor_79k.su2" having taken away what SU2_PBC supposedly added to the original mesh, I ran SU2_PBC and got the same wired result.

The error seems to be in the cfg file that's given with the example, I think it should be:


MARKER_PERIODIC= ( periodic_1, periodic_2, 0.0, 0.0, 0.0, -45, 0.0, 0.0, 0.0, 0.0, 0.0, periodic_2, periodic_1, 0.0, 0.0, 0.0, +45.0, 0.0, 0.0, 0.0, 0.0, 0.0 )
Shouldn't it?

shirazbj May 20, 2013 07:45

Is it possible to release the file which is used to generated the mesh_openrotor_79k.su2 with su2_pbc?

Just as a demo to show how su2_pbc works.


gerritgroot May 20, 2013 08:24

1 Attachment(s)
I think the best thing would be that the developers release the original file they started with.

I tried to attach my handmade back engineered mesh file that came from the original mesh file that already had the pbc in it, but the filesize is larger than what's allowed here (much larger.)

I added a picture though. The trick to get the clean file back without PBC was not only taking away the extra nodes as you posted, but also the extra elements on all the external boundary faces.

shirazbj May 20, 2013 08:27


Originally Posted by gerritgroot (Post 428683)
I think the best thing would be that the developers release the original file they started with.

Yes, I am thinking su2 team has a demo case for su2_pbc.

economon May 21, 2013 05:13


Originally Posted by shirazbj (Post 428685)
Yes, I am thinking su2 team has a demo case for su2_pbc.

Dear shirazbj & gerritgroot,

A tutorial for using the periodic boundary conditions in SU2 is a great idea, and we will try to get an official tutorial up in the documentation as soon as we can.

In the meantime, I am providing a simple test case to demo the process. Please find the translation_NACA0012.cfg config file and corresponding initial mesh, mesh_NACA0012_translation_prepbc.su2, that can be downloaded here. This is a translational periodicity case (rotational periodicity requires only a different marker specification). To run this case using periodic boundary conditions, please perform the following steps:

1. Execute SU2_PBC at the command line using '$ SU2_PBC translation_NACA0012.cfg'

2. SU2_PBC will read in the original mesh, mesh_NACA0012_translation_prepbc.su2, and create the new halo cells needed for the periodic boundary condition. A new mesh file will be generated with these cells, and it will be named mesh_out.su2 (as specified in the config). Two mesh files in Tecplot format will also be written so that the original and new meshes can be visualized. Please check these two files, periodic_original.plt & periodic_halo.plt.

3. Open the config file and change the specified mesh file to the newly generated file with the periodic conditions built in by setting MESH_FILENAME= mesh_out.su2.

4. Execute SU2_CFD at the command line using '$ SU2_CFD translation_NACA0012.cfg'. This Euler case should converge relatively quickly, and you can check the solution files afterwards.

I hope that being able to inspect the config file options and visualize the meshes generated by SU2_PBC helps to shed some light on the periodic boundary conditions. Please let me know if anything is unclear.

All the best,

shirazbj May 21, 2013 07:41

1 Attachment(s)

Originally Posted by economon (Post 428831)
Dear shirazbj & gerritgroot,

A tutorial for using the periodic boundary conditions in SU2 is a great idea, and we will try to get an official tutorial up in the documentation as soon as we can.



Finally I am getting there. I made a 3d 90 degree elbow. PBC is working, just I got bad match. Don't know how to improve. Are the two periodic surfaces must meshed the same?

I attached my cfg and su2 mesh.

Thanks for help.


gerritgroot May 21, 2013 17:13

1 Attachment(s)
Thanks economon, that runs fine.


It seems you messed the BC names up.

Rename your boundary conditions as follows.

Farfield -> Periodic_1
Hub -> Outlet
Periodic_2 -> Hub
Periodic_1 -> Farfield
Outlet -> Periodic_2
Inlet = OK

In the cgf file rename

FarField -> Farfield

That worked! :)

See the attached file and run:
SU2_PBC bjt3.cfg
SU2_CFD bjt3_pbc.cfg

May I ask to both of you, which grid generator you are using? :confused:

economon May 21, 2013 19:29


Originally Posted by shirazbj (Post 428873)
Are the two periodic surfaces must meshed the same?

SU2_PBC will look for a one-to-one match for each node on the two periodic faces, so it is best to create identical copies of the edges/domains that are translated or rotated to the periodic position.

Here in our lab, I have access to the Pointwise meshing package and take advantage of our Pointwise->Native SU2 mesh exporter (this plugin is now built into the current version of Pointwise).


shirazbj May 21, 2013 22:50


Originally Posted by gerritgroot (Post 428999)
May I ask to both of you, which grid generator you are using? :confused:

Thanks gerritgroot.

I use free GMSH and convert its msh file into su2 file with my free code gmsh2su2.f90.

I have to figure out where I messed up the surface names.

gerritgroot May 22, 2013 03:32

Looking at your grid, I expected that, thanks for confirming that. I'm looking for an example of a serious mesh script of an IGES/STEP geometry with a separate prismatic boundary layer grid.

All I find in the gmsh tutorials are geometries that are generated in gmsh itself.

Do you know if something like that is available?

Writing something like gmsh2su2.f90 is something I would do (in fortran as well), but once I get the hang of gmsh.:cool:

shirazbj May 23, 2013 06:46

1 Attachment(s)

Originally Posted by gerritgroot (Post 428999)
That worked! :)

Why only one side has the hole? Not both sides like the rotor case?

gerritgroot May 23, 2013 10:52

What do you mean?

Periodic halo cells have been added on the outside of the periodic walls, there is no hole in your domain.

All times are GMT -4. The time now is 23:13.