# pisoFOAM (LES) - internal pipe flow - convergence

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

July 31, 2018, 08:03
pisoFOAM (LES) - internal pipe flow - convergence
#1
Senior Member

Guilherme
Join Date: Apr 2017
Posts: 181
Rep Power: 6
Hello,

First, I'm using OpenFOAM 5.0 (LES - Smagorinsky - Re=5300 with R = 0,1 and L=10D)...

I start the field in RANS (steadyState - simpleFoam) and later I mapped (mapFields) it to a new folder with intention to start the simulations in LES (pisoFoam).

The problem lies in my results and in the way I am evaluating the statistically stationary state of turbulent flow.

A piece of my log.pisoFoam:

Quote:
 Time = 60 Courant Number mean: 0.120862 max: 0.344575 DILUPBiCCCG: Solving for Ux, Initial residual = 0.0549594, Final residual = 2.52306e-08, No Iterations (4 4 4) DILUPBiCCCG: Solving for Uy, Initial residual = 0.0554047, Final residual = 2.49724e-08, No Iterations (4 4 4) DILUPBiCCCG: Solving for Uz, Initial residual = 0.00921562, Final residual = 4.00749e-09, No Iterations (4 4 4) Pressure gradient source: uncorrected Ubar = 1.472, pressure gradient = 0.309871 DICPCG: Solving for p, Initial residual = 0.123458, Final residual = 0.000241023, No Iterations 16 time step continuity errors : sum local = 2.05054e-07, global = -3.37199e-20, cumulative = -2.96846e-16 Pressure gradient source: uncorrected Ubar = 1.472, pressure gradient = 0.30982 DICPCG: Solving for p, Initial residual = 0.00439032, Final residual = 0.000244751, No Iterations 16 time step continuity errors : sum local = 2.07641e-07, global = -1.0475e-19, cumulative = -2.96951e-16 Pressure gradient source: uncorrected Ubar = 1.472, pressure gradient = 0.30987 ExecutionTime = 23798.4 s ClockTime = 24157 s fieldAverage fieldAverage1 write: Calculating averages Writing average fields End Finalising parallel run
fvSchemes:

Quote:
 ddtSchemes { default backward; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) Gauss cubic; div((nuEff*dev(T(grad(U))))) Gauss linear; div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } wallDist { method meshWave; }
What has worried me are the results obtained by UMean and UPrime2Mean, important for verification with the results obtained in DNS (Eggles). I've attached the 4 results below. Can you help me explain what might be happening?

Unfortunately this is my first case in turbulence, I do not know how to evaluate if the flow is in a statistically stationary state (... kindly ask those who have experience, share with me). I tried to monitor the 'wallShearStress' on the wall, but without success (similar to how it is done in Fluent), could anyone tell me if this is possible? probes?!

The maximum that I did was to consider the region of entrance of the flow, through the relation: L = 0.06 * Re * D. With possession of this value (L), and because it is a periodic domain with flow velocity equal to 1,472 m/s (flow in the Z direction)... it was determined that the time to reach the region of 'developed flow' was 43.20 seconds ... for that reason the simulation was set in 60 seconds.

The fluid was perturbed by the code (perturbUCylinder) and evaluating the velocities at points in the domain, there was no laminarization (attached image - pt4: point near the wall).

Thanks to all who can help.
Attached Images
 UMean.jpg (77.3 KB, 41 views) UPrime2Mean_ZZ.jpg (92.0 KB, 36 views) UPrime2Mean_YY.jpg (94.4 KB, 34 views) UPrime2Mean_XX.jpg (95.4 KB, 32 views) convergencia_U.png (138.8 KB, 42 views)

 July 31, 2018, 12:00 #2 Senior Member   Join Date: Aug 2015 Posts: 478 Rep Power: 11 For the convergence, statistical stationarity refers to how they're (the statistics) changing. Simply put, your statistics will not change if you have obtained convergence (provided that you are averaging over enough data). Given that you're modeling turbulent flow, the least you'll want to do is make sure your average of interest is not changing. The period/time you average over depends on the problem, but generally longer is better. This will of course increase as you become interested in higher order statistics. It is hard to tell how your results could be off without seeing the DNS results on the plots in addition to your own. Caelan gu1 likes this.

July 31, 2018, 13:14
#3
Senior Member

Guilherme
Join Date: Apr 2017
Posts: 181
Rep Power: 6
Quote:
 Originally Posted by clapointe For the convergence, statistical stationarity refers to how they're (the statistics) changing. Simply put, your statistics will not change if you have obtained convergence (provided that you are averaging over enough data). Given that you're modeling turbulent flow, the least you'll want to do is make sure your average of interest is not changing. The period/time you average over depends on the problem, but generally longer is better. This will of course increase as you become interested in higher order statistics. It is hard to tell how your results could be off without seeing the DNS results on the plots in addition to your own. Caelan
Hi Caelan,

The results that I am looking for to compare can be found in: "A direct numerical simulation study on the mean velocity characteristics in turbulent pipe flow - Wu (2008)", I will attach image of the RMS profiles that I am seeking to obtain, these are the ones that are most I'm intrigued by my simulation because they are totally different and are not varying over time (with longer simulation time). I wanted to understand what could be causing this ... could you help me?

On the statistically stationary question, I understand the concept ... I want to understand what parameters I should evaluate in my simulation using the OF. As I mentioned, using Fluent just monitor the 'wallShearStress' on the wall ... however, I have not found out if this is possible in OF.
Attached Images
 perfil.jpeg (29.8 KB, 29 views)

 July 31, 2018, 14:03 #4 Senior Member   Join Date: Aug 2015 Posts: 478 Rep Power: 11 Can you plot your results on top of the DNS values? For the statistics, here's a nice web page with a description : https://people.duke.edu/~rnau/411diff.htm. So you'd at least look at the time-average of your quantity of interest, but higher order statistics such as variance are also important. I am not sure exactly what fluent does, but wall shear stress is a function of velocity gradients near the wall as well as the effective viscosity -- ie it will depend on turbulence quantities and treatment of the boundary layer. If you want to match that in openfoam, there's a function object called wallShearStress. So you could include it in your controlDict to use at runTime or as a post processing step. In terms of matching DNS with LES, there are many possible ways that the two could differ -- for example, your choice of LES model, resolution of the boundary layer, resolution of the domain. So, how are you treating the boundary layer? Caelan

July 31, 2018, 14:36
#5
Senior Member

Guilherme
Join Date: Apr 2017
Posts: 181
Rep Power: 6
Quote:
 Originally Posted by clapointe Can you plot your results on top of the DNS values? For the statistics, here's a nice web page with a description : https://people.duke.edu/~rnau/411diff.htm. So you'd at least look at the time-average of your quantity of interest, but higher order statistics such as variance are also important. I am not sure exactly what fluent does, but wall shear stress is a function of velocity gradients near the wall as well as the effective viscosity -- ie it will depend on turbulence quantities and treatment of the boundary layer. If you want to match that in openfoam, there's a function object called wallShearStress. So you could include it in your controlDict to use at runTime or as a post processing step. In terms of matching DNS with LES, there are many possible ways that the two could differ -- for example, your choice of LES model, resolution of the boundary layer, resolution of the domain. So, how are you treating the boundary layer? Caelan
...At the moment I cant plot (I'm still getting to know the Linux world, sorry about that), but I think they are totally different for the profiles that are being presented by OF. The own shows RMS maximum in the center of the pipe, already the proposed values by Wu, this does not happen, they are close to the wall.

The wallShearStress function is being used in my controlDict, what I can not do is monitor this function throughout the simulation to evaluate 'convergence'.

The resolution on the wall is y + <1.

 July 31, 2018, 14:50 #6 Senior Member   Join Date: Aug 2015 Posts: 478 Rep Power: 11 They are plotting against (1-r+) on the x axis -- where are they defining r from? Make sure you're using the same independent variable. If your first cell is below y+ of 1 you should have adequate resolution in the boundary layer -- make sure you aren't applying any wall modeling. Depending on what you have available, you don't need to use native linux tools to plot. I always read data into matlab for post processing. Try running postProcess -func wallShearStress. This will create a series of text files for you to read into your software of choice (in a folder called postProcessing -- this might actually be created already when you include the function object in the controlDict). Otherwise, there are various posts on the forum about pulling residual data from a log file to plot with gnuplot. Caelan

August 1, 2018, 12:39
#7
Senior Member

Guilherme
Join Date: Apr 2017
Posts: 181
Rep Power: 6
Quote:
 Originally Posted by clapointe They are plotting against (1-r+) on the x axis -- where are they defining r from? Make sure you're using the same independent variable. If your first cell is below y+ of 1 you should have adequate resolution in the boundary layer -- make sure you aren't applying any wall modeling. Depending on what you have available, you don't need to use native linux tools to plot. I always read data into matlab for post processing. Try running postProcess -func wallShearStress. This will create a series of text files for you to read into your software of choice (in a folder called postProcessing -- this might actually be created already when you include the function object in the controlDict). Otherwise, there are various posts on the forum about pulling residual data from a log file to plot with gnuplot. Caelan
Hi Caelan,

Some things I'm taking, I do not know if they will work. On the question of the wall, as I said, the resolution is of y + <1.

As soon as I get the new results, I'll let you know.

 August 9, 2018, 12:16 #8 Senior Member   Guilherme Join Date: Apr 2017 Posts: 181 Rep Power: 6 I was thinking that the problem I am facing may be related to the disturbance being imposed on the velocity field .... OR being related to my fvSchenes, because the field only keeps fluctuations when I use the 'Gauss cubic' model for velocity.... what to me is very strange, 'Gauss limitedLinear 1.0' and 'Gauss LinearUpwind grad (U)' are laminarizing my fluid.

 August 9, 2018, 12:36 #9 Senior Member   Join Date: Aug 2015 Posts: 478 Rep Power: 11 That is a good observation -- limitedLinear and linearUpwind are nominally first/second order and second order upwind, respectively. From a high-level perspective, this means that (possibly undue) numerical dissipation will be introduced by the schemes when compared to central differencing (linear) for the same grid. Generally for LES you'll want to use Gauss linear for your divergence terms as long as stability is not a concern. Caelan

August 9, 2018, 12:48
#10
Senior Member

Guilherme
Join Date: Apr 2017
Posts: 181
Rep Power: 6
Quote:
 Originally Posted by clapointe That is a good observation -- limitedLinear and linearUpwind are nominally first/second order and second order upwind, respectively. From a high-level perspective, this means that (possibly undue) numerical dissipation will be introduced by the schemes when compared to central differencing (linear) for the same grid. Generally for LES you'll want to use Gauss linear for your divergence terms as long as stability is not a concern. Caelan
Even using 'Gauss linear' for velocity field, there has been dissipation...

 August 9, 2018, 12:57 #11 Senior Member   Join Date: Aug 2015 Posts: 478 Rep Power: 11 What temporal integration scheme are you using? For LES 2nd order in time is also desirable. Caelan

August 9, 2018, 14:06
#12
Senior Member

Guilherme
Join Date: Apr 2017
Posts: 181
Rep Power: 6
Quote:
 Originally Posted by clapointe What temporal integration scheme are you using? For LES 2nd order in time is also desirable. Caelan
Hi,

I'm alternating to see if I find '' differences '' between one setup and another. I have used 'backward', but I also did tests using 'CrankNicolson 0.9'.

Is my problem, because it is a pipe, directly related to the results with the cartesian coodenates? Is it necessary to convert them to cylinder coodenates in order to "get" the actual values of my problem (if they exist)?

Guilherme

 August 9, 2018, 14:11 #13 Senior Member   Join Date: Aug 2015 Posts: 478 Rep Power: 11 Good, it sounds like your time integration should be fine. When you say there's dissipation, are you seeing this when you visualize, or when you plot? Related to your latest question, I'd recommend solving/plotting like the DNS data that you are comparing to. I am unfamiliar with using cylindrical coordinates in OF, though. Caelan

August 9, 2018, 14:27
#14
Senior Member

Guilherme
Join Date: Apr 2017
Posts: 181
Rep Power: 6
Quote:
 Originally Posted by clapointe Good, it sounds like your time integration should be fine. When you say there's dissipation, are you seeing this when you visualize, or when you plot? Related to your latest question, I'd recommend solving/plotting like the DNS data that you are comparing to. I am unfamiliar with using cylindrical coordinates in OF, though. Caelan
Yes, when I plot the velocity points (probes) I have in my domain, I see that the magnitude of both is not changing with time, so I come to the conclusion that the fluid laminized.

 August 9, 2018, 14:28 #15 Senior Member   Join Date: Aug 2015 Posts: 478 Rep Power: 11 Have you visualized the flow to confirm this? Caelan

 August 9, 2018, 15:22 #16 Senior Member   Santiago Lopez Castano Join Date: Nov 2012 Posts: 317 Rep Power: 12 If you have non zero velocity variance (autoccorelations, R. Stress) you have turbulence. Your plots are not appropriately scaled, you need to normalize by the shear velocity if you want to compare. Besides, you have to average not only in time but in directions of homogeneity, that is, in polar coordinates along radial lines.

August 9, 2018, 16:33
#17
Senior Member

Guilherme
Join Date: Apr 2017
Posts: 181
Rep Power: 6
Quote:
 Originally Posted by clapointe Have you visualized the flow to confirm this? Caelan
Yes, especially after plotting the velocity profile (it acquires similarity to the laminar profile)...

August 9, 2018, 16:35
#18
Senior Member

Guilherme
Join Date: Apr 2017
Posts: 181
Rep Power: 6
Quote:
 Originally Posted by Santiago ''Besides, you have to average not only in time but in directions of homogeneity, that is, in polar coordinates along radial lines.''

Guilherme

*EDIT1: Do you find it necessary to convert from cartesian coordinates to cylindrical coordinates?

 August 9, 2018, 17:09 #19 Senior Member   Join Date: Aug 2015 Posts: 478 Rep Power: 11 I think we've established that your case looks to be fine numerically. That leaves the setup and analysis/post processing. As mentioned earlier, you should be analyzing your data so you can plot the same way the DNS data is plotted. As for setup, here is a similar thread that will hopefully provide useful insight : question regarding LES of pipe flow - pimpleFoam Caelan

August 10, 2018, 07:00
#20
Senior Member

Guilherme
Join Date: Apr 2017
Posts: 181
Rep Power: 6
Quote:
 Originally Posted by clapointe As mentioned earlier, you should be analyzing your data so you can plot the same way the DNS data is plotted. Caelan
I will study the shared link and try to plot the graphs to compare them. As soon as I get answers, I give feedback.

Guilherme