Periodic boundary condition for compressible flow
Hi everybody.
I have already validated my code with compressible flow in a channel with normal boundary condition. But as I tried to model a periodic boundary condition, I'm getting strange results. The more the code proceeds in time, the more velocity in the center line of the channel decreases. Is it normal?? In my code, there are two columns of ghost cells (two columns at entry on channel and two columns at exit). Here is a the part of code for periodic boundary condition. I would be so grateful, if you would could help me. Thank you all. i=-1 do j=-1,jm+2 ! p (i,j) =p(im-1,j) t (i,j) =t(im-1,j) rho(i,j) =rho(im-1,j) u (i,j) =u(im-1,j) v (i,j) =v(im-1,j) ! end do ! i=0 do j=-1,jm+2 ! p (i,j) =p(im,j) t (i,j) =t(im,j) rho(i,j) =rho(im,j) u (i,j) =u(im,j) v (i,j) =v(im,j) ! end do ! i=im+1 do j=-1,jm+2 ! p (i,j) =p(1,j) t (i,j) =t(1,j) rho(i,j) =rho(1,j) u (i,j) =u(1,j) v (i,j) =v(1,j) ! end do ! i=im+2 do j=-1,jm+2 ! p (i,j) =p(2,j) t (i,j) =t(2,j) rho(i,j) =rho(2,j) u (i,j) =u(2,j) v (i,j) =v(2,j) ! end do |
Quote:
Without the details of your periodicity lenghts and used indez is difficult to say something. I give you a 1D example, the lenght L is discretized by N steps h, so that you have that value at node 1 = value at node N+1. Now you have to solve the equation either in node 1 or in node N+1 and then use the periodicity condition. |
Quote:
Thank you for your kind reply. At first I calculate the variables inside the domain (using Roe scheme) and then I exchange the variables values between inner cells and ghost cells (as shown in code) |
is the channel driven by a source term? if not, it is normal for the flow to slow down.
|
Also, watch out that you need a proper treatment for the energy equation as well
https://www.researchgate.net/publica..._bounded_flows https://onlinelibrary.wiley.com/doi/...32:43.0.CO;2-6 People working on Nek5000 also have worked on something similar for more general cases of incompressible flows |
Quote:
So, How am I supposed to simulate a periodic flow without a source term!? |
Quote:
|
Quote:
For the compressible flow model you need a driving term both in the momentum and in the enthalpy equation. |
My bad
https://www.google.com/url?sa=t&sour...fZDw54aheTLo_m I can't help now because I'm from the cell phone but you can also check my phd thesis (on google scholar), where I make the derivation for the channel and for general pipe flows... yet, it is for the incompressible case. Basically it is an equilibrium condition for the axial momentum. For the incompressible case, If you don't have turbulence, the source term is actually in the analytical solution itself for channels and pipes You need to add the source term to all the cells |
All times are GMT -4. The time now is 20:54. |