CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   DNS with openfoam (https://www.cfd-online.com/Forums/openfoam-solving/58479-dns-openfoam.html)

harishg October 7, 2008 15:28

Has anyone been able to succes
 
Has anyone been able to successfully match the DNS results (especially Reynolds stresses) of Moser, Kim and Mansour at higher friction Re (395, 590) for channel flow? Is the numerical error of the cubic discretization available for the convection term comparable to spectral methods and high-order compact schemes, commonly employed for DNS computations ?

Thanks,
Harish

cedric_duprat October 8, 2008 03:45

Hi harish, I did some stuff
 
Hi harish,

I did some stuff on that point.
you can have a look there : http://www.cfd-online.com/OpenFOAM_D...es/1/8544.html
If you have more questions, don't hesitate but ask them in the previous thread, to keep channel flow questions together :-)

Regards,

Cedric

kumar October 8, 2008 04:29

Hello Everybody My name is Su
 
Hello Everybody
My name is Suresh kumar, i am a P.hd student and i have started my study a month back at the University of Luxembourg. I have decided to use OpenFOAM for peforming some Multiphase calculations of a jet.
Since i have just installed OpenFOAM on my personal machine which is UBUNTU 8.04. I am facing some problems in installing the software.
I am posting the message that i get after i run the script OpenFOAM installation test, please give me some suggestions on resolving it


Checking basic setup...
-------------------------------------------------------------------------------
Shell: bash
Host: lareole
OS: Linux version 2.6.24-19-generic
-------------------------------------------------------------------------------


Checking main OpenFOAM env variables...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory Valid Crit
-------------------------------------------------------------------------------
$WM_PROJECT_INST_DIR /home/kumar/OpenFOAM yes yes
$WM_PROJECT_USER_DIR /home/kumar/OpenFOAM/kumar-1.5 yes no
$WM_THIRD_PARTY_DIR /home/kumar/OpenFOAM/ThirdParty yes yes
-------------------------------------------------------------------------------


Checking the OpenFOAM env variables set on the PATH...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory Valid Path Crit
-------------------------------------------------------------------------------
$WM_PROJECT_DIR /home/kumar/OpenFOAM/OpenFOAM-1.5 yes yes yes

$FOAM_APPBIN ...M-1.5/applications/bin/linuxGccDPOpt yes yes yes
$FOAM_USER_APPBIN ...r-1.5/applications/bin/linuxGccDPOpt yes yes no
$WM_DIR /home/kumar/OpenFOAM/OpenFOAM-1.5/wmake yes yes yes
-------------------------------------------------------------------------------


Checking the OpenFOAM env variables set on the LD_LIBRARY_PATH...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory Valid Path Crit
-------------------------------------------------------------------------------
$FOAM_LIBBIN ...nFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt yes yes yes
$FOAM_USER_LIBBIN ...OpenFOAM/kumar-1.5/lib/linuxGccDPOpt yes yes no
$MPI_ARCH_PATH ...penmpi-1.2.6/platforms/linuxGccDPOpt yes yes yes
-------------------------------------------------------------------------------


Third party software
-------------------------------------------------------------------------------
Software Version Location
-------------------------------------------------------------------------------
WARNING: gcc version does not match gcc supplied with this release of OpenFOAM
Supplied version: 4.3.1
User version : 4.2.3
Minimum required: 4.2.0

gcc 4.2.3
WARNING: Conflicting installations:
OpenFOAM settings : /bin/gcc
current path : /usr/bin/gcc
CRITICAL ERROR

gzip 1.3.12 /bin/gzip
tar 1.19 /bin/tar
icoFoam
WARNING: Conflicting installations:
OpenFOAM settings : /home/kumar/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/icoFoam
current path :
CRITICAL ERROR

-------------------------------------------------------------------------------


Checking networking...
-------------------------------------------------------------------------------
Action Result Crit
-------------------------------------------------------------------------------
Pinging_lareole Successful yes
Pinging_localHost Successful yes
Test_rsh: Unsuccessful_connection_refused* yes
Test_ssh: Unsuccessful_connection_refused* yes
FATAL ERROR: No remote shell available.
OpenFOAM 1.5 enviroment requires either ssh and/or rsh.
Contact your system administrator.


-------------------------------------------------------------------------------

The system test has evoked 1 fatal error(s).

The foam installation contains 2 critical error(s).

Review the output for warning messages and consult
the installation guide for trouble shooting.

done.
if anybody could give me some suggestions it would be good. To be noted i have changed the settings of the compiler to SYSTEM in the file settings.sh.
bye

gschaider October 8, 2008 06:38

Hi Suresh! At first: How is
 
Hi Suresh!

At first: How is your question related to this thread? (see nr.5 on http://openfoamwiki.net/index.php/Ho..._Message_Board)

At your question: try running some tutorials. If they work, then the script is oversensitive.
@the remote shell: you won't need that unless you are doing parallel calculations

Bernhard

johndeas October 10, 2008 08:03

Hi Harish, I would like to
 
Hi Harish,

I would like to discuss with you about DNS in OpenFOAM, but your email is not available. Could you contact me at john.deas@gmail.com ?

If anybody is interested by a direct contact on DNS to discuss the matter and to work out solutions together, do not hesitate.

JD

alberto October 10, 2008 22:11

This should be an open communi
 
This should be an open community using an open platform for CFD, so, if there are no reasons to keep the discussion private as it seems, why don't making it here? Maybe readers and new users can benefit of that in the future!

Regards,
Alberto

zebu83 September 3, 2009 10:01

I have some question about channel DNS simulation with OpenFOAM.

I found in another thread [http://www.cfd-online.com/Forums/ope...flow-dns.html] channelDNS program (that Alberto post long time ago), I compiled it and it work perfectly!
Then I created a new directory (channelDNS) and in this directory I run my simulation of a channel with this parameter:
L*H*W: 3.5*2*1
nx*ny*nz: 80*130*60
nu=4*10-5 (to have a Re_tau=180 more or less)

I use:
Quote:

ddtSchemes
{
default CrankNicholson 0.5;
}

gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}

divSchemes
{
default none;
div(phi,U) Gauss cubic;
}

laplacianSchemes
{
default none;
laplacian(nu,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
}

interpolationSchemes
{
default linear;
interpolate(U) linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p;
}
that is like fvSchemes of boxTurb tutorial, except of temporal schemes (CrankNicholson 0.5 instead of euler).

When I visualized the results I notice that in the middle of the channel there are some strange bubble, but they don't come from the wall streaks!

This cause a bed Umean and u_rms profile.

Where/what are the errors?
Probably interpolation schemes or resolution?

Thank you very much in advance.

Best regard
MT

feijooos November 13, 2009 22:13

Marco,

you mentioned that you used the channelDNS code and that it compiled, correct? I just downloaded this code from the forum, but I have some trouble compiling it. Would you mind sharing how you got it to work? I am using OF 1.5

Thanks,

Eelco

zebu83 November 14, 2009 17:15

Good night Eelco,

what are your trouble? Can you give me more informations?

I am using OF 1.5.x, that has some corrections from 1.5 version. To download and install OF 1.5.x there are many posts that explain it.

You must read also all posts of the discussion that i quote before, there some interesting things.
Remember: channelDNS was written for OF 1.4 or 1.3 I don't remember, so some header file are now different. For example, in OF 1.5 there is a function that calculate the field average, so you don't need "createAverage.C".

I hope this instructions are useful for you.

MT

feijooos November 15, 2009 12:36

Hey Marco,

Yeah, I realize that it is not necessary to compile the createAverages.C and calculateAverages.C files, because those already get calculated in the 1.5 version. Alberto told me, that in 1.5 I can just select a 'laminar' model instead of LES and that will take care of it.

Btw, how are your comparisons against the DNS results from Kim (1987)?

Thanks,

Eelco

zebu83 November 15, 2009 13:27

Very bad!

Not really very bad, but there is a little problem with "postChannel" utility: it makes a wrong statistic.
I notice that, if you want to calculate "urms" or "vrms" etc., postChannel uses first time average, then field average. I don't know if I explain it well...
I can't use it, postChannel, if I want correct statistics because the first fields are not good for statistics, I must use only stationary fields! You can see it if you look, for example, at Retau, if it is more or less constant it's ok, instead you must wait!

If it is not right, please correct me!
I loose some day for this things.

Then when I finish my simulation I would write a post about this.

Best regards

MT

feijooos November 15, 2009 13:48

Marco,

What was your resolution for these calculations?
I am using a domain size of: 2pi x 1 x pi, with 196*129*160 points.

Thanks,

Eelco

zebu83 November 15, 2009 14:11

I modify "channelOodles" tutorial like this: 3.5 x 2 x 2 with 80*180*120, and I have Retau = 180 (more or less).
Your resolution is better then my resolution, but what about your Retau?

Are your results good? Is it like Moser or Marusic DNS?

The most evident difference are urms, my urms are 2.5 instead 2.8! But other quantities are not so bad. I thik that my channel is too small, and also finite volume are less conservative than spectral method, for example.

What do you thik about this?
I am interesting on it.
What I want to do it's a good channel DNS, but it is not so simple that I thought!!!

Bye

MT

feijooos November 15, 2009 19:31

My cases are still running. They should be done, I'll let you know what I get.

I was playing around with the postChannel utility, but it doesn't do anything. It doesn't write out anything for me. I checked it out in the utilities folder and it seems like everything is commented out. Have you checked this with 1.5?

Thanks, Eelco

feijooos November 15, 2009 19:47

hmm I think I understand what is happening with postChannel. I see what you mean by using the first directory.

How do you calculate Retau, with utau equal to sqrt(gradP*delta/rho)?

Thanks, Eelco

zebu83 November 16, 2009 06:27

I don't have my data, because I'm not in my office these day, but when I come back I'll post some result to explain better what I mean.

You can use "gradP" to calculate Retau, but only if you reach the stability. Instead you can calculate it by dU/dy (= wall grad U). There some utilities in OF for it, but I calculate it writing a little program myself.

I'll post all, when I come back in the office (tomorrow).

Have a nice day!

feijooos November 16, 2009 15:23

Thanks Marco, I'll try to get my things put some things together as well.

Eelco

zebu83 November 18, 2009 05:01

Good morning Eelco.

I'm going to post some result, but first let specify something:
- if you want to calculate Retau with gradP, you have to do that: sqrt(gradP)*delta/ni, not
Quote:

sqrt(gradP*delta/rho)
. Because if you are in stationary condition you know that tau_wall = gradP, u_tau = sqrt(tau_wall/ro) [friction velocity] {pay attention here, OF gives you a gradP normalized with ro, so to calculate the friction velocity you don't have to divide by ro!}, then Retau = u_tau*delta/ni.
- if you use wall grad U (= dU/dy_wall) you can calculate Retau in any condition, because, as S. B. Pope [Turbulent flows, Cornell University, Cambridge, 2000] say, total stress tau = viscous stress - Reynolds stress: tau = ro*ni*dU/dy - ro*u'v'. Near the wall the Reynolds stress are zero, so you know that tau_wall = ro*ni*dU/dy_wall. You have only to calculate dU/dy_wall, for example (if you don't use OF post processing) with central differing (of course you must calculate yourself, using U field that OF saved at each time step).


These are two way to calculate Retau, of course the second it's always correct.

I'm going to post some pictures:

http://www.cfd-online.com/Forums/mem...-umean-log.jpg
This is Umean log profile. You can notice that in the "log region" 30<y+<110 it don't reach the log law or not so much.

http://www.cfd-online.com/Forums/mem...tal-stress.jpg
This is the stress picture: viscous stress, Reynolds stress and total stress. As you can notice, the result is not the straight line pass through y=-1.

http://www.cfd-online.com/Forums/mem...uation-rms.jpg
These are the rms, as I say in a previous post, they are underestimated (if you look for example at the Moser or Marusic papers).

http://www.cfd-online.com/Forums/mem...structures.jpg
Turbulent structures.

As you can see from the pictures the result are quite good, but not at all! This is because I use "postChannel" in this case.
The flux is totally turbulent, as you can see from the last picture, and it also reach the stability, but when I try to calculate statistics postChannel uses all the data, because it makes first time average, then spatial average.
The correct way to do it is to calculate first spatial average at every field itself, then make the time average from the every spatial average. If you do like that you receive better results, but in my case I have a too small channel and my "rms" are not so good. It is due also to finite volume method, because it introduces a numerical diffusivity.

I hope it's all clear.

Ask me if you don't understand and, please, correct me if I am wrong.

Best regard

MT

feijooos November 18, 2009 11:09

Hey Marco,

Thanks for your post, this is really helpful. I can see what you mean, you are capturing the overall structures, but not the exact values. I agree that some of this is caused by numerical diffusion, not using a much more accurate spectral method.

I am currently running some cases with different mesh sizes. I will try to post-process these in the next few days. I will post my results with some images after I'm done with this.

Thanks for your help! Eelco

zebu83 November 18, 2009 16:05

It's going to be very useful if you will be able to post some of your result!

Best regards

MT

feijooos November 18, 2009 16:07

Marco, one of my cases has 4 million mesh point. This one is going to take another 2 days. But I should have some results up from some other cases soon.

btw, just to be sure....what are your values for Ubar and nu?

Thanks, Eelco

zebu83 November 18, 2009 16:25

My Ubar is the same of "channelOodles" tutorial: Ubar = 0.1335, but I modify nu, I chose nu = 2*10^-5 to have Retau more or less = 180.

The previous pictures are adimensionalized with Retau or Utau, etc. so the results are generic.

Best regards

MT

zebu83 November 19, 2009 09:31

Sorry, Eelco, could you post the set of your test case?

In my simulation I use:
dimension (x*y*z): 3.5*2*2
number of cells (nz*ny*nz): 80*180*120

that means, for Retau = 200 (I use Ubar=0.1335, nu=2*10^-5), these adimensional units (x+, y+, z+): 8.75, *, 3.33 [*: means that I have a simple grading in y direction that is 10, so the dimension of the cell in the middle of the channel is 10 time the dimension of the boundary cell, so the range of y+={0.44 - 4.44} more or less].

If I well understand the set of your test case, your situation is more or less this:
dimension (x*y*z): 2pi*1*pi
number of cell (nz*ny*nz): 196*129*160

and if you have a Retau = 400 (that is more or less the same of channelOodles tutorial), you have these adimensional units (x+, y+, z+): 12.81, ?, 7.85 (?: means that I don't know if you put some grading).

I can't use more cell because I have not more computational resource.

bye

MT

feijooos November 19, 2009 11:00

Marco, one of my cases just finished. They are taking longer than I thought. I checked my Retau and it is around 195, a little too high. I want to compare against the paper from Kim (1987) and he uses Retau equal to 180. I have to do some postprocessing now to see how it turned out. I will let you know.

feijooos November 19, 2009 11:12

Marco,

I have the velocity profile, u+ vs. y+ and the results are not good. I think I am missing something..... This profile is not with the fine mesh yet, this is with 96x129x80.

http://www.feijo.nl/untitled.jpg

aldo.iannetti January 20, 2011 18:42

DNS and 1D spectra
 
1 Attachment(s)
Hi All,
Here attached a 1D assial spectra coming from a DNS symulation of a pipe using OF 1.6. Focus your attention on the higher wavenumbers. Is there anyone who knows the meaning of that strange behaviour?
It seems there are some components caracterized by the high wavenumber that do not dissipate.
Please post whatever you think in order to let the investigations go on.

Let me know if something else is needed to understand

stevenvanharen January 27, 2011 09:53

Hi Aldo,

Is this spectrum in space or time?

And what discretization do u use for the convective term?

Regards,

Steven

aldo.iannetti January 27, 2011 15:21

Hi,
It is in space, I used the Gauss linear that I hope corresponds to the CDS schemes, here attached the fvSchemes dict.
Thanks
Aldo



Quote:

Originally Posted by stevenvanharen (Post 292477)
Hi Aldo,

Is this spectrum in space or time?

And what discretization do u use for the convective term?

Regards,

Steven


stevenvanharen January 27, 2011 15:31

ok,

Did you use nyquist's criterion to determine the highest wavelength that you can represent on your mesh? How many cells do you have in the direction you took the spectrum?

If your answer is to the first question is yes and to the second question is at least 200 you can start looking at your schemes.

Do you use a full hex mesh? Do you use stretching? How much? If you use stretching and/or unstructered grids you can try either midPoint CDS or blended.

Steven

aldo.iannetti January 27, 2011 15:41

Yes, 300, full hex unstructured,
how to modify the fv schemes (for exemple)?



Quote:

Originally Posted by stevenvanharen (Post 292530)
ok,

Did you use nyquist's criterion to determine the highest wavelength that you can represent on your mesh? How many cells do you have in the direction you took the spectrum?

If your answer is to the first question is yes and to the second question is at least 200 you can start looking at your schemes.

Do you use a full hex mesh? Do you use stretching? How much? If you use stretching and/or unstructered grids you can try either midPoint CDS or blended.

Steven


stevenvanharen January 27, 2011 15:58

Just change:

Code:

div(phi,U)      Gauss linear;
into (for midPoint):

Code:

div(phi,U)      Gauss midPoint;
or (for 5 percent upwind):

Code:

div(phi,U)      Gauss blended 0.95;
midPoint is kinetic energy conservative on meshes with stretched cells, whereas linear is not (leading to instabilities)

blended supresses instabilities by using a small bit of upwind

A question about physics: What is the smallest wavelength you expect based on your Reynold number and Kolmogorov theory? If your Reynolds number is really low there just might be no smaller eddies.

aldo.iannetti January 27, 2011 16:10

Re_tao=200, Re=5500 I think is not due to the cell shape because I see the same behaviour in a similar simulation of a channel with perfect cells.
is midpoint useful for a perfect channel cells? (I've never used it)
Blending with Upwind will introduce diffusivity....
Aldo





Quote:

Originally Posted by stevenvanharen (Post 292537)
Just change:

Code:

div(phi,U)      Gauss linear;
into (for midPoint):

Code:

div(phi,U)      Gauss midPoint;
or (for 5 percent upwind):

Code:

div(phi,U)      Gauss blended 0.95;
midPoint is kinetic energy conservative on meshes with stretched cells, whereas linear is not (leading to instabilities)

blended supresses instabilities by using a small bit of upwind

A question about physics: What is the smallest wavelength you expect based on your Reynold number and Kolmogorov theory? If your Reynolds number is really low there just might be no smaller eddies.


stevenvanharen January 28, 2011 02:48

midPoint will be exactly the same as linear if you use cells without stretching

blended will indeed introduce diffusion

I use sometimes either of these for DNS but that is on unstructured grids
(polyhedral cells).

Based on your Reynolds number you would expect physics at these wavelengths. What I find strange is that you have already dropped 6 orders of magnitude before the strange behavior in the at the high wavelengths start. Imagine where you would end up if the energy would keep dropping after say k = 45?

About your mesh, how did you mesh a pipe with perfect hex cells? And where did you extract the spectrum? In the center of at the wall?

stevenvanharen January 28, 2011 02:56

1 Attachment(s)
This is one of my spectra for a DNS of a channel flow at Re_tau = 180.
Spectra extracted over the plane in the center of the channel.

As you can see my mesh is 128 cells in streamwise direction so I have less information than you. Drop in magnitude almost the same.

LijieNPIC June 8, 2011 03:29

Quote:

Originally Posted by zebu83 (Post 228433)
I have some question about channel DNS simulation with OpenFOAM.

I found in another thread [http://www.cfd-online.com/Forums/ope...flow-dns.html] channelDNS program (that Alberto post long time ago), I compiled it and it work perfectly!
Then I created a new directory (channelDNS) and in this directory I run my simulation of a channel with this parameter:
L*H*W: 3.5*2*1
nx*ny*nz: 80*130*60
nu=4*10-5 (to have a Re_tau=180 more or less)

I use:

that is like fvSchemes of boxTurb tutorial, except of temporal schemes (CrankNicholson 0.5 instead of euler).

When I visualized the results I notice that in the middle of the channel there are some strange bubble, but they don't come from the wall streaks!

This cause a bed Umean and u_rms profile.

Where/what are the errors?
Probably interpolation schemes or resolution?

Thank you very much in advance.

Best regard
MT

Hello, Marco, can you post the channel DNS code in the forum again, I cannot download it. Thank you very much.

ywang September 28, 2011 18:23

Quote:

Originally Posted by LijieNPIC (Post 310997)
Hello, Marco, can you post the channel DNS code in the forum again, I cannot download it. Thank you very much.


It's strange,,,I can download it.

zebu83 September 29, 2011 08:14

Lijie here this is the link to the file that I wrote about:
http://www.cfd-online.com/OpenFOAM_D...S_tar-3861.unk

I'm sorry for the late.

MT

ywang October 6, 2011 18:47

Quote:

Originally Posted by zebu83 (Post 326068)
Lijie here this is the link to the file that I wrote about:
http://www.cfd-online.com/OpenFOAM_D...S_tar-3861.unk

I'm sorry for the late.

MT


Marco, have you ever tried to use some other div schemes?

I am using my own solver in the frame of OpenFOAM. The size of the channel is 4pi*2*(4pi/3), and the mesh is 128*128*128 (uniform in the x and z directions, simpleGrading=10 in the y direction).

My solver will crash when I use linear and midpoint as the div scheme. So, I am using Gamma0.1 and the solver works. Based on Jasak's paper about Gamma scheme, it should be similar with the central(linear) scheme. However, the velocity in the sublayer is smaller than Moser's DNS results. That means more dissipation has been introduced.....

ywang October 6, 2011 21:53

Quote:

Originally Posted by aldo.iannetti (Post 292539)
Re_tao=200, Re=5500 I think is not due to the cell shape because I see the same behaviour in a similar simulation of a channel with perfect cells.
is midpoint useful for a perfect channel cells? (I've never used it)
Blending with Upwind will introduce diffusivity....
Aldo


Steven, I am simulating the turb channel flow with Re_tau=180. I found your master thesis :)

My solver will crash with linear/midpoint.....but works with blended0.995. hope I can get good result with it.

zebu83 October 11, 2011 03:16

Quote:

Originally Posted by ywang (Post 326977)
Marco, have you ever tried to use some other div schemes?

I am using my own solver in the frame of OpenFOAM. The size of the channel is 4pi*2*(4pi/3), and the mesh is 128*128*128 (uniform in the x and z directions, simpleGrading=10 in the y direction).

My solver will crash when I use linear and midpoint as the div scheme. So, I am using Gamma0.1 and the solver works. Based on Jasak's paper about Gamma scheme, it should be similar with the central(linear) scheme. However, the velocity in the sublayer is smaller than Moser's DNS results. That means more dissipation has been introduced.....

Hi Ywang,
my set case was: 3,5h*2h*2h; mesh: 80*180*120 (like you uniform the in x and the z direction, simpleGrading = 10 in the y direction); Re_tau=200 (more or less).

I changed "fvSchemes" like this:
ddtShemes: Euler;
gradSchemes: Gauss linear (for all)
divSchemes: default-none / div(phi,U)-Gauss cubic
laplacianSchemes: default-none / laplacian(nu,U)-Gauss linear corrected / laplacian((1|a(U)),p)-Gauss linear corrected

I hope this is useful.

Marco


All times are GMT -4. The time now is 01:42.