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

Bug in SpalartAllmaras

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 27, 2009, 08:28
Default Hi all, I was working on a
  #1
New Member
 
Sébastien Bocquet
Join Date: Mar 2009
Posts: 21
Rep Power: 17
seb62 is on a distinguished road
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
seb62 is offline   Reply With Quote

Old   January 27, 2009, 09:59
Default Thanks for studying this code
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
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
henry is offline   Reply With Quote

Old   January 27, 2009, 10:25
Default Yes I will check with the fv3
  #3
New Member
 
Sébastien Bocquet
Join Date: Mar 2009
Posts: 21
Rep Power: 17
seb62 is on a distinguished road
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
seb62 is offline   Reply With Quote

Old   January 27, 2009, 10:33
Default The LES versions of the Spalar
  #4
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21
eugene is on a distinguished road
The LES versions of the Spalart-Allmaras model do have the correct implementation and exhibit what appears to be the correct behaviour.

Eugene
eugene is offline   Reply With Quote

Old   January 27, 2009, 11:00
Default Hi Sébastien, Thanks for th
  #5
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
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 2000-2306, 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 SA-Edwards or SA-salsa are better; at least they both have a well-posed generation term.

H
henry is offline   Reply With Quote

Old   February 16, 2010, 16:47
Default
  #6
New Member
 
Charles Mockett
Join Date: Dec 2009
Location: Berlin, Germany
Posts: 9
Rep Power: 16
charlie is on a distinguished road
Quote:
Originally Posted by henry View Post
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 2000-2306, 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 SA-Edwards or SA-salsa are better; at least they both have a well-posed generation term.

H
Dear Dr. Weller, dear all,

Thanks for this interesting and important discussion. I brushed with this issue recently, when implementing the original SA formulation in our in-house solver: I found the same stability problem in very specific regions of the flow in a "slightly complex" test case. I contacted the model authors and they recommended some additional limiters to prevent Stilde from reaching zero or going negative, which fixes this problem. The limiter we implemented is:

chi >= 1E-03
sTilde >= 1E-05*U_ref/L_ref

(we have a user-defined reference length and velocity, however it is simply important to make sure sTilde doesn't reach zero).

After that discussion, the LaRC web page you have cited was updated with a one-line note at the end of the original SA model description.

I wouldn't recommend the SA-Edwards model, as contrary to the authors' intention, it doesn't give the same results as the original model (rather, significantly reduced skin friction).

My hope is that by implementing the original SA with these limiters, you will be able to keep the model to a single, all-purpose variant that corresponds to the "industry standard".

Best regards,

Charlie.
charlie is offline   Reply With Quote

Old   February 17, 2010, 04:55
Default
  #7
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
I am not a big fan of clipping; I would prefer an approach where the formulation of the terms naturally obey the physical constraints. Do you have results that show that the original formulation with the clipping is better than the "Ashford" correction we currently use and distribute with OpenFOAM?

H
henry is offline   Reply With Quote

Old   February 17, 2010, 11:37
Default
  #8
New Member
 
Charles Mockett
Join Date: Dec 2009
Location: Berlin, Germany
Posts: 9
Rep Power: 16
charlie is on a distinguished road
Dear Henry,

I understand and share your concern - these things are certainly "not nice". However, in this case I was happy with the modification, for the following reasons:
  • It does not give rise to discontinuities in the converged solution (i.e. sTilde remains above zero everywhere), rather simply prevents a stable but spurious branch in the system of model equations.
  • It is "sanctioned" by the model authors and standard in the implementation of the original S-A model in many solvers, including the NASA solvers.

Now to your question:
Do you have results that show that the original formulation with the clipping is better than the "Ashford" correction we currently use and distribute with OpenFOAM?

I'm not familiar with the "Ashford" correction and didn't manage to find the PhD thesis easily, but assume this refers to the f_v3 modification. The f_v3 was by the way proposed by Spalart as an attempt to fix the problem of negative sTilde without clipping. I don't have results to show that the original+clipping is better than f_v3, since I haven't tried f_v3. All I have are citations that discourage the use of f_v3, for example Spalart writes in "Trends in Turbulence Treatments" (AIAA 2000-2306):

"...the f_v3 function, which we have recommended privately to some users. The f_v3 formula has an odd effect on transition at low Reynolds numbers, which we never fully understood. It was devised to prevent negative values of sTilde. We now recommend, instead, taking for sTilde the larger of the original f_v1 definition and 0.3 x S."

So, in summary, I just have "hearsay" and no concrete results of my own to say that one is better than the other. However, reputable and authoritative sources discourage the use of the unpublished f_v3. I would therefore personally be happier to see the original model with clipping as the standard OpenFOAM implementation. However, due to the source code acces it would of course be no problem for me to implement my preferred version should you decide to go for f_v3!

I hope this information is useful.

Best regards,

Charlie.
charlie is offline   Reply With Quote

Old   January 27, 2009, 12:01
Default Thanks Sébastien, I was als
  #9
Member
 
Etienne Lorriaux
Join Date: Mar 2009
Location: Compiegne, France
Posts: 45
Rep Power: 17
elorriaux is on a distinguished road
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.
elorriaux is offline   Reply With Quote

Old   January 27, 2009, 16:23
Default I have pushed the change to fv
  #10
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
I have pushed the change to fv2 to OpenFOAM-1.5.x, please let me know if this resolves the issues with this model.

Thanks

H
henry is offline   Reply With Quote

Old   January 27, 2009, 18:26
Default I agree that the fv3 term need
  #11
egp
Senior Member
 
egp's Avatar
 
Eric Paterson
Join Date: Mar 2009
Location: Blacksburg, VA
Posts: 197
Blog Entries: 1
Rep Power: 18
egp is on a distinguished road
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.




egp is offline   Reply With Quote

Old   January 28, 2009, 03:18
Default In these comparisons did you c
  #12
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
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
henry is offline   Reply With Quote

Old   January 28, 2009, 07:05
Default Henry, These plots were mad
  #13
egp
Senior Member
 
egp's Avatar
 
Eric Paterson
Join Date: Mar 2009
Location: Blacksburg, VA
Posts: 197
Blog Entries: 1
Rep Power: 18
egp is on a distinguished road
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 wall-shear 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 wall-function resolution.

Eric
egp is offline   Reply With Quote

Old   January 28, 2009, 07:10
Default http://www.cfd-online.com/Open
  #14
egp
Senior Member
 
egp's Avatar
 
Eric Paterson
Join Date: Mar 2009
Location: Blacksburg, VA
Posts: 197
Blog Entries: 1
Rep Power: 18
egp is on a distinguished road

egp is offline   Reply With Quote

Old   January 28, 2009, 07:11
Default http://www.cfd-online.com/Open
  #15
egp
Senior Member
 
egp's Avatar
 
Eric Paterson
Join Date: Mar 2009
Location: Blacksburg, VA
Posts: 197
Blog Entries: 1
Rep Power: 18
egp is on a distinguished road

egp is offline   Reply With Quote

Old   January 28, 2009, 07:16
Default When you ran with fv3 != 1 cou
  #16
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
When you ran with fv3 != 1 could you clarify which form of fv2 you running with?

H
henry is offline   Reply With Quote

Old   January 28, 2009, 07:16
Default Damn it, the image posting gre
  #17
egp
Senior Member
 
egp's Avatar
 
Eric Paterson
Join Date: Mar 2009
Location: Blacksburg, VA
Posts: 197
Blog Entries: 1
Rep Power: 18
egp is on a distinguished road
Damn it, the image posting gremlins are back...
egp is offline   Reply With Quote

Old   January 28, 2009, 07:20
Default tmp SpalartAll
  #18
egp
Senior Member
 
egp's Avatar
 
Eric Paterson
Join Date: Mar 2009
Location: Blacksburg, VA
Posts: 197
Blog Entries: 1
Rep Power: 18
egp is on a distinguished road
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);
}
egp is offline   Reply With Quote

Old   January 28, 2009, 07:28
Default That form is correct for fv3 =
  #19
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
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
henry is offline   Reply With Quote

Old   January 28, 2009, 07:33
Default Sure, I'd be happy to test it.
  #20
egp
Senior Member
 
egp's Avatar
 
Eric Paterson
Join Date: Mar 2009
Location: Blacksburg, VA
Posts: 197
Blog Entries: 1
Rep Power: 18
egp is on a distinguished road
Sure, I'd be happy to test it. I have all of the files, so it should be quick. I'll post results later today.
egp 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
SimpleFoam case with SpalartAllmaras turbulence model implemented nedved OpenFOAM Running, Solving & CFD 2 November 30, 2014 22: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 06:34
YPlus for SpalartAllmaras ddigrask OpenFOAM Running, Solving & CFD 1 December 12, 2008 14:29
Pow in lib64tlslibmso6 SigFpe when running coodles with SpalartAllmaras lillberg OpenFOAM Bugs 4 December 7, 2007 08:17


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