|
[Sponsors] |
Difficulty with Boundary Conditions in K-Omega SST |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
Join Date: Mar 2025
Location: United States
Posts: 6
Rep Power: 2 ![]() |
Hello,
After many hours trying to figure this out, I'm at a loss. I will preface this with the fact that my knowledge of aerodynamics is not as solid as it should be, and I'm hoping to at least be pointed in the right direction. I am attempting to simulate a single Selig-1223 wing element at 20 degrees AOA and 15m/s (Re>100,000) in a mesh generated in Ansys, so that I can prove similarity of results. I was able to do this easily with Spalart-Allmaras, but the kOmegaSST model is providing a far more difficult fight. I started with the default conditions from the motorBikeSteady case and loaded my mesh in, which resulted in a brief runtime ending in a floating point error. From the iteration readout I can see that leading up to the crashes, the GAMG solver on p starts reaching 1000 iterations for several timesteps and then crashing. Attached file is the output from one example of this. I have tried dozens of boundary conditions for k and omega, including but not limited to fixedValue, zeroGradient, and turbulentIntensityKineticEnergyInlet. I am at a loss as to how to fix this. If anyone can offer some guidance on how to bring this back into the realm of stability I would greatly appreciate it. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 825
Rep Power: 16 ![]() |
Some typical approaches to improve stability:
1. You are running SIMPLE and so the fields need relaxing - check your relaxation factors and adjust if necessary. 2. Start your simulation with stable solver settings (eg upwind divSchemes, more conservative settings for laplacianSchemes and snGradSChemes) 3. Check your mesh quality, and if poor then improve! 4. Check your freestream turbulence levels in the domain (i.e. plot them before the crash) - have they decayed to nothing? Turbulence adds diffusion, which can add stability to the solution. Good luck! |
|
![]() |
![]() |
![]() |
![]() |
#3 | ||||
New Member
Join Date: Mar 2025
Location: United States
Posts: 6
Rep Power: 2 ![]() |
Quote:
U: 0.9 -> 0.7 k: 0.5 -> 0.3 omega: 0.5 -> 0.3 p: Does Not Exist -> 0.3 Quote:
default none; div(phi,U) bounded Gauss linearUpwindV grad(U); -> Gauss linearUpwind div(phi,k) bounded Gauss upwind; -> Gauss upwind div(phi,omega) bounded Gauss upwind; -> Gauss upwind div((nuEff*dev2(T(grad(U))))) Gauss linear; Quote:
Quote:
|
|||||
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 825
Rep Power: 16 ![]() |
For relaxation factors, beware that there are two sets - one for fields and one for equations. If you are running SIMPLE (ie have "consistent no;" in the SIMPLE{} block in fvSolution) then you will need something like:
Code:
relaxationFactors { fields { p 0.3; } equations { U 0.7; "(k|epsilon|omega)" 0.7; } Code:
relaxationFactors { equations { U 0.9; "(k|epsilon|omega)" 0.9; } On the divSchemes, try "bounded Gauss upwind;" on U, k & omega (the "bounded" is optional, but is relevant because you are running a steady solver). The 1st order scheme (linear uipwind is 2nd order) is more stable. On the mesh - what does checkMesh report? What's the max aspect ratio and the max non-orthogonality? If the a/r is too high, then the solver can struggle; if the orthogonality is bad then you'll need some non-orthogonal correctors to manage it. Finally, for "freestream" - yes, I meant the values out in the main domain, ie. the internalField values as you noted. Check the values (k, omega and nut) at the inlet are sensible, that the starting field (t=0) is sensible, and that they convect through the domain properly (t>0) without nut dying away to nothing. I hope that the above help you get closer. Otherwise, trying uploading the case and maybe I will be able to find some time to get it running. |
|
![]() |
![]() |
![]() |
![]() |
#5 | |||
New Member
Join Date: Mar 2025
Location: United States
Posts: 6
Rep Power: 2 ![]() |
Quote:
Quote:
Quote:
Due to size, I dumped the entire case into DropBox so that it can be accessed whenever needed. Please let me know if there are additional files or information needed, I can try to scrape information out of Ansys if more is needed. https://www.dropbox.com/scl/fi/bu4ry...=0a7d5v6n&dl=0 |
||||
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 825
Rep Power: 16 ![]() |
Okay - I think that we are getting somewhere. OpenFOAM CAN be overwhelming at the beginning, especially since it is much less forgiving than the main commercial codes that I spent decades using. On a positive note, there is lots of good training material out there (eg Joel Guerrero at Wolf Dynamics - I strongly suggest you google him; he has a YT channel as well), but you have to actively search for it.
The non-orthogonality is perhaps an issue - you should add in some correctors for this (change nNonOrthogonalCorrectors in the SIMPLE block in fvSolution to 3, for example. I will see if I have some time later on today to take a look at your dropbox case ... incidentally, which version of OF are you running? |
|
![]() |
![]() |
![]() |
![]() |
#7 | ||||
New Member
Join Date: Mar 2025
Location: United States
Posts: 6
Rep Power: 2 ![]() |
Quote:
Quote:
Quote:
Quote:
|
|||||
![]() |
![]() |
![]() |
![]() |
#8 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 825
Rep Power: 16 ![]() |
I have had a play with your test case - this is the thinking pattern that I applied.
I started by checking the fvSchemes/fvSolution set up, and changed a few things:
The simulation still blew up (continuity exploding). I then checked the boundaries. Your setup was probably okay, but I used the tutorial example airFoil2D to replace your inlet/outlet with freestream boundaries ... which essentially do the same thing. I also adjusted the inlet values to "more sensible" values. Had no effect; still crashed. I then plotted the fields in paraFoam (having adjusted controlDict to save every 5 iters) and the nut field looked very unhappy - a great big hole around the airfoil. The omega values are also enormous around the airfoil. So I extracted the yPlus values using foamPostProcess and this was illluminating: for time t=0, the y+ values on the airfoil vary from 2.5e-4 to 5.4e-4 ... i.e. are REALLY small - too small in fact. These should be order of 1. I imagine that this is the reason why the omega field goes crazy and the nut field collapses? So, in conclusion - please check your setup. The near-wall mesh seems to be exceedingly fine - is that intended? Seems too fine for the viscosity and velocity that you are running with. I don't imagine that you'll able to stabilise the kOmegaSST solver with such low y+ values, whatever you try. I hope that helps ... |
|
![]() |
![]() |
![]() |
![]() |
#9 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 825
Rep Power: 16 ![]() |
Just as an addendum, I increased the viscosity by a factor of 1000 (to bump up the y+ values), and the case seemed to run okay, which indicates that this is indeed the cause of your solution blowing up.
PS. you can run for 1000 iterations with an inflated viscosity to get the simulation up and running, and then restart with the correct viscosity value. That worked for me (with low Re wall boundaries - see my next post). Last edited by Tobermory; April 8, 2025 at 12:25. |
|
![]() |
![]() |
![]() |
![]() |
#10 | ||
New Member
Join Date: Mar 2025
Location: United States
Posts: 6
Rep Power: 2 ![]() |
Quote:
Quote:
Is there something either in fluentMeshToFoam or in the way the simulation is run that would cause such different behavior in OpenFOAM? |
|||
![]() |
![]() |
![]() |
![]() |
#11 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 825
Rep Power: 16 ![]() |
... and as an addendum to the addendum - it just occurred to me that you are using basic wall functions: nutkWallFunction on nut, omegaWallFunction on omega, kqRWallFunction on k.
Remember that for these to work properly, you need to ensure that the yplus is somewhere between 30 and 300. For resolved boundary layer simulations, dump the wall functions and use zeroGradient for k & nut and fixedValue of 1e-10 for omega at the wall. Running like this, and using the above viscosity hack, I got a plausible simulation with an average y+ of around 0.1 which is still a little low. |
|
![]() |
![]() |
![]() |
![]() |
#12 | |
Senior Member
Join Date: Dec 2021
Posts: 275
Rep Power: 6 ![]() |
Quote:
Hey, Since you brought it up first, I will mention that I have to scale down the meshes I import from Ansys, they are systemically a thousand time larger after import, so make sure to double check the bounding box dimensions reported by checkMesh, and you will probably see an issue. Although the fact that the y+ is so small makes me think you will have to scale up perhaps? |
||
![]() |
![]() |
![]() |
![]() |
#13 | |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 825
Rep Power: 16 ![]() |
Quote:
It looks like getting the simulation started in this stalled condition is the challenge - bumping up the viscosity for the first 500 iterations seems to help stabilise things. Although my simulation did eventually go nuts - it seems to really struggle at the trailing edge. Looking at the mesh - it is pretty bad there, with a sudden transition between slanted prism cells aligned with the airfoil to orthogonal cells. As ever, improving the mesh always helps improve simulation stability. Finally, thinking more about the flow case (stalled wing, strong separation off the back face, turbulent shedding etc.), then I think that the best approach for you might well be to model it as a transient case - especially with such a fine grid, where you will be resolving much of the turbulence shed from the wing. Transient solvers are inherently more stable than steady (no need for under-relaxation) ... BUT typically take much longer to run, and you will need to time average to get the mean lift, mean drag etc., so it's not a simple/easy suggestion. One to consider though if you can't get the steady approach to work. |
||
![]() |
![]() |
![]() |
![]() |
#14 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,306
Rep Power: 36 ![]() ![]() |
Quote:
Because they are not openfoam (or any other solver). The point is that they are not doing exactly same thing when the mesh is non perfect. The same thing would run in Wildkatze also just fine. Now we also do lots of things in different way than openfoam. For example, just the gradient procedure is at least two times more expensive than openfoam and makes sure that things work even if mesh has very bad cell quality. Per iteration cost then expected to be more than openfoam. So on perfect mesh OF might seem faster too. PS: In recent tests though, it seems wildkatze is 20 percent faster than OF per iteration. |
||
![]() |
![]() |
![]() |
![]() |
#15 |
Senior Member
Join Date: Dec 2021
Posts: 275
Rep Power: 6 ![]() |
Commercial softwares seem to tune the numerics on the fly depending on the mesh quality of course. In OpenFoam, it is up to the user, but there are many options to consider (although I have never managed to get a faster solution with OpenFoam, iteration wise, but I am not as knowledgeable as others).
Regarding the gradient computation and its ability to deal with poor mesh quality, the default is usually Gauss linear, but I have seen iterativeGauss linear being used with relative success, and leastSquares as well. That might help. Using the corrected scheme for laplacian and snGradSchemes is also quite ambitious considering the max non orthogonality of 85. I would go with uncorrected first, run the case, then switch to limited 0.2 and increase up to 0.5 if the case is stable. But I second Tobermory about the mesh quality being the most sensible factor to improve. |
|
![]() |
![]() |
![]() |
![]() |
#16 |
New Member
Join Date: Mar 2025
Location: United States
Posts: 6
Rep Power: 2 ![]() |
Thank you all for your help. I am starting work on making fresh meshes, although the Ansys meshing algorithm seems hellbent on making very open, rough meshes with many non-tets and throwing errors while doing so, but that's a problem for a different thread.
I had hoped that my boundary conditions were the main problem and would be a silver bullet to straighten out these crashing simulations, but as it seems with most CFD the mesh is the root of the problems here. I'll do some digging to see if I can find any good sources on how to avoid bad mesh features, and from there I should be on a better track. Again I greatly appreciate your help in figuring this out. |
|
![]() |
![]() |
![]() |
Tags |
boundary condition, floating point exception, komega sst model, openfoam, parallel computation |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ncrit for a glider Xfoil. How to use it. GPT4 answer | AlanMattanó | Main CFD Forum | 0 | April 10, 2023 12:16 |
Table bounds warnings at: END OF TIME STEP | CFXer | CFX | 4 | July 16, 2020 23:44 |
Waterwheel shaped turbine inside a pipe simulation problem | mshahed91 | CFX | 3 | January 10, 2015 11:19 |
Difficulty In Setting Boundary Conditions | Moinul Haque | CFX | 4 | November 25, 2014 17:30 |
Convective Heat Transfer - Heat Exchanger | Mark | CFX | 6 | November 15, 2004 15:55 |