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/)
-   -   nonorthogonal corrections, when and where to apply? (https://www.cfd-online.com/Forums/openfoam-programming-development/97009-nonorthogonal-corrections-when-where-apply.html)

andrejkoch February 7, 2012 06:00

nonorthogonal corrections, when and where to apply?
 
Hello!
I found that it is necessary to apply nonorthogonal corrections when working with skew meshes. What exactly are the necessary steps?

Do I merely add a loop
Code:

for (int nonOrth=0; nonOrth<nNonOrthCorr; nonOrth++){
  solve(...);
}

around each "solve(...)"?
The Programmer's guide mentions that snGradCorrection is also needed on nonorthogonal meshes. But snGradCorrection isn't called in any of the solvers.

What if I solve several equations in a segregated solver?
Do I run the loop on each individual equation:
Code:

for (int nonOrth=0; nonOrth<nNonOrthCorr; nonOrth++){ Eqn1.solve(); }
for (int nonOrth=0; nonOrth<nNonOrthCorr; nonOrth++){ Eqn2.solve(); }

Or do I run the loop over the whole sequence:
Code:

for (int nonOrth=0; nonOrth<nNonOrthCorr; nonOrth++){ Eqn1.solve(); Eqn2.solve(); }
In the example: http://openfoamwiki.net/index.php/Ho...ation_to_solve
TEqn.solve() is added *outside* the non-orthogonal corrections loop. Why? Is TEqn not affected by non-orthogonality?

If you know a good explanation for understanding the details of non-orthogonal corrections, please tell.

Thank you
Andrej

dshawul February 7, 2012 09:13

I am not an expert but I think the non-orthogonal corrections are applied as implicit and explicit term in the discretization of the equation to be solved. Look into Jasaak's thesis to see how it is done. For example the poison pressure equation solution has a laplacian term which can benefit from non-orthogonal correction. So whenever the loop is called the explicit correction term is modified thereby refining the solution. It is all automatic so you don't have to add a snGradCorrection term yourself, just specify that correction should be applied in the discretized equation in fvSchemes.
Hope it helps.

andrejkoch February 7, 2012 10:45

Daniel, thank you. That answers my first question.

Now what if I have to solve a sequence of equations?

And why is TEqn not corrected in the example from the Wiki?

Thank you
Andrej

dshawul February 7, 2012 16:36

Quote:

Originally Posted by andrejkoch (Post 343149)
Daniel, thank you. That answers my first question.

Now what if I have to solve a sequence of equations?

And why is TEqn not corrected in the example from the Wiki?

Thank you
Andrej

I think solution of the pressure equation with non-orthogonal correction should finish first before solving the transport equation. Once you know the corrected velocity field then you can solve transport equation of T. I suppose you can apply the correction to the diffusion term of T as well ( any implicit laplacian or snGrad term on a grid with skewed cells will benefit from multiple corrections ). So in case of T , i guess the correction is only applied once. It maybe that the pressure equation benefits more from multiple corrections depending on the skeweness of the grid.
Hope it helps
Wiki link: http://www.cfd-online.com/Wiki/Diffusion_term

Gerhard May 5, 2021 13:29

Hi,
This is an old thread, but if someone comes across it due to their interest in non-orthogonality, have a look at the following videos which describe it quite well:
https://www.youtube.com/watch?v=Dg2PwX6yxYY
https://www.youtube.com/watch?v=yU7r8mYK3bs


All times are GMT -4. The time now is 16:35.