# Periodic boundary conditions for solving Navier Stokes Equations on a Staggered Grid

I want to solve two dimensional Navier Stokes equations on a staggered grid for the case of Taylor-Green Vortex. My initial conditions are standard sine and cosine functions. As I am aware, I 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_\text{vel}(N) = u_\text{vel}(1)\\ u_\text{vel}(0) = u_\text{vel}(N-1)$$

and similarly for $v_\text{vel}$ and pressure variables?

• I think that you have two different questions, one is about the use of periodic BCs in your problem and the other one about how to use them in staggered meshes. That should not depend on the particular problem. – nicoguaro Feb 22 '16 at 4:27
• What I mean to say is, is the way that I am writing (implementing) the periodic BC in my code is correct? – Tanmay Agrawal Feb 22 '16 at 4:30
• I think that is the way to implement PBCs for that kind of grid. – nicoguaro Feb 22 '16 at 4:31
• What king of ordering are you using? In a 2 dimensional case, a lexicographic ordering is used, hence periodic boundary condition does not simply imply the conditions that you have prescribed. Periodic boundary condition just means values on the two boundaries are equal. So find the indices belonging to the boundaries and equate values at those points. – decltype_usr Jan 24 '17 at 9:50