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

Periodic boundary condition for compressible flow

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 1 Post By FMDenaro
  • 2 Post By vesp
  • 2 Post By sbaffini
  • 2 Post By sbaffini
  • 1 Post By FMDenaro
  • 1 Post By sbaffini

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 2, 2020, 08:34
Default Periodic boundary condition for compressible flow
  #1
New Member
 
Abolfazl
Join Date: Oct 2016
Posts: 28
Rep Power: 9
Abolfazl_cfd is on a distinguished road
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
Abolfazl_cfd is offline   Reply With Quote

Old   May 2, 2020, 10:47
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,771
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Abolfazl_cfd View Post
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





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.
Abolfazl_cfd likes this.
FMDenaro is offline   Reply With Quote

Old   May 2, 2020, 12:06
Default
  #3
New Member
 
Abolfazl
Join Date: Oct 2016
Posts: 28
Rep Power: 9
Abolfazl_cfd is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
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.
Dear Filippo Maria Denaro

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)
Abolfazl_cfd is offline   Reply With Quote

Old   May 2, 2020, 12:25
Default
  #4
Member
 
Join Date: Aug 2018
Posts: 77
Rep Power: 7
vesp is on a distinguished road
is the channel driven by a source term? if not, it is normal for the flow to slow down.
FMDenaro and Abolfazl_cfd like this.
vesp is offline   Reply With Quote

Old   May 2, 2020, 13:22
Default
  #5
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
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
FMDenaro and Abolfazl_cfd like this.
sbaffini is offline   Reply With Quote

Old   May 2, 2020, 13:47
Default
  #6
New Member
 
Abolfazl
Join Date: Oct 2016
Posts: 28
Rep Power: 9
Abolfazl_cfd is on a distinguished road
Quote:
Originally Posted by vesp View Post
is the channel driven by a source term? if not, it is normal for the flow to slow down.
No, there is no source term!
So, How am I supposed to simulate a periodic flow without a source term!?
Abolfazl_cfd is offline   Reply With Quote

Old   May 2, 2020, 13:52
Default
  #7
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by Abolfazl_cfd View Post
No, there is no source term!
So, How am I supposed to simulate a periodic flow without a source term!?
You can't. Read the papers I linked for the proper implementation in the general compressible case.
FMDenaro and Abolfazl_cfd like this.
sbaffini is offline   Reply With Quote

Old   May 2, 2020, 13:58
Default
  #8
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,771
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Abolfazl_cfd View Post
No, there is no source term!
So, How am I supposed to simulate a periodic flow without a source term!?



For the compressible flow model you need a driving term both in the momentum and in the enthalpy equation.
Abolfazl_cfd likes this.
FMDenaro is offline   Reply With Quote

Old   May 2, 2020, 15:19
Default
  #9
New Member
 
Abolfazl
Join Date: Oct 2016
Posts: 28
Rep Power: 9
Abolfazl_cfd is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
You can't. Read the papers I linked for the proper implementation in the general compressible case.
Dear Paolo Lampitella
Thanks a lot.

I checked the first paper, which you sent its link.
Based on this paper, the source term is calculated based on the wall friction force. But I don't get it why the formula is like this!!!

\frac{d\bar{P_0}}{dx}=-\frac{\tau_w}{h}=-\frac{1}{h}\mu_w\frac{\partial\widetilde{u}}{\partial y}

why the friction tension is devided by h(2*h is the height of the channel)!?
And how should I add this term to my equations!? should I just calculate this source term just for the wall boundary cells?

By the way, the second link you have provided is not reachable, would you mind please send me the name of the paper.

Thanks a lot.
Abolfazl_cfd is offline   Reply With Quote

Old   May 2, 2020, 16:00
Default
  #10
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
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
Abolfazl_cfd likes 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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 07:38
Wind turbine simulation Saturn CFX 58 July 3, 2020 01:13
Constant mass flow rate boundary condition sahm OpenFOAM 0 June 20, 2018 22:45
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 08:44
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 06:20


All times are GMT -4. The time now is 21:40.