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?

  • $\begingroup$ 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. $\endgroup$ – nicoguaro Feb 22 '16 at 4:27
  • $\begingroup$ What I mean to say is, is the way that I am writing (implementing) the periodic BC in my code is correct? $\endgroup$ – Tanmay Agrawal Feb 22 '16 at 4:30
  • $\begingroup$ I think that is the way to implement PBCs for that kind of grid. $\endgroup$ – nicoguaro Feb 22 '16 at 4:31
  • $\begingroup$ 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. $\endgroup$ – decltype_usr Jan 24 '17 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.