
[Sponsors] 
Periodic boundary conditions for solving Navier Stokes Equations on a Staggered Grid 

LinkBack  Thread Tools  Search this Thread  Display Modes 
February 22, 2016, 00:06 
Periodic boundary conditions for solving Navier Stokes Equations on a Staggered Grid

#1 
New Member

Hello,
I want to solve two dimensional Navier Stokes equations on a staggered grid for the case of TaylorGreen Vortex. As I am aware, we should use periodic boundary conditions on all the four boundaries. I am facing some trouble regarding implementation of this BC as I could not find enough literature about it. Suppose, if my index ranges from 0 to N. Then, is this the correct way to use periodic BC? u_vel(N) = u_vel(1) u_vel(0) = u_vel(N1) and similarly for v_vel and pressure variables? Thanks! 

February 22, 2016, 05:26 

#2 
Member
Kaya Onur Dag
Join Date: Apr 2013
Posts: 94
Rep Power: 10 
Yes you should use periodic bc.
I'd make it in a way that u_vel(N+1) = u_vel(0). So my derivative matrix will be say 3diagonal and a point at the corners. Not that you can't do u_vel(N) = u_vel(1) but why wasting computation if you know the values 

February 22, 2016, 05:30 

#3 
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 5,905
Rep Power: 63 
be carefull to the link between the periodic nodes if you use staggered grid!


February 22, 2016, 22:12 

#4  
New Member

Quote:
If I just write u(0) = u(Nu1), u(Nu) = u(2) v(0) = v(Nv1), v(Nv) = v(2) p(0) = p(Np1), p(Np) = p(2) for their respective grids. Will it create some problem? BTW, I am doing exactly this and my result diverges. I am using analytic solution as my initial conditions. 

February 23, 2016, 06:09 

#5 
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 5,905
Rep Power: 63 
I depends on the grid topology you are using...
For example, given L the periodicity lenght in the interval (0,L) and Nx the number of step sizes dx, the nodal grid can be written as x(i) =i*dx i=0:Nx or x(i)=(i1)*dx i=1:Nx+1 now you have to define the staggering for the variables, for example in 2D u(i,j) at x(i),y(j)dy/2 v(i,j) at x(i)dx/2,y(j) p(i,j) at x(i)dx/2, y(j)dy/2 

February 23, 2016, 23:52 

#7  
New Member

Quote:
So, as in my case of a staggered grid, I have three separate grids for U, V and P. Their grid sizes being [N,N+1],[N+1,N],[N+1,N+1] respectively. For the U velocity, I solve NS equations for the interior points i.e. upto N1 points in x and N points in ydirection, and similarly for the other two primitive variables. I am using an explicit finite difference based method. So, to apply the periodic BC, can I use your " 0 = N1, N+1 = 2 " for all the three grids INDEPENDENTLY? Or, there has to be some correlation between applying periodicity for the three variables (may be because of staggered grid). Since my results are still diverging, I can not understand where I am implementing BC wrong (my code works for Dirichlet BC where I specify a fix value on all the boundaries). 

February 26, 2016, 17:46 

#9  
Member
Kaya Onur Dag
Join Date: Apr 2013
Posts: 94
Rep Power: 10 
Quote:
P(N,j)=P(1,j) j=1...N P(i,N)=P(i,1) i=1...N u(N,j)=u(1,j) v(i,N)=v(i,1) 

February 27, 2016, 06:32 

#10 
Senior Member

I might have seriously overlooked at the matter (i only did staggered grid once, around 10 years ago, and without periodicity). Actually, what i suggested works properly for colocated finite difference schemes.
Now i took my old program and put the variables down, and it is more clear to me. When you go to staggered you need to do different things for different variables/direction. In practice the grid has to be considered a la finite volume, which means you have: 1) Nx x Ny cell centers, where pressure is stored 2) (Nx+1) x Ny xnormal faces where Ux velocity is stored 3) Nx x (Ny+1) ynormal faces where Uy velocity is stored Thus, what to do? For the pressure, you strictly work a la finite volume: 0x = Nx 0y = Ny Nx+1 = 1x Ny+1 = 1y For the Ux velocity you work a la finite volume along y, but finite difference along x: 0x = Nx1 Nx+1 = 2x 0y = Ny Ny+1 = 1y For the Uy velocity it is the converse, finite difference along y and finite volume along x: 0y = Ny1 Ny+1 = 2y 0x = Nx Nx+1 = 1x This implies that your variables are decleared as: P(Nx,Ny), Ux(Nx+1,Ny), Uy (Nx,Ny+1) This should work but, as i said, i never tried. 

June 15, 2021, 09:04 

#11 
New Member
enes senyurt
Join Date: Oct 2015
Posts: 4
Rep Power: 8 
@sbaffini For an arbitrary problem and staggered scheme; lets say we have another variable (e.g shear stress component) grid Sxy (Nx+1) x (Ny+1) what has to be done?


June 15, 2021, 09:05 

#12  
New Member
enes senyurt
Join Date: Oct 2015
Posts: 4
Rep Power: 8 
For an arbitrary problem and staggered scheme; lets say we have another variable (e.g shear stress component) grid Sxy (Nx+1) x (Ny+1) what has to be done?
Quote:


June 15, 2021, 10:45 

#13 
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 5,905
Rep Power: 63 

June 15, 2021, 10:48 

#14 
Senior Member


June 15, 2021, 11:00 

#15 
New Member
enes senyurt
Join Date: Oct 2015
Posts: 4
Rep Power: 8 
I have a scheme as in the picture for an FDTD simulation. I want to use periodic BC in left and right, for velocity components I do the same procedure but I dont know what to do for Sxy to make periodicity. Without periodicity I am making stress mirroring and the become zero in boundary.


June 15, 2021, 11:03 

#16 
New Member
enes senyurt
Join Date: Oct 2015
Posts: 4
Rep Power: 8 

June 15, 2021, 11:04 

#17 
Senior Member

Very generally speaking, for periodicity (but applies to the distributed parallel case as well) one should only exchange the independent variables (say, velocity) and compute everything in place. So, as mentioned by Filippo, the stress should be recomputed once you have the correct velocity in the periodic nodes.
EDIT: ok, this doesn't sound really correct in general, but for staggered grids might be your best option 

Tags 
boundary, boundary condition, navier stoke solver, periodic bc, solver 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
sliding mesh problem in CFX  Saima  CFX  46  September 11, 2021 08:38 
Centrifugal fan  j0hnny  CFX  13  October 1, 2019 14:55 
Radiation interface  hinca  CFX  15  January 26, 2014 18:11 
Error finding variable "THERMX"  sunilpatil  CFX  8  April 26, 2013 08:00 
Convective Heat Transfer  Heat Exchanger  Mark  CFX  6  November 15, 2004 16:55 