
[Sponsors] 
January 27, 2009, 09:28 
Hi all,
I was working on a

#1 
New Member
Sébastien Bocquet
Join Date: Mar 2009
Posts: 21
Rep Power: 8 
Hi all,
I was working on a turbulent flat plate with the Spalart Allmaras model, and the results were not fine. So I had a look at the source code and I think there is something wrong. The version implemented in openFOAM 1.5 is the Spalart Allmaras with fv3 function. This version also requires to modify fv2, which is not done (the correct fv2 consistent with the use of fv3 is on the commented line) : tmp<volscalarfield> SpalartAllmaras::fv2 ( const volScalarField& chi, const volScalarField& fv1 ) const { return 1.0  chi/(1.0 + chi*fv1); //return 1.0/pow3(scalar(1) + chi/Cv2); } Thus I think either the commented fv2 should be used keeping fv3 unchanged, or fv3 should be set to 1, keeping fv2 unchanged. For testing, I did the latter, removing fv3 in the expression for Stilda, which gives the basic form of Spalart Allmaras model : volScalarField Stilda = sqrt(2.0)*mag(skew(fvc::grad(U_))) + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_); After recompiling, the velocity profiles and local friction agree very well with theory and other CFD codes. Seb 

January 27, 2009, 10:59 
Thanks for studying this code

#2 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 13 
Thanks for studying this code in detail and for the bug report, yes you are correct, this is currently inconsistent. We originally implemented the standard SA model and it worked well for simple cases but when we moved to complex problems, in particular F1 cars, it proved unstable. We then implemented the "correction" from
"An Unstructured Grid Generation and Adaptive Solution Technique for High Reynolds Number Compressible Flows" G.A. Ashford, Ph.D. thesis, University of Michigan, 1996. and this proved much more stable. However it looks like while switching between the models at some point the fv2 has been left inconsistent with fv3. Could you please check if you get the correct behavior with the alternative fv2 and fv3? Thanks H 

January 27, 2009, 11:25 
Yes I will check with the fv3

#3 
New Member
Sébastien Bocquet
Join Date: Mar 2009
Posts: 21
Rep Power: 8 
Yes I will check with the fv3 version.
My test cases are however simpler than F1 cars (flat plate and backward facing step). The fv3 version seems to be corrected for low Re flows, at least from this source : http://turbmodels.larc.nasa.gov/spalart.html Thanks for your comment on SA instability. Seb 

January 27, 2009, 11:33 
The LES versions of the Spalar

#4 
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12 
The LES versions of the SpalartAllmaras model do have the correct implementation and exhibit what appears to be the correct behaviour.
Eugene 

January 27, 2009, 12:00 
Hi Sébastien,
Thanks for th

#5 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 13 
Hi Sébastien,
Thanks for the interesting link, it seems they are not very happy with the fv3 term: " It was devised to prevent negative values of the source term, and is not recommended because of unusual transition behavior at low Reynolds numbers (see Spalart, P. R., AIAA 20002306, 2000)." but the source term going negative does happen in complex flow cases and causes nuTilda to go negative! so we need a fix of some kind. It is not clear if any of the alternative formulations are preferable, perhaps the SAEdwards or SAsalsa are better; at least they both have a wellposed generation term. H 

January 27, 2009, 13:01 
Thanks Sébastien,
I was als

#6 
Member
Etienne Lorriaux
Join Date: Mar 2009
Location: Compiegne, France
Posts: 43
Rep Power: 8 
Thanks Sébastien,
I was also getting unbelievable results on a train drag computation case with SpalartAllmaras. Since the results are satisfaying with a RNGkEps model, I was also thinking to look after the SA coeffs. You found the problem before me, thanks ;) I'll try to run the case again as soon as I have free CPU time. Bye, Etienne. 

January 27, 2009, 17:23 
I have pushed the change to fv

#7 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 13 
I have pushed the change to fv2 to OpenFOAM1.5.x, please let me know if this resolves the issues with this model.
Thanks H 

January 27, 2009, 19:26 
I agree that the fv3 term need

#8 
Senior Member

I agree that the fv3 term needs to be blitzed. I did a little study of this about a year ago. Here are a couple of figures to highlight the effect of turning this term off.


January 28, 2009, 04:18 
In these comparisons did you c

#9 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 13 
In these comparisons did you check that the fv2 term was set consistently for the cases with and without the fv3 term? The initial comparisons we did after introducing the fv3 term showed very similar results to the standard model but with improved stability which is why we kept it. Unfortunately at some point since then the fv2 has been set inconsistently with the fv3 term; this is now fixed in 1.5.x.
I would be more than happy to drop the fv3 term if a form of the SA model can be found which does not suffer from the stability problems related to negative production in the original model. Has anyone tested the many variants? They are pretty easy to implement and I would be happy to add the promising ones to the set of turbulence models in OpenFOAM if there is interest. H 

January 28, 2009, 08:05 
Henry,
These plots were mad

#10 
Senior Member

Henry,
These plots were made doing exactly what Sebastien suggested in the original post of this thread, i.e., setting fv3 = 1, and keeping fv2 as implemented. This should give the original SA formulation. Around the same time, I did a study of ALL of the RANS turbulence models for turbulent flat plate boundary layer, and found that most of them give poor results. Here is a plot of some of them. SA with fv3=1 and LaunderSharma give pretty good results. LienCubicLowRe (including a few mods that I tested) gives horrible results. kEpsilon with wall functions is OK, as long as user is careful to avoid outer part of buffer layer (cf. y+ 30 vs. 115). The take away points from this study were: 1. be very careful if accurate prediction of wallshear stress (and drag) is required. SA and LaunderSharma seem to do the best. Menter's kOmegaSST (no wall functions) that was out on the wiki also does a pretty good job (has that been adopted in 1.5?). 2. just because there are models in OpenFOAM, doesn't imply that they have been validated for your problem. BUYER BEWARE.... 3. OpenFOAM sorely needs adaptive wall functions which can seemlessly transition from sublayer resolution to wallfunction resolution. Eric 

January 28, 2009, 08:16 
When you ran with fv3 != 1 cou

#13 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 13 
When you ran with fv3 != 1 could you clarify which form of fv2 you running with?
H 

January 28, 2009, 08:20 
tmp

#15 
Senior Member

tmp<volscalarfield> SpalartAllmaras::fv2
( const volScalarField& chi, const volScalarField& fv1 ) const { return 1.0  chi/(1.0 + chi*fv1); //return pow(scalar(1) + chi/Cv2, 3); } 

January 28, 2009, 08:28 
That form is correct for fv3 =

#16 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 13 
That form is correct for fv3 = 1 but to run with fv3 != 1 you will need to run with the second expression commented out, see the original post. If you have time to test this that would be great.
H 

January 28, 2009, 10:24 
Hi All,
Maybe this is a stu

#18 
Member
Paulo Alexandre Costa Rocha
Join Date: Mar 2009
Posts: 71
Rep Power: 8 
Hi All,
Maybe this is a stupid question, but I won't sleep today if I don't ask ;) I've read somewhere in this forum that the OF solvers (simpleFoam in particular) only have turbulence models with wall functions. Is it true, i.e., my solution must have y+ about 30, or can I have smaller values with the viscous sublayer modeled? Thanks in advance, Paulo Rocha 

January 28, 2009, 10:57 
I ran simulations for the fv3

#19 
New Member
Sébastien Bocquet
Join Date: Mar 2009
Posts: 21
Rep Power: 8 
I ran simulations for the fv3 version of SA, on 3 flat plate meshes (y+ around 0.2 ; 1 and 25). Reynolds number at the end of the plate is 4.10^6. There is hardly no difference compared to the basic version, except that close to the inlet, the local friction goes to a minimum before rising and going close the theoretical curve. With the basic version, the local friction keeps on decreasing, as the theoretical one does.
By the way, Etienne, as you say the RNG k epsilon gives good results, could you tell me which type of mesh you use at the walls (fine or wallfunction type mesh)? Thanks Seb 

January 28, 2009, 11:00 
Not true, there are several lo

#20 
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 13 
Not true, there are several lowRe turbulence models included in OpenFOAM:
LamBremhorstKE LaunderSharmaKE LienCubicKELowRe LienLeschzinerLowRe SpalartAllmaras all of which will run without wallfunctions. With SpalartAllmaras wallfunctions are optional and should be used where the mesh is not fine enough to resolve the boundarylayer. H 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
SimpleFoam case with SpalartAllmaras turbulence model implemented  nedved  OpenFOAM Running, Solving & CFD  2  November 30, 2014 23:43 
SpalartAllmaras question  egp  OpenFOAM Running, Solving & CFD  45  October 28, 2010 03:30 
SpalartAllmaras DES question  ivan_cozza  OpenFOAM Running, Solving & CFD  0  December 15, 2008 07:34 
YPlus for SpalartAllmaras  ddigrask  OpenFOAM Running, Solving & CFD  1  December 12, 2008 15:29 
Pow in lib64tlslibmso6 SigFpe when running coodles with SpalartAllmaras  lillberg  OpenFOAM Bugs  4  December 7, 2007 09:17 