CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Implementing periodic boundary conditions

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 2 Post By sbaffini
  • 2 Post By sbaffini

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2021, 10:17
Default Implementing periodic boundary conditions
  #1
Senior Member
 
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8
aerosayan is on a distinguished road
I have a scramjet body with 4 structured grid blocks, as shown in the figure.


While implementing the periodic boundary conditions as shown in between blocks 1-4 and 3-4, I'm currently not 100% sure if my implementation would be correct.


Currently, I think that if we just match the fluxes on the faces of the periodic boundaries, and then calculate the residuals in each cell correctly, our solutions will be correct.


Is that so? Or am I missing something important?


PS : There's one-to-one mapping between the faces of the different blocks at the boundaries, so I don't think we need any interpolation.
Attached Images
File Type: png scramjet-grid-blocks.png (21.5 KB, 21 views)
aerosayan is offline   Reply With Quote

Old   June 30, 2021, 13:46
Default
  #2
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,190
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
If each block has a layer of ghost/halo/whatever cells, which are just copies of the original cells in the corresponding blocks, all you need to do is:

1) Treat ghost cells of a block as if they were its own cells (i.e., allocate space for them in your arrays), but you won't use them except for computing fluxes between such ghost cells and actual cells of the current block. Such fluxes will, of course, only update the regular cells of the given block; that is, you need only the variables from the ghost cells, but otherwise leave them untouched.

2) Fluxes on faces between two blocks can then be handled like fluxes on interior faces of a block

3) Before computing fluxes you need to copy variables in ghost cells from their original cells in the original block and, if needed, locally recompute (or copy as well) all the resulting properties (viscosity, etc.)

This is how you do distributed parallel computations and, I think, is all you need here. Periodicity is basically handled in the same way, but as it may actually be rotational (and require rotation of vectors), I would not use "periodicity" to describe your situation, as it may be misleading.
aerosayan and aero_head like this.
sbaffini is offline   Reply With Quote

Old   June 30, 2021, 14:29
Default
  #3
Senior Member
 
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8
aerosayan is on a distinguished road
Thanks, I got the general idea. I will refer to literature, as I remember reading something like what you described in many papers.

Quote:
Originally Posted by sbaffini View Post
If each block has a layer of ghost/halo/whatever cells
This part will hurt a lil' bit. I don't have ghost cells on my n*m cell blocks. But I can use separate arrays to act as ghost cell layers. I'm definitely taking a lil' bit of performance hit there. But, I can make it work.
aerosayan is offline   Reply With Quote

Old   July 1, 2021, 05:18
Default
  #4
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,190
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
As you might have noticed, my explanation is kind of biased toward a distributed parallel implementation. But, if you are in a shared memory environment, of course, you don't really need such ghost cells, you can just have separate loops on each interblock face, as long as you can pick the correct variables from the two sides.

In distributed parallel you are obliged to copy somewhere the values coming from other processors, and ghost cells are the most obvious place. But, if you already have those values somewhere, it might not make sense to copy them at all.
aerosayan and aero_head like this.
sbaffini is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wind turbine simulation Saturn CFX 60 July 17, 2024 06:45
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Periodic Boundary Conditions mali_anttho FLUENT 0 July 14, 2016 06:46
PEMFC module + multiple periodic boundary conditions vkrastev FLUENT 2 December 22, 2014 05:15
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44


All times are GMT -4. The time now is 16:31.