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

Validation for a channel flow code

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 20, 2015, 16:09
Default Validation for a channel flow code
  #1
New Member
 
Join Date: Dec 2015
Posts: 5
Rep Power: 11
jinhua2015 is on a distinguished road
Hi all,

I'm new to the forum. It's a really nice place to discuss fluid mechanics.

I recently got a pseudo-spectral code (Fourier*Chebyshev*Fourier for the spatial discretization) for simulating a turbulence channel flow. But the code is old and I was told not to take it for granted. So I would like to validate the code first to see if it can run correctly.

In this regard, I would like to ask

(1) how to generate a consistent and proper initial condition (ic) field for the turbulence channel flow? The ic should satisfy the nonslip boundary conditions for the velocities and the divergence-free condition at the same time.

(2) what is a simple way to check the code? Is there any analytical solution in the channel flow setting to NS equation? I guess probably not. From the reference, I see that people usually check the mean velocity profile around the wall, i.e., the law of the wall. But that will be in a too late stage, I mean, I should take the statistics of the generated flow data to check the law of the wall. Is there any simpler and easier to check the code?

Thanks a lot for your suggestions. Any comments will be appreciated.

jinhua
jinhua2015 is offline   Reply With Quote

Old   December 20, 2015, 17:26
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by jinhua2015 View Post
Hi all,

I'm new to the forum. It's a really nice place to discuss fluid mechanics.

I recently got a pseudo-spectral code (Fourier*Chebyshev*Fourier for the spatial discretization) for simulating a turbulence channel flow. But the code is old and I was told not to take it for granted. So I would like to validate the code first to see if it can run correctly.

In this regard, I would like to ask

(1) how to generate a consistent and proper initial condition (ic) field for the turbulence channel flow? The ic should satisfy the nonslip boundary conditions for the velocities and the divergence-free condition at the same time.

(2) what is a simple way to check the code? Is there any analytical solution in the channel flow setting to NS equation? I guess probably not. From the reference, I see that people usually check the mean velocity profile around the wall, i.e., the law of the wall. But that will be in a too late stage, I mean, I should take the statistics of the generated flow data to check the law of the wall. Is there any simpler and easier to check the code?

Thanks a lot for your suggestions. Any comments will be appreciated.

jinhua

Hi,
I suggest to test the code first for the laminar steady Poiseuille solution... I suppose you have periodic condition in streamwise and spanwise condition, so you could check for the 4 combinations of pressure gradient. An initial condition could be simply the plug flow.

Then, if you want to use the code for turbulent conditions you should distinguish between DNS and LES formulations that drive to different grid resolution. The initial condition cna be generated from the Poiseuille solution with a superimposed fluctuations. However, you need to run the code until the solution loose memory of the initial condition.
Many database for DNS are available, for example here

http://turbulence.ices.utexas.edu/MKM_1999.html
FMDenaro is offline   Reply With Quote

Old   December 26, 2015, 09:51
Default
  #3
New Member
 
Join Date: Dec 2015
Posts: 5
Rep Power: 11
jinhua2015 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Hi,
I suggest to test the code first for the laminar steady Poiseuille solution... I suppose you have periodic condition in streamwise and spanwise condition, so you could check for the 4 combinations of pressure gradient. An initial condition could be simply the plug flow.

Then, if you want to use the code for turbulent conditions you should distinguish between DNS and LES formulations that drive to different grid resolution. The initial condition cna be generated from the Poiseuille solution with a superimposed fluctuations. However, you need to run the code until the solution loose memory of the initial condition.
Many database for DNS are available, for example here

http://turbulence.ices.utexas.edu/MKM_1999.html
Thanks. I'm currently reading and trying to understand the code. I will report the questions I may have later. Thanks again.
jinhua2015 is offline   Reply With Quote

Old   December 30, 2015, 11:49
Default
  #4
New Member
 
Join Date: Dec 2015
Posts: 5
Rep Power: 11
jinhua2015 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Hi,
I suggest to test the code first for the laminar steady Poiseuille solution... I suppose you have periodic condition in streamwise and spanwise condition, so you could check for the 4 combinations of pressure gradient. An initial condition could be simply the plug flow.

Then, if you want to use the code for turbulent conditions you should distinguish between DNS and LES formulations that drive to different grid resolution. The initial condition cna be generated from the Poiseuille solution with a superimposed fluctuations. However, you need to run the code until the solution loose memory of the initial condition.
Many database for DNS are available, for example here

http://turbulence.ices.utexas.edu/MKM_1999.html
Hi,

I take your suggestion to run the code with steady Poiseuille flow (initial condition is u=1-y^2 without background turbulence and the flow is driven by a constant streamwise pressure gradient -2/Re, solved from the steady NS equation). Now even for this simple setting, I have some problems. I expect that the flow would remain the same before the numerical error takes over, but it's very soon that I spot the trend of the flow filed is going to blow up. The maximum velocity keeps increasing. I plot the flow field, it seems that there are check-board errors (for example, I plot the u at the boundary y=1, the velocity there should be zero, but when I run for less than 1 time unit, the error shows a check-board pattern.). I know that this could be avoided in the finite difference scheme by using staggered grid, but the code I have do not solve pressure explicitly (see Kim, Moin Moser 1987). Do you know what may be the cause of this error in spectral method?

The code was using FFTPACK for the FFT. I actually have also tried FFTW as I suspect that FFTPACK might be worse in the performance, but this error is still there....

Thanks for any comments.

Jinhua
Attached Images
File Type: png untitled.png (25.0 KB, 16 views)
jinhua2015 is offline   Reply With Quote

Old   December 30, 2015, 14:10
Default
  #5
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
first, your plot show a vanishing velocity u ! You can see oscillations but their magnitude order is 10^-13 ....

second, have you set Re=1? the height of the channel is 1 in non dimensional unit?

third, do you run the code within the numerical stabilty constraints? you should get a steady solution (check the magnitude of max time derivative)
FMDenaro is offline   Reply With Quote

Old   December 31, 2015, 06:11
Default
  #6
New Member
 
Join Date: Dec 2015
Posts: 5
Rep Power: 11
jinhua2015 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
first, your plot show a vanishing velocity u ! You can see oscillations but their magnitude order is 10^-13 ....

second, have you set Re=1? the height of the channel is 1 in non dimensional unit?

third, do you run the code within the numerical stabilty constraints? you should get a steady solution (check the magnitude of max time derivative)
Hi FMDenaro,

Thanks for your reply. At the initial time, the velocity amplitude at the boundary (y=1) is indeed zero, but then it increases slowly to 10^-13. If I run for a longer time, the flow field will blow up.

The nondimensional length is the half channel flow, so yes, y=1 is the boundary of the channel.

I constrain the CFL number.

I tried this morning, and I did get a steady solution. I will run for a real flow with some turbulence. Hope it will get right. Thanks a lot. Have a nice day.

Jinhua
jinhua2015 is offline   Reply With Quote

Old   December 31, 2015, 06:18
Default
  #7
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by jinhua2015 View Post
Hi FMDenaro,

Thanks for your reply. At the initial time, the velocity amplitude at the boundary (y=1) is indeed zero, but then it increases slowly to 10^-13. If I run for a longer time, the flow field will blow up.

The nondimensional length is the half channel flow, so yes, y=1 is the boundary of the channel.

I constrain the CFL number.

I tried this morning, and I did get a steady solution. I will run for a real flow with some turbulence. Hope it will get right. Thanks a lot. Have a nice day.

Jinhua

however, the velocity at the walls must be prescribed, not computed...so, see the part in your code that fix the BC.s.

what about the steady solution you get?
FMDenaro is offline   Reply With Quote

Old   December 31, 2015, 13:03
Default
  #8
Member
 
Kaya Onur Dag
Join Date: Apr 2013
Posts: 94
Rep Power: 13
kaya is on a distinguished road
Quote:
Originally Posted by jinhua2015 View Post
Hi FMDenaro,

Thanks for your reply. At the initial time, the velocity amplitude at the boundary (y=1) is indeed zero, but then it increases slowly to 10^-13. If I run for a longer time, the flow field will blow up.

The nondimensional length is the half channel flow, so yes, y=1 is the boundary of the channel.

I constrain the CFL number.

I tried this morning, and I did get a steady solution. I will run for a real flow with some turbulence. Hope it will get right. Thanks a lot. Have a nice day.

Jinhua
which time scheme do you have?

do you do dealiasing? actually with such a low re it shouldn't be a problem

you can save your velocity field and take the spatial spectrum in each time snapshot and see how it changes before your code blows. than can enlighten a bit
kaya 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
rhoCentralFoam for channel flow fportela OpenFOAM Running, Solving & CFD 22 June 10, 2014 21:14
Gravitational water flow in closed channel. Szymon85 CFX 7 September 3, 2013 17:28
is there any parallel code for the famous Lid Driven Cavity flow? gholamghar Main CFD Forum 0 August 1, 2010 02:55
Wrong Pressure countors for channel flow driven by mass flow rate or press gradient ash-khan FLUENT 0 June 21, 2009 11:02
channel flow.. R.D.Prabhu Main CFD Forum 0 July 14, 1998 01:22


All times are GMT -4. The time now is 16:13.