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

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

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree4Likes
  • 3 Post By lordvon
  • 1 Post By lordvon

Reply
 
LinkBack Thread Tools 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: 154
Rep Power: 6
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, 40 views)
File Type: zip SA.zip (20.2 KB, 44 views)
kiddmax, MPJ and Venkatesh Devaraj 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: 6
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: 154
Rep Power: 6
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 21, 2015, 00:13
Default Spalart Allmaras turbulence model
  #4
New Member
 
Venkatesh Devaraj
Join Date: Jan 2015
Posts: 8
Rep Power: 2
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, 14:42
Default
  #5
Senior Member
 
Robert
Join Date: Sep 2010
Posts: 154
Rep Power: 6
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, 09:27
Default
  #6
New Member
 
Venkatesh Devaraj
Join Date: Jan 2015
Posts: 8
Rep Power: 2
Venkatesh Devaraj is on a distinguished road
Thanks Robert. I will try
Venkatesh Devaraj is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AMI speed performance danny123 OpenFOAM 19 October 24, 2012 07:44


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