CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Divergence when implementing Spalart-Allmaras turbulence model

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By sbaffini
  • 1 Post By sbaffini

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 4, 2023, 06:04
Default Divergence when implementing Spalart-Allmaras turbulence model
  #1
New Member
 
Join Date: Nov 2021
Posts: 8
Rep Power: 4
Jinn is on a distinguished road
Hi,

I was trying to implement the Spalart-Allmaras turbulence model into my FVM rotor solver, which can work well with the Baldwin-Lomax model.

The version of the S-A model I used is the "Standard" model on https://turbmodels.larc.nasa.gov/spalart.html#sa. I used the LUSGS scheme for time marching, and convective and viscous fluxes in the S-A model are 1st upwind and 2nd central scheme, respectively. The freestream nut is set to 3*nu as recommended. The case I am running is a hovering state of a 2-bladed rotor.

Now the computation suddenly diverges after 5 revolutions, when the force coefficients seem to have achieved a periodic solution. It is weird to me. Lowering the CFL number helps to delay the divergence but it still crashes finally.

Has anyone encountered similar problems? What are the possible causes of such a sudden divergence? Any ideas are welcomed!

Thanks in advance!!!
Jinn is offline   Reply With Quote

Old   December 4, 2023, 07:27
Default
  #2
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by Jinn View Post
Hi,

I was trying to implement the Spalart-Allmaras turbulence model into my FVM rotor solver, which can work well with the Baldwin-Lomax model.

The version of the S-A model I used is the "Standard" model on https://turbmodels.larc.nasa.gov/spalart.html#sa. I used the LUSGS scheme for time marching, and convective and viscous fluxes in the S-A model are 1st upwind and 2nd central scheme, respectively. The freestream nut is set to 3*nu as recommended. The case I am running is a hovering state of a 2-bladed rotor.

Now the computation suddenly diverges after 5 revolutions, when the force coefficients seem to have achieved a periodic solution. It is weird to me. Lowering the CFL number helps to delay the divergence but it still crashes finally.

Has anyone encountered similar problems? What are the possible causes of such a sudden divergence? Any ideas are welcomed!

Thanks in advance!!!
You should really first test your model implementation with some canonical test case as, indeed, available on the NASA LaRC site.
Jinn likes this.
sbaffini is offline   Reply With Quote

Old   December 4, 2023, 07:55
Default
  #3
New Member
 
Join Date: Nov 2021
Posts: 8
Rep Power: 4
Jinn is on a distinguished road
Thanks, prior to the rotor case I have already tested my implementation with some 2D airfoils and 3D wing test cases provided in the NASA validation archive. In these cases my computation results show good agreement with experiments and converge well. When it is applied to this rotor case, the sudden divergence occurs
Jinn is offline   Reply With Quote

Old   December 4, 2023, 08:07
Default
  #4
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by Jinn View Post
Thanks, prior to the rotor case I have already tested my implementation with some 2D airfoils and 3D wing test cases provided in the NASA validation archive. In these cases my computation results show good agreement with experiments and converge well.
It still seems quite a jump, for me, from a steady 2D case to an unsteady moving mesh 3D case.

Do you have any other equation based turbulence model? Is the model implementation based, say, on previously used components or is it just a whole new implementation?

If you were developing this for a commercial product you should have tens of cases in between so, no, two or three cases is not typically enough to be confident on a model implementation.

One thing that usually requires attention in the SA implementation is the non linear diffusive term, which requires rearrangement to be better implemented in a conservative FV code, but I have doubts it actually is your problem.

My suggestion is to carefully assess what are the elements of your failing case and test the code with intermediate mixes of ingredients.

In the end, SA is among the most stable models around and should not fail if other options don't as well.
sbaffini is offline   Reply With Quote

Old   December 4, 2023, 08:29
Default
  #5
New Member
 
Join Date: Nov 2021
Posts: 8
Rep Power: 4
Jinn is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
It still seems quite a jump, for me, from a steady 2D case to an unsteady moving mesh 3D case.

Do you have any other equation based turbulence model? Is the model implementation based, say, on previously used components or is it just a whole new implementation?

If you were developing this for a commercial product you should have tens of cases in between so, no, two or three cases is not typically enough to be confident on a model implementation.

One thing that usually requires attention in the SA implementation is the non linear diffusive term, which requires rearrangement to be better implemented in a conservative FV code, but I have doubts it actually is your problem.

My suggestion is to carefully assess what are the elements of your failing case and test the code with intermediate mixes of ingredients.

In the end, SA is among the most stable models around and should not fail if other options don't as well.
Thanks again for your kind and instructive advice! I agree that this is a huge jump because moving mesh is added in the rotor case.

Actually I am trying a whole new implementation without any other equation-based model, for academic use. And I did rearrange the diffusive term as advised.

I truly need to test the intermediate elements of my code first, before entering the mixed case.
Jinn is offline   Reply With Quote

Old   December 4, 2023, 08:31
Default
  #6
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Yes, I think so. I mean, you either are very lucky and just spot the error while wandering trough the code, or there is no magic, you do the test in little steps
Jinn likes this.
sbaffini is offline   Reply With Quote

Old   December 4, 2023, 09:51
Default
  #7
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,771
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Just to test your moving mesh, does it works without any turbulence model?
FMDenaro is online now   Reply With Quote

Old   December 4, 2023, 20:58
Default
  #8
New Member
 
Join Date: Nov 2021
Posts: 8
Rep Power: 4
Jinn is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Just to test your moving mesh, does it works without any turbulence model?
Yes, the rotor code works for both inviscid computation and B-L model.

I output the rotor flow fields of several time steps before it diverges, as attached.

The density and pressure contour exhibit some singularities in the wake region(cut boundary), which is the region of large turbulent viscosities. And this is the region where divergence occurs first.
Attached Images
File Type: jpg density_contour.jpg (31.0 KB, 15 views)
File Type: jpg mut_contour.jpg (35.5 KB, 11 views)
Jinn is offline   Reply With Quote

Old   December 5, 2023, 08:54
Default
  #9
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by Jinn View Post
Yes, the rotor code works for both inviscid computation and B-L model.

I output the rotor flow fields of several time steps before it diverges, as attached.

The density and pressure contour exhibit some singularities in the wake region(cut boundary), which is the region of large turbulent viscosities. And this is the region where divergence occurs first.
So, you have a mesh cut there which needs a bc? Just saying, have you checked that bc for the SA model?

Also, does the same code and case work when mesh rotation is set to 0?
sbaffini is offline   Reply With Quote

Old   December 5, 2023, 20:39
Default
  #10
New Member
 
Join Date: Nov 2021
Posts: 8
Rep Power: 4
Jinn is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
So, you have a mesh cut there which needs a bc? Just saying, have you checked that bc for the SA model?

Also, does the same code and case work when mesh rotation is set to 0?
Yes there's a cut bc, and I am currently examining it. For the SA model the cut bc value is given that of the opposite cell, which works for previous test cases.

And thanks for that hint, I will examine my code setting the rotation to 0, to check if the moving mesh part works well.
Jinn is offline   Reply With Quote

Reply

Tags
spalart-allmaras model, sudden diverge


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
Error: WorkBench Error: Could not handle event: SolutionStatusUpdate Kieyo Fluent Multiphase 0 November 9, 2022 23:58
Implementing a new turbulence model Sakun OpenFOAM 15 November 11, 2021 13:56
Fail to converge when solving with a fabricated solution zizhou FLUENT 0 March 22, 2021 06:33
Spalart Allmaras turbulence model Venkatesh Devaraj Main CFD Forum 0 January 20, 2015 23:22
Spalart Allmaras Turbulence model - Need article! CFD Student Main CFD Forum 0 December 27, 2004 04:28


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