CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Regarding divergence schemes and laplacian schemes (OpenFoam) (https://www.cfd-online.com/Forums/main/250688-regarding-divergence-schemes-laplacian-schemes-openfoam.html)

Rohanbotta July 4, 2023 10:10

Regarding divergence schemes and laplacian schemes (OpenFoam)
 
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

LuckyTran July 4, 2023 14:47

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 July 5, 2023 15:03

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

LuckyTran July 5, 2023 18:40

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.

Rohanbotta July 6, 2023 14:30

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?

LuckyTran July 6, 2023 19:54

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

Rohanbotta July 6, 2023 23:13

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

LuckyTran July 7, 2023 00:56

literally limited 0.5
linearUpwind limited 0.5


Also an example is given in the documentation.

Rohanbotta July 7, 2023 01:12

ohhh, thank you very much


All times are GMT -4. The time now is 04:27.