
[Sponsors] 
December 5, 2010, 18:59 
Improved implementation of dynamic Smagorinsky

#1 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
Hello,
if you need a dynamic Smagorinsky code with a truly dynamic coefficient (not domainaveraged as in the current implementation), you might find this useful. You can find an implementation the dynamic model with local average of the coefficient here: http://www.openfoam.com/mantisbt/view.php?id=99 I proposed it for inclusion in OpenFOAM. If this is not going to happen (very probable, read the answer), the code is available from my GitHub repository git://github.com/AlbertoPa/dynLocalAverageSmagorinsky.git Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

December 6, 2010, 13:37 
LES  VOF Method

#2 
Member
Javier Basurco
Join Date: Jan 2010
Location: Rio de Janeiro, Brazil
Posts: 33
Rep Power: 9 
Dear Alberto,
I would like to know if this new dynamic smagorinsky model is useful too twophase flow models. I don't know is could be possible to you explain me better how con set my /constant/LESmodel to use this new approach. Thanks in advance My deep regards Respectfully Javier Basurco 

December 6, 2010, 13:58 

#3  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
Quote:
The additional model I posted can be simply compiled with "wmake libso", and then include Code:
libs ( "libOpenFOAM.so" "libdynLocalAverageSmagorinskyModel.so" ) ; Code:
LESModel dynLocalAverageSmagorinsky; delta cubeRootVol; Code:
dynLocalAverageSmagorinskyCoeffs { filter simple; ce 1.048; }
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

December 7, 2010, 11:14 

#4 
Member
Flavio Galeazzo
Join Date: Mar 2009
Location: Karlsruhe, Germany
Posts: 32
Rep Power: 10 
Thanky you for the generous contribution, Alberto. I will give it a try as soon as I get some resources free.


December 7, 2010, 13:46 

#5 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
Hi Flavio, there is nothing new in the model. It is basically the dynamic model proposed by Lilly, with face averaging to limit the risk of numerical instabilities.
Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

December 7, 2010, 20:33 

#6  
Member
Join Date: Oct 2010
Location: Stuttgart
Posts: 35
Rep Power: 8 
Quote:
i don't understand, why to include a library in controlDict.... best regards grandgo 

December 7, 2010, 20:58 

#7  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
Quote:
Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

December 8, 2010, 13:28 

#8 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
Since the proper name of the model is "dynamic Smagorinsky", I updated code, description (added reference) and repository.
The new URL is here: git clone git://github.com/AlbertoPa/dynamicSmagorinsky.git The README also contains the instructions to use the it. Notice that the limitation observed by the current implementation of dynamic Smagorinsky in OpenFOAM affects all the dynamic models, not only the dynSmagorinsky. All the SGS models relying on the dynamic procedure in OpenFOAM average the dynamic coefficient over the whole domain. Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

December 14, 2010, 10:18 

#9 
Senior Member
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 9 
Dear alberto ,
What's the meaning of "face averaging "? It is not "not domain averaging"? If not average at all, but give a cutoff for nuSGS (for example, nu+nuSGS>0), it is better or not ? Could you make your model easier to be modified by others who wants to use this. Thank you very much. 

December 14, 2010, 12:32 

#10  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
Quote:
Lilly's formulation of the dynamic model, which is the one implemented, relies on a formulation of L and M, so that both the numerator and the denominator should vanish if one tends to zero. Based on this consideration, formally, the model should not present problems. However, the coefficient can change significantly, and some averaging might be required. The less intrusive form of averaging I could think to is the "faceaveraging". Face averaging means that the numerator and the denominator in the definition of the dynamic coefficient are the faceaverage value for that cell. This helps in limiting steep variations of the coefficient which would cause numerical problems. It is very different from the "domain average" used in the standard implementation in OpenFOAM 1.7.x. In the domain average you end up having one single value of the coefficient over the whole domain, which removes the advantages of the dynamic procedure. Quote:
Quote:
Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

December 14, 2010, 13:46 

#11 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
I added a modified version of channel395 to the git repository, where the model is enabled. I hope this makes things a bit more clear.
Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

December 22, 2010, 23:11 

#12 
Senior Member
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 9 
Dear alberto ,
Thank you very much. And I also have question. Originally in dynamic model, it seems that k is not needed. But in OpenFOAM's dynamic model, the SGS kinetic energy k is needed. Could you explain this for us ? and how we can give this boundary condition ? in one equation model, Eugene said at inflow boundary, the resolved kinetic energy is OK, and it will quickly decrease. In this dynamic model, also like this ? thanks. And I am sorry, your git repository is not allowed to acess for me. I just download the "Attached files", but can't download the channel395 example. 

December 23, 2010, 01:57 

#13  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
Quote:
Quote:
Quote:
Either: Code:
git clone https://github.com/AlbertoPa/dynamicSmagorinsky.git Code:
git clone git://github.com/AlbertoPa/dynamicSmagorinsky.git Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. Last edited by alberto; December 23, 2010 at 02:01. Reason: Added git commands and some explanation 

December 26, 2010, 04:05 

#14 
Senior Member
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 9 
Dear alberto,
at the inlet position, I have the kinetic energy profile measured from experiment, and I just use this as SGS k. But my professor doesn't agree with me, and said that "turbulent kinetic energy is more large than SGS k, you shouldn't use like this". He let me to fine other papers, see how does other people give inlet condition for SGS k. But I think that inlet condition for SGS k is not important, do you agree with me ? the following is my simulation. at the inlet position, I use experiment profile ,and the SGS k is very large, but as flow proceeded downstream, the k quickly decrease. 

December 26, 2010, 09:50 

#15  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
Hi,
Quote:
The turbulent kinetic energy you measure from experiments is the trace of the Reynolds stress tensor, while the SGS turbulent kinetic energy is the kinetic energy of the residual (unresolved) scales. Clearly they can be very different. Quote:
Do a simple check: set k = 0 at the inlet. Run your case. Compare with what you obtain from the case with k=k_sgs. Does it show any difference? Of course, if you use a model involving the transport equation for k, things are different, and you must specify an appropriate BC for k_sgs. Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

December 27, 2010, 02:36 

#16 
Senior Member
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 9 
Dear alberto .
Thank you very much. You means in dynamic Smagorinsky model, the k_Sgs is not used, so will not influence the result. If it is like this, now I will do simulation using this dynamic model, and compare with my experiement. I have two case , one is empty domain, another is flow around a cubic building. I think the first case can be finished in 10 days. 

December 27, 2010, 03:01 

#17  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
Quote:
Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

January 12, 2011, 15:38 
plannar averaging

#18  
New Member
Stefanie Schiffer
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 26
Rep Power: 9 
Quote:
thanks for sharing your corrected dynamicSmagorinsky with us! I tried it and it works fine. I wonder if the model can be changed in a way that it uses a planar averaging technique as was proposed by Germano (1990)? Of course that would only work for channel flow. That way the constant would only change with the height of the channel. Do you know of any plannar averaging methods in OpenFoam? Are you getting fairly low results for C for the channel testcase as well? I'm getting values around 0.01, but I was expecting values at around 0.1 or 0.2. Also I'm getting negative values for C. Best Stefanie 

January 12, 2011, 16:53 

#19  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
Quote:
Additionally, keep in mind that Germano's formulation for Cs is different from Lilly's formulation. Lilly's formulation in theory is always defined (numerically you still have issues due to large values). Check the corresponding references. Quote:
Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

January 13, 2011, 08:14 

#20 
New Member
Stefanie Schiffer
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 26
Rep Power: 9 
thanks, I think I'll keep working with Lilly's locally defined Cs then.
Is there a reason why the function cD is missing the factor 1/2 in the implementation? Or is that considered somewhere else? Best Stefanie 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Smagorinsky Dynamic Cosant in UDF  Paolo Lampitella  FLUENT  1  June 17, 2009 03:40 
Dynamic Smagorinsky LES  Lourival  FLUENT  0  April 14, 2006 13:48 
Dynamic Smagorinsky Model  Andrew  Main CFD Forum  1  November 30, 2004 01:52 
Reply to Tim Re Dynamic Smagorinsky model  Ajay S. Parihar  Main CFD Forum  9  June 2, 2002 16:24 
Dynamic Smagorinsky model  Tim  Main CFD Forum  7  May 29, 2002 07:37 