
[Sponsors] 
November 4, 2009, 05:11 
Serious bug in LES interface

#1 
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
Hello guys,
I want to report a serious bug in the LES interface. I had build my own SGS model in OpenFOAM and with the release of OpenFOAM 1.6 I decided to use the new OpenFOAM. After spending much work to the adaption of my SGS Model to the new interface of OpenFOAM 1.6, I was wondering about differences between the Solutions of OpenFOAM 1.5 and OpenFOAM 1.6. So I assumed a mistake of me while reprogramming my model and I spent many hours to find the mistake. At the end I decided to go back to a simpler model and check the differences between version 1.5 and 1.6 with the channel395 tutorial and a simple SGS Model in detail Smagorinsky. First I chose pisoFoam as base for my solver and added the driving pressure gradient. This gives me the green curve for reynolds stress u'v' in the figure shown at the end of this thread. Than I tested the channelFoam solver which produces another solution, in the figure the light blue curve. For comparison I solved the same case, identical input control files and mesh with OpenFOAM 1.5 and channelOodles which gives me the dark blue curve ... and what a surprise another solution. So I checked the differences in solver and sgs model in detail and I am able to reproduce the OpenFOAM 1.5 solution with OpenFOAM 1.6 (red curve with crosses) if I: 1) put the SGS model in my solver: turbulence>correct(); in front of my PISO loop instead at the end like in the new pisoFoam solver. 2) remove the call of updateSubGridScaleFields(fvc::grad(U)); in the constructor of the SGS model. This have to be done too, If not one will get another different solution I also checked the solver without an SGS model (setting ck to zero for Smagorinsky) and I am getting the same results for both version. So in my opinion there is a serious bug in the LES interface somewhere. But I do not have the knowledge to understand everything whats going on in the SGS Model, wallModel, transport model and everywhere else. I use OpenFOAM on HPCs, where I am not able to make changes to the main source files. So please fix this bug as soon as possible or tell me my mistake. I really need a working LES interface. kind regards, Fabian openfoambug.png Edit: I am now checking the GIT Version OpenFOAM 1.6.x and there are some changes in the LES interface. A first test with channelFoam of the 1.6.x version leads me to the same results like the channelFoam of version 1.6. So there is still a gap between OpenFOAM 1.5 and 1.6 Last edited by fs82; November 4, 2009 at 11:04. 

November 4, 2009, 11:05 

#2 
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
I tested the same cases with OpenFOAM 1.6.x but the results are as bad as in OpenFOAM 1.6. I attached the graphs below. No body else experienced problems with the LES interface?
kind regards Fabian openfoambug2.png 

November 4, 2009, 13:10 

#3 
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
Sry guy its me again. I still try to find out whats wrong with OpenFoam. I noticed that the LESProperties file has changed between the channel395 case of OpenFOAM 1.5 and 1.6.x. So I thought: lets try this may be a parameter wasn't set correctly. And let me say, I am sry for that, but the results sucks. I have now 2 more curves or in other words 25 OpenFOAM channel cases and up to 10 different results. And I still have no idea why. Please help this OpenFOAM 1.6 makes me crazy. If anyone would try it himself, just take the channel395 tutorial and change LESModel from oneEqEddy to Smagorinsky and enjoy :D
openfoambug3.png 

November 5, 2009, 05:28 

#4 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 14 
Changing the location of the LES model correction will affect the temporal truncation error and hence the solution. If you want to make sure the solution is independent of this choice you could add an outer loop as in pimpleFoam and check that the system of equations is completely converged at each timestep.
> 2) remove the call of updateSubGridScaleFields(fvc::grad(U)); in the constructor of the SGS model. This have to be done too, If not one will get another different solution This doesn't make much sense because the initialization procedure for nuSgs should not affect the final averaged solution unless the averaging started from the beginning of the run and was not for long enough. How long are you running these cases before starting the averaging and how long are you averaging for? The tutorial case is setup to run with valDriest delta, are the differences in the results sensitive to this? If you run with a simple geometric delta do you get the same level of difference? H 

November 5, 2009, 07:38 

#5  
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
Quote:
Quote:
Not not yet, but I will try this in a few minutes, after a coffee break :D 

November 5, 2009, 07:54 

#6 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 14 
The fields provided in the tutorial case are VERY old and should not be considered consistent with the current solvers. They are provided to avoid the need to run the case from a laminar flow through transition and to a fullydeveloped turbulent state. To run the case you should start from the fields provided, run for a while to develop the flow to be consistent with the solver before starting the averaging and then average for a sufficient time to obtain smooth statistics.
H 

November 5, 2009, 09:01 

#7 
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
Allright, very interesting. So if I understand it right, I should run it a while starting from the provided fields in the tutorial and than start averaging and compare the results for both versions (1.5 and 1.6.x). Allright I will try this, hopefully the results will aproach :D
thx Fabian 

November 6, 2009, 04:31 

#8 
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
So I have followed your suggestion henry. I took the channel395 tutorial, run 5000 time steps and than I started averaging for 5000 time steps. The results are shown in the attachment. Again channelOodles (green curve) looks very good and channelFoam (red curve) is to far away from the OpenFoam 1.5 solution. For my understanding there should be no difference, because in my opinion there is no difference between the solvers. If I set ck for Smagorinsky to zero I will get the same results for OpenFoam 1.5 and 1.6. So the difference must be located somewhere in the LES model.
kidn regards, Fabian openfoambug4.png 

November 6, 2009, 04:44 

#9 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 14 
I am not convinced that 5000 time steps is enough either for the startup period or for the averaging. Could you look at the evolution of the averaged solution for both to check this? Could you also post the results you obtained setting ck to 0?
H 

November 6, 2009, 07:15 

#10 
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
I perform now two calculations and double the time for startup period and averaging. I will check the evolution for the avergaged solution as soon as possible. I think your right, because the graphs for both versions shows some waves, which could be a result of less averaging time. But still I am wondering why the solutions after identical time steps, with identical startup are so different between 1.5 and 1.6. I will post my test with deaktivated SGS model. This is simple done by setting ck to zero and it leads to identical curves for the Renoldy stresses.
kind regards, Fabian openfoambug5.png 

November 6, 2009, 07:42 

#11 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 14 
It would be useful to know if the difference in behavior is related to the use of the van Driest damping function; could you try with a purely geometric delta?
H 

November 6, 2009, 07:55 

#12 
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
How do I activate only geometric delta? In my LESProperties dictionary there is a line which indicates VanDriest wall damping:
delta vanDriest; But in my Userguide there is only: PrandtlDelta, cubeRootVolDelta, smoothDelta and no VanDriest delta. Do you know the keyword for geometric delta? kind regards, Fabian 

November 6, 2009, 08:05 

#13 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 14 
cubeRootVolDelta is purely geometric as it is simply the cuberoot of the cell volumes.
H 

November 6, 2009, 08:09 

#14 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 14 
Note that the Smagorinsky coefficients set in the LESProperties file in the 1.5 tutorial case are not the same as the highRe default values in the 1.6 code and to make the case run the same you will need to set the coefficients to be the same. We should set the coefficients in the LESProperties file in the 1.6 tutorial to override these defaults appropriate for the lowRe of this case as in the 1.5 tutorial case.
H 

November 6, 2009, 08:15 

#15 
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
Yeah I allready noticed the difference and corrected it by supplying them in the LESProperties dictionery. Thx for the hint with the geometric delta. cubeRootVolDelta was the one I thought, but I wasn't sure. So I will try this an post the results.
thx Fabian Edit: Allright I am getting very different results if I increase the startup and/or the averaging time. So I will use the weekend to produce a solution with a high startup time (50000 time steps) for both versions, without vanDriest damping, to ensure that this is not the reason for the differences and on Monday I will do a long averaging run. Hopefully this will bring me one step forward :/ Last edited by fs82; November 6, 2009 at 09:11. 

November 12, 2009, 04:45 

#16 
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
Alright, the tests with extended startup and averaging time are finished and the solution looks good in my opinion. There is a little gap, but this seems to be ok. The parameters of this run are: startup: 100000 time steps, averaging: 100000 time steps, Smagorinsky with adjusted constants on 1.6.x from 1.5, cubeRootVol for delta.
The next interesting thing would be: whats happens to the solution if I restart during averaging several times. So I will try this and see whats happens. Fabian openfoambug6.png 

November 12, 2009, 04:51 

#17 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 14 
It would also be interesting to recheck the results with van Driest damping and sufficient averaging. If those results are still dissimilar we will investigate in detail.
Thanks H 

November 12, 2009, 05:26 

#18 
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
What do you mean by "sufficient averaging"? I will start an additional case with OpenFoam 1.6.x and van Driest damping and we will see if the solution changes or not
Fabian Edit: Ignore my question ... I know what you mean by "sufficient averaging" sry, I am not really awake today 

November 13, 2009, 05:08 

#19 
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
Test with the restart during averaging are finished and the results looks very good. See the brown graph below. So with pure geometric delta everything works fine. I will check whats happening when I use the vanDriest wall damping.
Fabian openfoambug7.png 

November 16, 2009, 05:39 

#20 
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 207
Rep Power: 10 
The tests with VanDriest damping looks very good too. There are allways very small differences, but this could be due to some rounding errors or initialization, I dont know but they are very small and thus in my opinion neglectable. The more interessting thing to me, is that the results with vanDriest damping do not fit the DNS results of Moder, Kim and Masour for Re_tau = 395. But I think this is a problem of the mesh, timestep and so on. So at least: Please update the tutorials in the next OpenFoam versions. This is always the first try, if one detects some errors, and they have to work. Sry for any inconveniences :D
kind regards, Fabian openfoambug8.png 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Wind turbine simulation  Saturn  CFX  45  February 8, 2016 05:42 
Bug in Dynamic 1Eq Eddy Viscosity LES Model Incompressible flow  harishg  OpenFOAM Bugs  5  December 2, 2008 19:18 
Bug? about direct CAD interface of ICEMCFD5.0!  whiz  CFX  1  March 10, 2005 16:11 
Convective Heat Transfer  Heat Exchanger  Mark  CFX  6  November 15, 2004 16:55 
Replace periodic by inletoutlet pair  lego  CFX  3  November 5, 2002 21:09 