CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

white noise in DNS

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 8, 2014, 04:05
Default
  #21
Member
 
Florian Ries
Join Date: Feb 2014
Location: Darmstadt, Germany
Posts: 88
Rep Power: 12
itchy is on a distinguished road
Hi,

some comments to the paper "Q-DNS...":
- a pipe length of L=3.2D is to short. With this you get spatial aliasing!!
- The averaging is not long enough. (random error is not given)
- I cannot find a proper grid independence study in this paper

How to do q-DNS like Ed Komen et al. :
1) Use pimpleFoam.
2) Use fvOptions to set momentumSource (pressureGradientExplicitSource)
3) Grid see paper (but longer domain!!!)
4) boundary conditions:
p:
inlet: cyclic
outlet: cylic
pipewall: zeroGradient

U:
inlet: cyclic
outlet: cylic
pipewall: fixedValue (0 0 0)

5) initial conditions:
- Use boxTurb to generate synthetic turbulent field in a box.
- Use mapfields for mapping to pipegeometry
- Superpose a fully developed turbulent mean velocity profile

6) Time averaging
- Start time averaging when you flow is weakly statistically stationary. e.g. mean velocity and autocorrelation function is invariant under time shift.
- You need a very long time for averaging to reduce random error

7) postProcessing
- Check first if your results make sense in an engineering point of view!
- Use pressure Gradient in log file to calculte utau
- Scale your mean flow quantities with utau
- Compare your results with the results of Ed Komen et. al.

Best regards
Florian
calf.Z likes this.
itchy is offline   Reply With Quote

Old   October 8, 2014, 04:19
Default
  #22
Member
 
Florian Ries
Join Date: Feb 2014
Location: Darmstadt, Germany
Posts: 88
Rep Power: 12
itchy is on a distinguished road
Hi,

you should use pimpleFoam or pisoFoam. In these solvers fvOption is included. In icoFoam it is not. So use pimpleFoam.

If you want to use icoFoam, do it like this:

1) you have to insert at the beginnig of icoFoam.C:
#include "fvIOoptionList.H"

2) This is your new momentum equation:

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
==
fvOptions(U)

);

solve(UEqn == -fvc::grad(p));

fvOptions.correct(U);

3) wmake myicoFoam

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

You can find a examplary fvOptions file at the /tutorials/incompressible/pimpleFoam/system

Best regards
Florian
itchy is offline   Reply With Quote

Old   October 8, 2014, 05:07
Default
  #23
Member
 
Jason Tan
Join Date: Sep 2014
Posts: 47
Rep Power: 11
tzqfly is on a distinguished road
Quote:
Originally Posted by itchy View Post
Hi,

some comments to the paper "Q-DNS...":
- a pipe length of L=3.2D is to short. With this you get spatial aliasing!!
- The averaging is not long enough. (random error is not given)
- I cannot find a proper grid independence study in this paper

How to do q-DNS like Ed Komen et al. :
1) Use pimpleFoam.
2) Use fvOptions to set momentumSource (pressureGradientExplicitSource)
3) Grid see paper (but longer domain!!!)
4) boundary conditions:
p:
inlet: cyclic
outlet: cylic
pipewall: zeroGradient

U:
inlet: cyclic
outlet: cylic
pipewall: fixedValue (0 0 0)

5) initial conditions:
- Use boxTurb to generate synthetic turbulent field in a box.
- Use mapfields for mapping to pipegeometry
- Superpose a fully developed turbulent mean velocity profile

6) Time averaging
- Start time averaging when you flow is weakly statistically stationary. e.g. mean velocity and autocorrelation function is invariant under time shift.
- You need a very long time for averaging to reduce random error

7) postProcessing
- Check first if your results make sense in an engineering point of view!
- Use pressure Gradient in log file to calculte utau
- Scale your mean flow quantities with utau
- Compare your results with the results of Ed Komen et. al.

Best regards
Florian
1) What I do is channel flow rather than pipe flow and the size of channel is 6.4*3.2*2(x,z,y),and the meshes and boundary condition is OK.
2) Now, I use the icoFoam to transform to my solver, I'll check your methods
tzqfly is offline   Reply With Quote

Old   October 8, 2014, 08:28
Default
  #24
Member
 
Jason Tan
Join Date: Sep 2014
Posts: 47
Rep Power: 11
tzqfly is on a distinguished road
Quote:
Originally Posted by itchy View Post
Hi,

you should use pimpleFoam or pisoFoam. In these solvers fvOption is included. In icoFoam it is not. So use pimpleFoam.

If you want to use icoFoam, do it like this:

1) you have to insert at the beginnig of icoFoam.C:
#include "fvIOoptionList.H"

2) This is your new momentum equation:

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
==
fvOptions(U)

);

solve(UEqn == -fvc::grad(p));

fvOptions.correct(U);

3) wmake myicoFoam

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

You can find a examplary fvOptions file at the /tutorials/incompressible/pimpleFoam/system

Best regards
Florian
You sure the examplary fvOptions file in the /tutorials/incompressible/pimpleFoam/system? I cannot find it! my version is 2.1.1
tzqfly is offline   Reply With Quote

Old   October 8, 2014, 08:43
Default
  #25
Member
 
Florian Ries
Join Date: Feb 2014
Location: Darmstadt, Germany
Posts: 88
Rep Power: 12
itchy is on a distinguished road
Hi,

fvOptions is available for the first time in version OF2.2.0
That's the reason you can't find it.

For your case, I would change the version to OF2.3.0 Released.

Is this a possibilty??

Best regards
Florian
itchy is offline   Reply With Quote

Old   October 9, 2014, 00:11
Default
  #26
Member
 
Jason Tan
Join Date: Sep 2014
Posts: 47
Rep Power: 11
tzqfly is on a distinguished road
Quote:
Originally Posted by itchy View Post
Hi,

fvOptions is available for the first time in version OF2.2.0
That's the reason you can't find it.

For your case, I would change the version to OF2.3.0 Released.

Is this a possibilty??

Best regards
Florian
Yes, I found it in the OF2.3.0, I'll try it. However, I got a method yesterday, the details are following:

added some codes in the icoFoam.C file:

the UEqn is like this:

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
==
flowDirection*gradP
);

if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}

And before the runTime.write(), added the following codes:

// Correct driving force for a constant mass flow rate

// Extract the velocity in the flow direction
dimensionedScalar magUbarStar =
(flowDirection & U)().weightedAverage(mesh.V());

// Calculate the pressure gradient increment needed to
// adjust the average flow-rate to the correct value
dimensionedScalar gragPplus =
(magUbar - magUbarStar)/rAU.weightedAverage(mesh.V());

U += flowDirection*rAU*gragPplus;

gradP += gragPplus;

Info<< "Uncorrected Ubar = " << magUbarStar.value() << tab
<< "pressure gradient = " << gradP.value() << endl;


Of course, we have to add a createGradP.H file, it is in the channelFoam. Can you assess it?

best wish!
tzqfly is offline   Reply With Quote

Old   October 9, 2014, 02:25
Default
  #27
Member
 
Jason Tan
Join Date: Sep 2014
Posts: 47
Rep Power: 11
tzqfly is on a distinguished road
Because I use OF2.1.1, when I wmake my solver, the error is there is no fvIOopitionList file or directory.
tzqfly is offline   Reply With Quote

Old   October 9, 2014, 03:18
Default
  #28
Member
 
Florian Ries
Join Date: Feb 2014
Location: Darmstadt, Germany
Posts: 88
Rep Power: 12
itchy is on a distinguished road
Hi,

In my opinion you should change to OF2.3, and use pimpleFoam. Everything is done in OF2.3. Why do it again in an old version??
There will be more and more problems if you use OF2.1.1

Ok. The code

I think the momentum predictor is wrong. There should be some correction term due to the gradientPSource. The rest looks reasonable for me. But it is a very complicated and not applicable way to do this.

kind regards
Florian
itchy is offline   Reply With Quote

Old   October 9, 2014, 03:49
Default
  #29
Member
 
Jason Tan
Join Date: Sep 2014
Posts: 47
Rep Power: 11
tzqfly is on a distinguished road
Quote:
Originally Posted by itchy View Post
Hi,

In my opinion you should change to OF2.3, and use pimpleFoam. Everything is done in OF2.3. Why do it again in an old version??
There will be more and more problems if you use OF2.1.1

Ok. The code

I think the momentum predictor is wrong. There should be some correction term due to the gradientPSource. The rest looks reasonable for me. But it is a very complicated and not applicable way to do this.

kind regards
Florian
OK, Let us put our attention to the white noise. In my opinion, the white noise is exactly a random function,so the codes of dnsFoam is useless, because the codes used Fourier transform, do you have any other method?
tzqfly is offline   Reply With Quote

Old   October 9, 2014, 04:37
Default
  #30
Member
 
Florian Ries
Join Date: Feb 2014
Location: Darmstadt, Germany
Posts: 88
Rep Power: 12
itchy is on a distinguished road
Hi,

in dnsFoam the random noise is wiener process. It is suitable to get turbulence alive. You need this, if you want to simualte DNS for domains without shearing (no wall). This works very well in my opinion. You could insert autocorrelated noise like an arima process, but no need to this. What do you mean with useless??

What do you want to do with the white noise??

kind regards
Florian
itchy is offline   Reply With Quote

Old   October 9, 2014, 04:47
Default
  #31
Member
 
Jason Tan
Join Date: Sep 2014
Posts: 47
Rep Power: 11
tzqfly is on a distinguished road
Quote:
Originally Posted by itchy View Post
Hi,

in dnsFoam the random noise is wiener process. It is suitable to get turbulence alive. You need this, if you want to simualte DNS for domains without shearing (no wall). This works very well in my opinion. You could insert autocorrelated noise like an arima process, but no need to this. What do you mean with useless??

What do you want to do with the white noise??

kind regards
Florian
Oh,the useless,I mean the method mentioned above may be not suitable for my solver,but I'm study the dnsFoam now. The only aim adding white noise is to keep the turbulence alive. Anyway, I'll take the solver that used dnsFoam codes to do the calculation, then assess the results. Thank you
tzqfly is offline   Reply With Quote

Old   October 9, 2014, 05:01
Default
  #32
Member
 
Florian Ries
Join Date: Feb 2014
Location: Darmstadt, Germany
Posts: 88
Rep Power: 12
itchy is on a distinguished road
Hi,

but for channel flow, you have walls. Turbulence should keep alive by the walls. If you do white noise on it, your results will be biased with the amount of white noise.

You mentioned, that you want to simulate channel flow. In this case, the flow becomes laminar if your initial conditions do not fit and/or your grid is not fine enought (numerical diffusion).

Init a case:
Use boxTurb or for a first shot you can do it with setFields like this

----------------------------------
-> -> -> -> -> -> -> -> ->
<- <- <- <- <- <- <- <- <-
----------------------------------

- channel wall
-> velocity vectors

here you have shear and after a few iterations your case will become turbulent.


kind regards
Florian
itchy is offline   Reply With Quote

Old   October 9, 2014, 07:50
Default
  #33
Member
 
Jason Tan
Join Date: Sep 2014
Posts: 47
Rep Power: 11
tzqfly is on a distinguished road
Quote:
Originally Posted by itchy View Post
Hi,

but for channel flow, you have walls. Turbulence should keep alive by the walls. If you do white noise on it, your results will be biased with the amount of white noise.

You mentioned, that you want to simulate channel flow. In this case, the flow becomes laminar if your initial conditions do not fit and/or your grid is not fine enought (numerical diffusion).

Init a case:
Use boxTurb or for a first shot you can do it with setFields like this

----------------------------------
-> -> -> -> -> -> -> -> ->
<- <- <- <- <- <- <- <- <-
----------------------------------

- channel wall
-> velocity vectors

here you have shear and after a few iterations your case will become turbulent.


kind regards
Florian
Yes, What I simulate is the channel flow, you know, the essay is also simulate the channel flow. the bottom and the upper wall are seted into wall boundary condition and the other 4 wall are seted cyclic boundary condition. the Re=2800, so it is turbulent flow. Hence I said the method using the codes of dnsFoam may unfit my solver. Do you have other solution?
tzqfly is offline   Reply With Quote

Old   October 9, 2014, 08:13
Default
  #34
Member
 
Florian Ries
Join Date: Feb 2014
Location: Darmstadt, Germany
Posts: 88
Rep Power: 12
itchy is on a distinguished road
Hi,

this is not so difficult. You can find a channel flow simulation in the thesis of Eugen de Villiers "the potential of Large Eddy Simulation for the Modelling of wall bounded flows". This is a good thesis!! I would read it. Here it is done with LES, but from the methodology it is same you want to do.

You can do it like this:
1) Use OF2.3.0
2) Solver pimpleFoam
3) fvOptions with pressureGradientExplicitSource as momentum Source
4) Initialize the case with boxTurb or perTurb
5) Averaging with function "fieldAverage" in controlDict

That's the way you can do it, and this will work.

kind regards
Florian
itchy is offline   Reply With Quote

Old   October 9, 2014, 08:51
Default
  #35
Member
 
Jason Tan
Join Date: Sep 2014
Posts: 47
Rep Power: 11
tzqfly is on a distinguished road
Quote:
Originally Posted by itchy View Post
Hi,

this is not so difficult. You can find a channel flow simulation in the thesis of Eugen de Villiers "the potential of Large Eddy Simulation for the Modelling of wall bounded flows". This is a good thesis!! I would read it. Here it is done with LES, but from the methodology it is same you want to do.

You can do it like this:
1) Use OF2.3.0
2) Solver pimpleFoam
3) fvOptions with pressureGradientExplicitSource as momentum Source
4) Initialize the case with boxTurb or perTurb
5) Averaging with function "fieldAverage" in controlDict

That's the way you can do it, and this will work.

kind regards
Florian
NO, what I do is not LES, but DNS,so I cannot use pimpleFoam!
tzqfly is offline   Reply With Quote

Old   October 9, 2014, 08:59
Default
  #36
Member
 
Florian Ries
Join Date: Feb 2014
Location: Darmstadt, Germany
Posts: 88
Rep Power: 12
itchy is on a distinguished road
hi,

pimpleFoam has nothing to do with LES.

With pimpleFoam you can do:
LES, DNS, RANS, URANS, laminar

I have done DNS with pimpleFoam and it worked fine

best regards
Florian

Last edited by itchy; October 9, 2014 at 10:05.
itchy is offline   Reply With Quote

Old   October 9, 2014, 21:43
Default
  #37
Member
 
Jason Tan
Join Date: Sep 2014
Posts: 47
Rep Power: 11
tzqfly is on a distinguished road
Quote:
Originally Posted by itchy View Post
hi,

pimpleFoam has nothing to do with LES.

With pimpleFoam you can do:
LES, DNS, RANS, URANS, laminar

I have done DNS with pimpleFoam and it worked fine

best regards
Florian
Is the pinpleFoam codes includes a part of white noise ?What's the requirement of DNS you do with pimpleFoam?
tzqfly is offline   Reply With Quote

Old   October 10, 2014, 01:33
Default
  #38
Member
 
Florian Ries
Join Date: Feb 2014
Location: Darmstadt, Germany
Posts: 88
Rep Power: 12
itchy is on a distinguished road
Hi,

in pimpleFoam-code there is no white noise. You don't need white noise in a DNS if you have walls. If you have walls (pipewall, channelwall ...), the turbulence keep alive by the shear at the wall. Using white noise in DNS with walls is wrong. You only need white noise if you don't have walls (e.g homogeneous turbulence in a cube -> dnsFoam).

I have done some DNS of pipeflow with pimpleFoam. pimpleFoam or pisoFoam are the right solvers for DNS in OpenFoam.

If you want to do DNS of channel-flow with OpenFoam, the easiest way is:
- OpenFoam 2.3.0
- pimpleFoam or pisoFoam
- system/fvOptions -> pressureGradientExplicitSource
- constant/turbulenceProperties -> simulationType laminar; (this means DNS)
- system/controlDict -> fieldAverage; (you need this for meanflow statistics)
- boxTurb or perTurb for init velocityfield

kind regards
Florian
calf.Z likes this.
itchy is offline   Reply With Quote

Old   October 10, 2014, 08:29
Default
  #39
Member
 
Jason Tan
Join Date: Sep 2014
Posts: 47
Rep Power: 11
tzqfly is on a distinguished road
Quote:
Originally Posted by itchy View Post
Hi,

in pimpleFoam-code there is no white noise. You don't need white noise in a DNS if you have walls. If you have walls (pipewall, channelwall ...), the turbulence keep alive by the shear at the wall. Using white noise in DNS with walls is wrong. You only need white noise if you don't have walls (e.g homogeneous turbulence in a cube -> dnsFoam).

I have done some DNS of pipeflow with pimpleFoam. pimpleFoam or pisoFoam are the right solvers for DNS in OpenFoam.

If you want to do DNS of channel-flow with OpenFoam, the easiest way is:
- OpenFoam 2.3.0
- pimpleFoam or pisoFoam
- system/fvOptions -> pressureGradientExplicitSource
- constant/turbulenceProperties -> simulationType laminar; (this means DNS)
- system/controlDict -> fieldAverage; (you need this for meanflow statistics)
- boxTurb or perTurb for init velocityfield

kind regards
Florian
OK, I'll try it
tzqfly is offline   Reply With Quote

Old   October 11, 2014, 03:29
Default
  #40
Member
 
Jason Tan
Join Date: Sep 2014
Posts: 47
Rep Power: 11
tzqfly is on a distinguished road
Quote:
Originally Posted by itchy View Post
Hi,

in pimpleFoam-code there is no white noise. You don't need white noise in a DNS if you have walls. If you have walls (pipewall, channelwall ...), the turbulence keep alive by the shear at the wall. Using white noise in DNS with walls is wrong. You only need white noise if you don't have walls (e.g homogeneous turbulence in a cube -> dnsFoam).

I have done some DNS of pipeflow with pimpleFoam. pimpleFoam or pisoFoam are the right solvers for DNS in OpenFoam.

If you want to do DNS of channel-flow with OpenFoam, the easiest way is:
- OpenFoam 2.3.0
- pimpleFoam or pisoFoam
- system/fvOptions -> pressureGradientExplicitSource
- constant/turbulenceProperties -> simulationType laminar; (this means DNS)
- system/controlDict -> fieldAverage; (you need this for meanflow statistics)
- boxTurb or perTurb for init velocityfield

kind regards
Florian
I'm trying the method you offered, But I have some question:
1、"constant/turbulenceProperties -> simulationType laminar; [I](this means DNS)", What do you mean "laminar"? Is the flow that we calculating is laminar?
2、Can you offer me the boxTurb or perTurb? I don't know where they are and How to use them.
tzqfly 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
finding noise of flow by dns simulation m2montazari OpenFOAM Running, Solving & CFD 0 October 22, 2010 11:54
Boundary Layer Noise Source Model Andrew FLUENT 0 January 12, 2009 22:47
Turbo noise macro Barri CFX 0 May 21, 2008 09:26
what is the meaning of white noise ztdep Main CFD Forum 5 November 17, 2006 04:14
noise and turbulence aim Main CFD Forum 4 June 6, 2001 05:26


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