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

Strange DNS results

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 2 Post By morard

Reply
 
LinkBack Thread Tools Display Modes
Old   June 12, 2011, 04:59
Default Strange DNS results
  #1
New Member
 
Join Date: Oct 2010
Posts: 24
Rep Power: 7
LijieNPIC is on a distinguished road
Hi foamers, especially DNSers,

I need your help. I have modified channelFoam to perform DNS of pipe flow. L/D=5, D=0.01m, bulk velocity is 0.53m/s, viscosity is 1e-6, so Re based on D is 5300. The mesh is 4 million, time step is 0.0001. At inlet and outlet boundaries, I set cyclic boundary condition. After 10000 time steps, I sampled the main axial velocity(z direction), very 500 time steps I get 1 sample, so there are 10 samples. I averaged the velocity, and get the following result, seen graph1 attached, the axial velocity seems to oscillate in the radial direction. This behavior will more obvious in instantaneous velocity, seen in graph2. What is more, the inlet instantaneous velocity differs from outlet instantaneous velocity. It is strange, because I applied cyclic bc at the two boundaries. Anyone who has do DNS simulation experience such problem. Please give me your hands, thanks
Attached Images
File Type: jpg Graph1.jpg (67.7 KB, 39 views)
File Type: jpg Graph2.jpg (71.3 KB, 31 views)
LijieNPIC is offline   Reply With Quote

Old   June 13, 2011, 04:08
Default
  #2
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 8
morard is on a distinguished road
Hello,

I have no experience with DNS, but I think that your results are not that strange. Ten samples are not enough. For time averaging use function in controlDict.
In this kind of simulations I always start averaging after about 15 flow-through times.

Regards,
Dejan
morard is offline   Reply With Quote

Old   June 13, 2011, 07:29
Default
  #3
New Member
 
Join Date: Oct 2010
Posts: 24
Rep Power: 7
LijieNPIC is on a distinguished road
Thanks for your reply, Dejan. Today my simulation complete at 59000 time steps. Then I sample the fields again. I sample very 1000 time steps, and get 49 samples. The average axial velocity also seems to oscillate in the radial direction, and the Reynold stress derivate largely from previous results. What is more, my inlet velocity fields are not the same as the outlet velocity
LijieNPIC is offline   Reply With Quote

Old   June 13, 2011, 07:30
Default
  #4
New Member
 
Join Date: Oct 2010
Posts: 24
Rep Power: 7
LijieNPIC is on a distinguished road
Quote:
Originally Posted by morard View Post
Hello,

I have no experience with DNS, but I think that your results are not that strange. Ten samples are not enough. For time averaging use function in controlDict.
In this kind of simulations I always start averaging after about 15 flow-through times.

Regards,
Dejan
How to average use function in controlDict?
LijieNPIC is offline   Reply With Quote

Old   June 13, 2011, 08:04
Default
  #5
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 8
morard is on a distinguished road
Quote:
Originally Posted by LijieNPIC View Post
How to average use function in controlDict?
Just add this function at the end of your controlDict file:

functions
{
fieldAverage1
{
type fieldAverage;
functionObjectLibs ( "libfieldFunctionObjects.so" );
enabled true;
outputControl outputTime;
fields
(
U
{
mean on;
prime2Mean on;
base time;
}

p
{
mean on;
prime2Mean on;
base time;
}
);
}
}

and keep it running for at least 15 flow-through time (time needed for fluid to complete distance from inlet to outlet). Than check your profiles. Maybe you will need 100 time steps, or 1000 (depends on your geometry).
Hope this helps.
morard is offline   Reply With Quote

Old   June 13, 2011, 08:19
Default
  #6
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 8
morard is on a distinguished road
Hi once again,

in channelFoam tutorial you have example of controlDict.
morard is offline   Reply With Quote

Old   June 13, 2011, 09:05
Default
  #7
New Member
 
Join Date: Oct 2010
Posts: 24
Rep Power: 7
LijieNPIC is on a distinguished road
Dejan, I sample after 10000 time steps. So I think my simulation should be fully developed. But the results are bad, especially the u'v' or Urms. Besides, the inlet instantaneous velocity differs from outlet instantaneous velocity
LijieNPIC is offline   Reply With Quote

Old   June 13, 2011, 09:53
Default
  #8
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 8
morard is on a distinguished road
Ok, I see that your flow is fully developed, but you cannot do averaging in time just by sampling 10, or 50 or 100 time steps. Continue with simulation for another 10000 steps, let say from time 1 to time 2 (use function in controlDict I told you - also gives you UPrime2Mean values) and then check your profile. That function does averaging; just imagine that you have sampled 10000 time steps instead of 49! Than, at least your velocity profiles should be ok.

Regarding instantaneous velocities, I have no idea where could be the problem.

How did you calculate Urms values?
morard is offline   Reply With Quote

Old   June 13, 2011, 10:15
Default
  #9
New Member
 
Join Date: Oct 2010
Posts: 24
Rep Power: 7
LijieNPIC is on a distinguished road
Quote:
Originally Posted by morard View Post
Ok, I see that your flow is fully developed, but you cannot do averaging in time just by sampling 10, or 50 or 100 time steps. Continue with simulation for another 10000 steps, let say from time 1 to time 2 (use function in controlDict I told you - also gives you UPrime2Mean values) and then check your profile. That function does averaging; just imagine that you have sampled 10000 time steps instead of 49! Than, at least your velocity profiles should be ok.

Regarding instantaneous velocities, I have no idea where could be the problem.

How did you calculate Urms values?
I am sorry that maybe my expression is not clear. The total time of my simulation is 59000 time steps, and I sample after 10000 time steps. I sample every 1000 steps, so there are 49 samples. Urms=sqrt(sum(U-Uaver)/N)
LijieNPIC is offline   Reply With Quote

Old   June 13, 2011, 12:01
Default
  #10
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 8
morard is on a distinguished road
I understand what have you done. But, you do not have to do that since OpenFOAM provides easy and the right way. It means you do not have to save 49 steps and try to find average value; first: you need a lot of disk space, and second: 49 steps is far from enough in your case - it does not matter if you take every, or every 10000 steps.
Maybe I am not able to explain this clearly. I suggest you to try channelFoam tutorial and to check the output. You will see that mean and rms values are automatically calculated, because functions for that are specified in controlDict.

Btw, did you try on the way I told you?
morard is offline   Reply With Quote

Old   June 13, 2011, 20:41
Default
  #11
New Member
 
Join Date: Oct 2010
Posts: 24
Rep Power: 7
LijieNPIC is on a distinguished road
Quote:
Originally Posted by morard View Post
I understand what have you done. But, you do not have to do that since OpenFOAM provides easy and the right way. It means you do not have to save 49 steps and try to find average value; first: you need a lot of disk space, and second: 49 steps is far from enough in your case - it does not matter if you take every, or every 10000 steps.
Maybe I am not able to explain this clearly. I suggest you to try channelFoam tutorial and to check the output. You will see that mean and rms values are automatically calculated, because functions for that are specified in controlDict.

Btw, did you try on the way I told you?
I will try the way you told me later, and let you know the results
LijieNPIC is offline   Reply With Quote

Old   June 14, 2011, 02:31
Default
  #12
New Member
 
Join Date: Oct 2010
Posts: 24
Rep Power: 7
LijieNPIC is on a distinguished road
Quote:
Originally Posted by morard View Post
Just add this function at the end of your controlDict file:

functions
{
fieldAverage1
{
type fieldAverage;
functionObjectLibs ( "libfieldFunctionObjects.so" );
enabled true;
outputControl outputTime;
fields
(
U
{
mean on;
prime2Mean on;
base time;
}

p
{
mean on;
prime2Mean on;
base time;
}
);
}
}

and keep it running for at least 15 flow-through time (time needed for fluid to complete distance from inlet to outlet). Than check your profiles. Maybe you will need 100 time steps, or 1000 (depends on your geometry).
Hope this helps.
Hi, morard. I have tried the method how to average the filed and get statistics. The averaged field is what I want, but from prime2Mean, I can't get Reynolds stresses or Urms
LijieNPIC is offline   Reply With Quote

Old   June 14, 2011, 03:13
Default
  #13
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 8
morard is on a distinguished road
Hi LijieNPIC,

I'm glad to hear that!
You can extract all components of UPrime2Mean tensor by using foamCalc. If you don't know how to use it, just type the following:

foamCalc components UPrime2Mean

This will extract UPrime2Meanxx UPrime2Meanxy UPrime2Meanxz UPrime2Meanyy UPrime2Meanyz UPrime2Meanzz (u'u' u'v' u'w' v'v' v'w' w'w').
LijieNPIC and Alhasan like this.
morard is offline   Reply With Quote

Old   June 14, 2011, 04:28
Smile
  #14
New Member
 
Join Date: Oct 2010
Posts: 24
Rep Power: 7
LijieNPIC is on a distinguished road
Quote:
Originally Posted by morard View Post
Hi LijieNPIC,

I'm glad to hear that!
You can extract all components of UPrime2Mean tensor by using foamCalc. If you don't know how to use it, just type the following:

foamCalc components UPrime2Mean

This will extract UPrime2Meanxx UPrime2Meanxy UPrime2Meanxz UPrime2Meanyy UPrime2Meanyz UPrime2Meanzz (u'u' u'v' u'w' v'v' v'w' w'w').
Morard, thank you very much. Your suggestion is very helpful to me.
LijieNPIC is offline   Reply With Quote

Old   June 14, 2011, 04:30
Default
  #15
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 8
morard is on a distinguished road
You are welcome
morard is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Results comparison problems ken87 FloEFD, FloWorks & FloTHERM 0 March 15, 2011 04:58
Strange behaviour 1.6 decomposePar vs 1.7 decomposePar BlueyTheDog OpenFOAM 7 January 16, 2011 19:12
validation of CFD results andy FLUENT 0 June 13, 2007 13:55
CFX cylinder or sphere benchmark results Mel CFX 1 August 8, 2005 18:47
benchmark results stefan CD-adapco 3 September 10, 2001 09:48


All times are GMT -4. The time now is 19:08.