CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Source Code for Spalart-Allmaras (2012) and a Rotation/Curvature Correction Variant (https://www.cfd-online.com/Forums/openfoam-programming-development/123209-source-code-spalart-allmaras-2012-rotation-curvature-correction-variant.html)

lordvon September 6, 2013 20:02

Source Code for Spalart-Allmaras (2012) and a Rotation/Curvature Correction Variant
 
2 Attachment(s)
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.

Fuchs April 24, 2014 11:25

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

lordvon April 25, 2014 02:10

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.

Venkatesh Devaraj January 21, 2015 00:13

Spalart Allmaras turbulence model
 
Hi, I am trying to write a fortran code for SA model. Can u give some suggestion or hint to start with?

lordvon January 21, 2015 14:42

Sure, just copy the formulas in the source and tweak it to be consistent with Fortran syntax.

Venkatesh Devaraj January 22, 2015 09:27

Thanks Robert. I will try

potentialFoam October 24, 2016 10:39

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!

Alfred Cheng December 26, 2016 08:56

Hi,have u done it? or can u give some advice?
Quote:

Originally Posted by Venkatesh Devaraj (Post 528390)
Hi, I am trying to write a fortran code for SA model. Can u give some suggestion or hint to start with?


mAlletto January 1, 2024 06:33

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 February 8, 2024 04:32

Quote:

Originally Posted by mAlletto (Post 862473)
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.


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