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

Source Code for Spalart-Allmaras (2012) and a Rotation/Curvature Correction Variant

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 4 Post By lordvon
  • 1 Post By lordvon
  • 1 Post By mAlletto

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 6, 2013, 19:02
Default Source Code for Spalart-Allmaras (2012) and a Rotation/Curvature Correction Variant
  #1
Senior Member
 
Robert
Join Date: Sep 2010
Posts: 158
Rep Power: 15
lordvon is on a distinguished road
Hello all,
I have attached the source code for the Spalart-Allmaras (SA) model as detailed in "Modifications and Clarifications for the Implementation of the Spalart-Allmaras Turbulence Model" (Allmaras, Johnson, Spalart, 2012). It differs quite a bit from the default in OpenFOAM in these advantageous ways:

-Does not use fv3.
-Provides a calculation method for the modified vorticity (Stilda) to prevent negative values of Stilda.
-Solves a separate transport equation when nuTilda goes below zero.

Details for the items listed above can be found at the NASA Turbulence Modeling Resource Website for the SA model.

What is much more exciting is that I have also included a Spalart-Allmaras model with Rotation/Curvature Correction (RCC), as detailed in "A New, Simpler Rotation/Curvature Correction Method for the Spalart-Allmaras Turbulence Model" (Qiang, Yong, 2012).

I have tested both implementations on my own incompressible flow turbomachinery simulations, and the results are promising.

Please, look through the code and let me know of any possible improvements. I did not delete any of the original OpenFOAM code and left them in as comments, to make comparisons easier. Also I would like to hear your thoughts on the validity of the particular RCC method I used.

The code is attached below, or you can find it at: https://github.com/lordvon/OpenFOAM_Additions

TO USE ON YOUR MACHINE:
1. 'sudo bash' and login
2. Go to $FOAM_SRC/turbulenceModels/incompressible/RAS/SpalartAllmaras
3. Replace files in this directory with the files of the model you want
4. Go to $FOAM_SRC/turbulenceModels/incompressible/RAS
5. 'wmake'
6. After compiling is finished, the turbulence model should be active and ready to use.
Attached Files
File Type: gz SA.tar.gz (4.9 KB, 104 views)
File Type: zip SA.zip (20.2 KB, 117 views)
arjun, kiddmax, MPJ and 1 others like this.

Last edited by lordvon; September 24, 2013 at 00:56.
lordvon is offline   Reply With Quote

Old   April 24, 2014, 10:25
Default
  #2
New Member
 
Marian Fuchs
Join Date: Dec 2010
Location: Berlin, Germany
Posts: 9
Rep Power: 15
Fuchs is on a distinguished road
Dear Robert,

thanks for sharing your code. I had a quick look at your source code for the new SA-model variant from the 2012 Allmaras et al. paper and have a few questions concerning some implementation details:

- in the referenced paper, it is said that eddy viscosity nu_t is 0 if negative nuTilde is produced. So, when computing nut (lines 397 and 447), there should be another pos-function which ensures nut = 0 if nuTilde < 0, right?
- the clipping of nuTilde is still active in your code (line 443). I think this should be deactivated to allow nuTilde to become negative, otherwise adding the negative SA-model is not necessary.

You wrote that you already tested the new model for an incompressible turbomachinery case. Did you also test the standard Spalart-Allmaras model? (you can find the model equations for the standard model here:
http://turbmodels.larc.nasa.gov/spalart.html) As numerical stability issues for the SA model occur only for some cases, it would be interesting to know if the standard model can handle your turbomachinery case. If so, the case is not really suitable to assess the improvement achieved by using the new variant. A comparison to the SA-variant of OpenFOAM is also difficult, as this variant features additional non-physical behaviour such as undesired pseudo-transition.

best regards,
Marian
Fuchs is offline   Reply With Quote

Old   April 25, 2014, 01:10
Default
  #3
Senior Member
 
Robert
Join Date: Sep 2010
Posts: 158
Rep Power: 15
lordvon is on a distinguished road
Thanks for taking the time to look at my code. Your two points may be correct; I will have a look at my code and the paper.

I tested both standard and curvature correction (CC) models on the same setup. What I was looking for was the over-prediction of nut with the standard model in regions of high streamline curvature. With the CC model, the over-prediction was alleviated in the expected regions, which I took to be an affirmation of its superiority over the standard model.
lordvon is offline   Reply With Quote

Old   January 20, 2015, 23:13
Default Spalart Allmaras turbulence model
  #4
New Member
 
Venkatesh Devaraj
Join Date: Jan 2015
Posts: 8
Rep Power: 11
Venkatesh Devaraj is on a distinguished road
Hi, I am trying to write a fortran code for SA model. Can u give some suggestion or hint to start with?
Venkatesh Devaraj is offline   Reply With Quote

Old   January 21, 2015, 13:42
Default
  #5
Senior Member
 
Robert
Join Date: Sep 2010
Posts: 158
Rep Power: 15
lordvon is on a distinguished road
Sure, just copy the formulas in the source and tweak it to be consistent with Fortran syntax.
Venkatesh Devaraj likes this.
lordvon is offline   Reply With Quote

Old   January 22, 2015, 08:27
Default
  #6
New Member
 
Venkatesh Devaraj
Join Date: Jan 2015
Posts: 8
Rep Power: 11
Venkatesh Devaraj is on a distinguished road
Thanks Robert. I will try
Venkatesh Devaraj is offline   Reply With Quote

Old   October 24, 2016, 09:39
Default
  #7
Member
 
Peter
Join Date: Nov 2015
Location: Hamburg, Germany
Posts: 57
Rep Power: 10
potentialFoam is on a distinguished road
Dear Foamers,

unfortunately, I am facing problems implementing the SpalartAllmaras turbulence model with Rotation/Curvature correction into OF 3.0.1. I wrote a post here:
http://www.cfd-online.com/Forums/ope...tml#post622754

It would be very cool, if someone could help me out!
potentialFoam is offline   Reply With Quote

Old   December 26, 2016, 07:56
Default
  #8
New Member
 
chengzhonglin
Join Date: Dec 2016
Posts: 1
Rep Power: 0
Alfred Cheng is on a distinguished road
Hi,have u done it? or can u give some advice?
Quote:
Originally Posted by Venkatesh Devaraj View Post
Hi, I am trying to write a fortran code for SA model. Can u give some suggestion or hint to start with?
Alfred Cheng is offline   Reply With Quote

Old   January 1, 2024, 05:33
Default
  #9
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
There is a paper with the spalart allmaras model with RC published along with the source code https://journal.openfoam.com/index.p...rticle/view/97
geth03 likes this.
mAlletto is offline   Reply With Quote

Old   February 8, 2024, 03:32
Default
  #10
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 355
Rep Power: 8
geth03 is on a distinguished road
Quote:
Originally Posted by mAlletto View Post
There is a paper with the spalart allmaras model with RC published along with the source code https://journal.openfoam.com/index.p...rticle/view/97
thank you, also for providing the source code and test cases.
geth03 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
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 04:13


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