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

Regarding divergence schemes and laplacian schemes (OpenFoam)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By LuckyTran

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 4, 2023, 10:10
Exclamation Regarding divergence schemes and laplacian schemes (OpenFoam)
  #1
New Member
 
Rohan
Join Date: May 2023
Posts: 20
Rep Power: 2
Rohanbotta is on a distinguished road
Hello Foamers,
Please help me out with a small clarification regarding divergence schemes. So i have been assuming (for example: the statement "bounded Gauss linearUpwind limited") means upwind scheme is being used and linear upwind differencing is in play due to gauss linear upwind, and the limited term is a blend of both corrected and uncorrected schemes. All of these would result in the solver to be a blend of both first order and second order upwind based on above text.
So, was i on point on assumption or am i wrong and have been solving for first order upwind, as i didnt think much of the bounded term in the initial statement as bounded would be first order for bounded scalars. So just a little clarification required here guys.

Thank you,
Regards
Rohan
Rohanbotta is offline   Reply With Quote

Old   July 4, 2023, 14:47
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
First, let's get the most irrelevant part out of the way which is the bounded declaration. Bounded means you hard clip the value between a range, e.g. 0 and 1 when you are dealing with volume or mass fractions. We can ignore that you didn't specify the range in your question, but you would need to if you planned to use a bounded scheme.

Now the part you are actually interested in. Gauss is the only discretization scheme for divergence. Next is the interpolation scheme linearUpwind which itself needs a gradient scheme to be specified. linearUpwind uncorrected is your classical 2nd order upwind. If you use something else, then the results vary. limited scheme requires also a specification of a limiter coefficient (which you did not include) that specifies the amount of the non-orthogonal corrected to add. limited 0 is equivalent to uncorrected, limited 1 is equivalent to corrected. The most popular usage is limited 0.5. The stoopid explanation of what this does is it uses 2nd order upwind whenever possible and relaxes to 1st order upwind when you have really sharp gradients b/c your mesh stinks.

Depending on that limiter coefficient it can be all 2nd order, all 1st order, or almost always 2nd order (or almost always 1st order if you have a bad mesh).
Rohanbotta likes this.
LuckyTran is offline   Reply With Quote

Old   July 5, 2023, 15:03
Default
  #3
New Member
 
Rohan
Join Date: May 2023
Posts: 20
Rep Power: 2
Rohanbotta is on a distinguished road
Thanks a lot, luckytran
i thought i assumed wrong and bounded thing might be the problem as my results werent completely great in some cases, thanks for the clarification.
And regarding the limited part, so is it the nonorthogonal correcters i have to change to either 0 or 1, or as you said what peep usually use, 0.5? as in to control the linearupwind statement.
And about a mesh that sucks does it mean the mesh is quite coarse or does it depend on the case?
Thank you
Rohanbotta is offline   Reply With Quote

Old   July 5, 2023, 18:40
Default
  #4
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Mesh sucks means you have a nasty sliver with really poor cell quality, a very skewed cell for example. Coarse, but high quality meshes generally produce less steep gradients and don't cause problems.

You want to do limited 0.5 or less. Greater than 0.5 you know your solution will overshoot/undershoot so there are few practical uses for limited 0.5 or above, it's mostly for those that are academically curious. If your problem has a lot of coupling or non-linearities, you may need to go lower to limited 0.45 or limited 0.4 for example. It takes a lot of benchmarking to determine what is the best limiter to use so most people just set it to 0.5 and never touch it again (they have better things to do with their time).

Btw part of the confusion is that the overshoot/undershoot is also commonly referred to as unbounded/bounded. However, this is a different kind of boundedness than the "bounded schemes." Again, the "bounded schemes" are hard clipping intended for bounded scalars.
LuckyTran is offline   Reply With Quote

Old   July 6, 2023, 14:30
Default
  #5
New Member
 
Rohan
Join Date: May 2023
Posts: 20
Rep Power: 2
Rohanbotta is on a distinguished road
Thank you very much for the clarification, I'll try changing as per your suggestions. So, should i set the nonorthogonalcorrectors to 0.5? or is it something else that needs to be changed?
Rohanbotta is offline   Reply With Quote

Old   July 6, 2023, 19:54
Default
  #6
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
There is no nonorthogonalcorrectors in discretization schemes. If you mean nNonOrthogonalCorrectors, that is a parameter for the simple family of solvers, has nothing to do with this, and it only takes integers.


Even if there was such a setting, I recommend to never change two things at once: see Rule #1 in Poinsot
LuckyTran is offline   Reply With Quote

Old   July 6, 2023, 23:13
Default
  #7
New Member
 
Rohan
Join Date: May 2023
Posts: 20
Rep Power: 2
Rohanbotta is on a distinguished road
Yes, so where should I give this limited 0.5 or 1? I've checked the fvschemes file and did t get where to give this
Thank you
Rohanbotta is offline   Reply With Quote

Old   July 7, 2023, 00:56
Default
  #8
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
literally limited 0.5
linearUpwind limited 0.5


Also an example is given in the documentation.
LuckyTran is offline   Reply With Quote

Old   July 7, 2023, 01:12
Default
  #9
New Member
 
Rohan
Join Date: May 2023
Posts: 20
Rep Power: 2
Rohanbotta is on a distinguished road
ohhh, thank you very much
Rohanbotta is offline   Reply With Quote

Reply

Tags
openfoam


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
Clarification on Laplacian and the Divergence Schemes granzer OpenFOAM 2 February 10, 2022 19:47
Fundamental questions about numerical schemes Obad OpenFOAM Running, Solving & CFD 1 May 10, 2021 10:40
OpenFOAM vs ANSYS Fluent (Solution and Schemes) gentodin OpenFOAM Programming & Development 2 February 21, 2021 20:56
Laplacian Schemes msuaeronautics OpenFOAM Pre-Processing 3 May 19, 2013 21:59
OpenFOAM Laplacian schemes Chanti OpenFOAM Pre-Processing 1 April 8, 2013 06:44


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