CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 (https://www.cfd-online.com/Forums/su2/)
-   -   Periodic Boundary Condition Tutorial (https://www.cfd-online.com/Forums/su2/114849-periodic-boundary-condition-tutorial.html)

88turbo March 18, 2013 21: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 19:30

1 Attachment(s)
Hi,

I tried this case a while ago, see:
http://www.cfd-online.com/Forums/su2...-flow-vtk.html

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.

Regards

Cean

shirazbj March 21, 2013 21:55

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

still looks wired.

fpalacios March 23, 2013 13: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.

Best,
Francisco

shirazbj March 24, 2013 19: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.

Amrita

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.

Regards,

Cean

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.



-Sean

gerritgroot May 20, 2013 05:59

Error in the cfg of this case
 
Hi,

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:

Quote:

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.

Thx

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

Quote:

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

Quote:

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,
Tom

shirazbj May 21, 2013 07:41

1 Attachment(s)
Quote:

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.

Tom

Great!

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.

Cean

gerritgroot May 21, 2013 17:13

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

@shirazbj

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

Quote:

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).

T

shirazbj May 21, 2013 22:50

Quote:

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)
Quote:

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.

Amrita Lonkar May 23, 2013 11:55

SU2 now adds halo cells to only one side of the mesh. We do not require two sets of halo cells, and the information is exchanged between the set of halo cells, and a set of interior points on the other side of the mesh.

shirazbj May 23, 2013 21:23

Quote:

Originally Posted by Amrita Lonkar (Post 429553)
SU2 now adds halo cells to only one side of the mesh. We do not require two sets of halo cells, and the information is exchanged between the set of halo cells, and a set of interior points on the other side of the mesh.

In a cfg file, the sender and receiver is define twice and the PBC program calculates twice.

Is the added halo cells a copy of the set of interior points on the other side?

ITA91 April 17, 2015 05:51

Problems with periodic boundary condition
 
2 Attachment(s)
*bump*

It has been a while since the last post in this thread, but for me it seemed suitable to post it here since this thread is the only one I could find on the SU2 part of this forum considering periodic boundary conditions.

I'm trying to do a relatively simple flow analysis of a Caradonna & Tung rotor for compressible, inviscid rotating flow at 2500 rpm. Hence, this case is almost similar to the case provided in the Test Cases, I'm just using my own mesh instead of the one provided in the Test Cases. The main difference is that I try to run this case using a periodic boundary condition, which should be possible given that the situation is axisymmetric. Unfortunately, I'm experiencing some issues with this. First of all, the SU2_PBC module seems to have disappeared from the 3.2 version, is this correct? I couldn't find it on the Github page. Luckily my supervisor still has the 3.1 version installed next to the newest one, this version still includes SU2_PBC. I have adapted the mesh using the SU2_PBC executable from his V3.1 and then I used my own V3.2 to run the CFD simulation. For the first ~30 iterations everything seems to go well and it seems to converge nicely, but afterwards the residuals start to increase and the simulation diverges. I have already had to add a shaft at the rotation axis to prevent mismatches in the mesh after running SU2_PBC, such that my mesh looks similar to the case presented here: http://www.task.gda.pl/files/quart/T...4/tq312j-e.pdf. Also see the screenshot that I've attached (from Pointwise)

So, does anybody know what I can try to do in order to solve this? I've tried copying this mesh and rotating it 180 degrees about the x-axis to obtain the "full" grid in order to check if this might yield some new information, but the CFD simulation using this mesh converges normally. I've also attached a view from the periodic_halo.plt file that SU2_PBC gives as output. It only shows halo cells on one of the periodic boundaries, is this correct? In the configuration file I have defined the MARKER_PERIODIC both ways so this shouldn't be the problem:

MARKER_PERIODIC= ( periodic1, periodic2, 0.0, 0.0, 0.0, -180.0, 0.0, 0.0, 0.0, 0.0, 0.0, periodic2, periodic1, 0.0, 0.0, 0.0, +180.0, 0.0, 0.0, 0.0, 0.0, 0.0 )

Running the simulation without adapting the mesh doesn't help either; the simulation starts but it already has non-physical points from the beginning and the calculation quickly diverges.

Thanks in advance for your help! :)

Lokanayaki August 3, 2018 03:49

Hi Tom,
I am looking for tutorial cases with periodic boundary condition. I tried to download the files from the link provided but it seems that the link does not exist. Could you please provide the files. It will be of great help.

jomunkas March 4, 2020 08:26

segmentation fault
 
1 Attachment(s)
Hi,

I have a problem with periodic boundary conditions. I am generating the mesh with Pointwise which should ensure the periodic matching but I am getting "segmentation fault" error message:





Code:

-------------------------------------------------------------------------
|    ___ _  _ ___                                                      |
|  / __| | | |_  )  Release 6.1.0  "Falcon"                          |
|  \__ \ |_| |/ /                                                      |
|  |___/\___//___|  Suite (Mesh Adaptation Code)                      |
|                                                                      |
-------------------------------------------------------------------------
| The current SU2 release has been coordinated by the                  |
| SU2 International Developers Society <www.su2devsociety.org>          |
| with selected contributions from the open-source community.          |
-------------------------------------------------------------------------
| The main research teams contributing to the current release are:      |
| - Prof. Juan J. Alonso's group at Stanford University.                |
| - Prof. Piero Colonna's group at Delft University of Technology.      |
| - Prof. Nicolas R. Gauger's group at Kaiserslautern U. of Technology. |
| - Prof. Alberto Guardone's group at Polytechnic University of Milan.  |
| - Prof. Rafael Palacios' group at Imperial College London.            |
| - Prof. Vincent Terrapon's group at the University of Liege.          |
| - Prof. Edwin van der Weide's group at the University of Twente.      |
| - Lab. of New Concepts in Aeronautics at Tech. Inst. of Aeronautics.  |
-------------------------------------------------------------------------
| Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon,      |
|                      Tim Albring, and the SU2 contributors.          |
|                                                                      |
| SU2 is free software; you can redistribute it and/or                  |
| modify it under the terms of the GNU Lesser General Public            |
| License as published by the Free Software Foundation; either          |
| version 2.1 of the License, or (at your option) any later version.    |
|                                                                      |
| SU2 is distributed in the hope that it will be useful,                |
| but WITHOUT ANY WARRANTY; without even the implied warranty of        |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
| Lesser General Public License for more details.                      |
|                                                                      |
| You should have received a copy of the GNU Lesser General Public      |
| License along with SU2. If not, see <http://www.gnu.org/licenses/>.  |
-------------------------------------------------------------------------

------------------------ Physical Case Definition -----------------------
Input mesh file name: mesh_simple.su2

----------------------- Grid adaptation strategy ------------------------
Grid modification to run periodic bc problems.

-------------------------- Output Information ---------------------------
Output mesh file name: mesh_out.su2.
Output mesh file name: mesh_out.su2.
Restart flow file name: restart_flow.dat.

------------------- Config File Boundary Information --------------------
Euler wall boundary marker(s): HUB, FF.
Far-field boundary marker(s): IN.
Periodic boundary marker(s): SIDE-, SIDE+.
Outlet boundary marker(s): OUT.

---------------------- Read Grid File Information -----------------------
Three dimensional problem.
303 points.
6 surface markers.
126 boundary elements in index 0 (Marker = FF).
66 boundary elements in index 1 (Marker = HUB).
50 boundary elements in index 2 (Marker = IN).
50 boundary elements in index 3 (Marker = OUT).
44 boundary elements in index 4 (Marker = SIDE+).
44 boundary elements in index 5 (Marker = SIDE-).
1158 tetrahedra.

----------------------- Preprocessing computations ----------------------
Setting local point and element connectivity.
Check numerical grid orientation.
Identify faces, edges and vertices.
Set control volume structure.
Volume of the computational grid: 0.589273.

-------------------- Setting the periodic boundaries --------------------
Setting the periodic boundary conditions.
Checking SIDE+ boundary against periodic donor, SIDE-.
Checking SIDE- boundary against periodic donor, SIDE+.
Number of new points: 39.
Number of new interior elements: 145.
Number of new boundary elements added to preexisting markers: 37.

------------------------- Solver Postprocessing -------------------------
[langos-lnx:12882] *** Process received signal ***
[langos-lnx:12882] Signal: Segmentation fault (11)
[langos-lnx:12882] Signal code: Address not mapped (1)
[langos-lnx:12882] Failing at address: 0x80
[langos-lnx:12882] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f36aed7c390]
[langos-lnx:12882] [ 1] SU2_MSH[0x547e6a]
[langos-lnx:12882] [ 2] SU2_MSH[0x54b269]
[langos-lnx:12882] [ 3] SU2_MSH[0x41cf66]
[langos-lnx:12882] [ 4] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f36ae9c1830]
[langos-lnx:12882] [ 5] SU2_MSH[0x47ab79]
[langos-lnx:12882] *** End of error message ***
Segmentation fault (core dumped)

Do you know what I am doing wrong?


Kind Regards,
Zeno

pcg March 5, 2020 08:41

Can you use version 7? This step through SU2_MSH is no longer required.

jomunkas March 6, 2020 09:49

works
 
Quote:

Originally Posted by pcg (Post 760549)
Can you use version 7? This step through SU2_MSH is no longer required.

Indeed, version 5 and 7 does the job without a problem.


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